mirror of
https://github.com/Pasta-Devs/Marinara-Engine.git
synced 2026-12-03 19:00:50 +07:00
[GH-ISSUE #2751] [Issue]: Image prompt compiler drops subjects, mis-genders (forced 1girl), and inverts negative instructions on the compact path #1389
Labels
No labels
android
bug
bugfix
ci
client
code freeze pause
container
dependencies
docs
documentation
duplicate
enhancement
feature
feature
feature
feature-creep
fixed-in-refactor
fixed-in-staging
good first issue
help wanted
in-pr
in-pr
needs-codeowner-decision
normal-scope
old-codebase
old-codebase
pull-request
qol
question
refactor
regression
revisit later
roadmap
scope-risk
scope-risk
server
server
shared
soup
upstream
windows
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
Pasta-Devs/Marinara-Engine#1389
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @kolacheee on GitHub (Jun 21, 2026).
Original GitHub issue: https://github.com/Pasta-Devs/Marinara-Engine/issues/2751
Originally assigned to: @SpicyMarinara on GitHub.
Summary
The shared image-prompt compiler's compact/distill path (used for portrait/avatar/selfie/sprite and tagged/danbooru profiles) corrupts prompts in several reinforcing ways: it discards the actual subject description, forces a hardcoded gender tag, mis-infers gender from incidental pronouns, injects contradictory cues from independent source parts, and loses/inverts user exclusions. Combined, an NPC portrait or in-chat illustration can render a generic anime woman with none of the requested species/features and with excluded content present. All confirmed by executing the compiled compiler against real inputs.
Sub-bug 1: Subject silently dropped (#24)
compactVisualPromptforcescompactPrompt, so the prompt is run throughdistillTaggedPromptSource(shouldDistill=true). Only short comma-tags, a few hardcoded visual regexes, or a fixed Western-human whitelist survive; natural-language or non-human subjects fail all three and are discarded. With a built-in profile (non-empty subjectTags), thefallbackPositiveFragmentsrescue never fires.Sub-bug 2: '1girl' forced (#25)
profileSubjectTags = profile.subjectTags[kind]is appended unconditionally (lines 42/64/70). Danbooru portrait subjectTags = '1girl, solo, portrait, upper body, looking at viewer' (image-style-profiles.ts:68) with no gender reconciliation. On Illustrious/Pony/NovelAI/SDXL-danbooru checkpoints '1girl' is a top-weight tag that overrides a textual 'male'.Sub-bug 3: Gender mis-inference via else-if (#55)
deriveTaggedSourceCues(266-282) tests female (she|her|hers|woman|female|girl|lady) before male via else-if, scanning the whole source. Any female pronoun referring to a different person forces 'female' (priority-0, never budget-dropped) and the male branch never runs.Sub-bug 4: Contradictory per-part cues (#56)
deriveTaggedSourceCuesruns independently for generatedStyle, input.prompt, and userPositive; dedupe only removes exact duplicates, so 'female' and 'male' (distinct keys, both priority 0) both survive into the tag prompt. The game NPC path passes art-style separately from the per-NPC prompt, so a gendered word in the style conflicts with the subject.Sub-bug 5: Negatives dropped / inverted (#26)
avoid/exclude/do not include Xwhose content isn't in the narrow negative whitelist is pushed only to diagnostics (movedNegativeFragments) and never tonegativeFragments(dropped).no X/without Xaren't matched byhasAvoidInstructionPrefixand fail the whitelist, so they fall through to the POSITIVE prompt — inverting intent.Suggested Fix
hasVisualCueallowlist with a small deny-list so unknown/fantasy/non-human nouns are kept by default.avoid/no/without Xcontent intonegativeFragmentsregardless of whitelist; addno/withoutto the avoid-prefix matcher; consider scoping the prompt-text scan to the scene prompt.Verification checklist (all manual)
pnpm checkAffected files
packages/shared/src/utils/image-prompt-compiler.tspackages/shared/src/constants/image-style-profiles.tspackages/server/src/services/game/game-asset-generation.tsAudit provenance
Found by a multi-agent static audit of the TTS/voice + image-generation subsystems (Round 1 + round-2 gap sweep + completeness critic, each finding adversarially verified) against the merged
stagingtree. Severity: HIGH.@SpicyMarinara commented on GitHub (Jun 21, 2026):
Addressed on PR #2747. The shared image-prompt compiler now keeps fallback source fragments when compact distillation would drop the subject, derives subject cues once from the actual prompt/user-positive text, reconciles gendered profile subject tags against that cue, makes the built-in danbooru portrait tag gender-neutral, and routes avoid/no/without/exclude instructions into the negative prompt instead of positive text. Validated with git diff --check for the touched files; full pnpm validation is deferred until the end of the issue sweep per maintainer request.