mirror of
https://github.com/Pasta-Devs/Marinara-Engine.git
synced 2026-12-03 19:00:50 +07:00
[PR #4457] [MERGED] NO MERGIE!: fix(noodle): send image instructions to the timeline model, not the image model #6387
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#6387
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?
📋 Pull Request Information
Original PR: https://github.com/Pasta-Devs/Marinara-Engine/pull/4457
Author: @Gunterlie
Created: 8/2/2026
Status: ✅ Merged
Merged: 8/2/2026
Merged by: @Gunterlie
Base:
staging← Head:fix/noodle-image-instructions-bypass-llm📝 Commits (7)
6434673fix(noodle): send image instructions to the timeline model, not the image modelc94c301fix(noodle): drop LLM-facing framing from the image prompt blocks7376f73fix(image): keep prompt labels out of the diffusion prompt1191ef8Merge branch 'staging' into fix/noodle-image-instructions-bypass-llmb66f248test(noodle): cover the shared appearance block, and scope the changelog claimbd671a3Merge remote-tracking branch 'origin/fix/noodle-image-instructions-bypass-llm' into fix/noodle-image-instructions-bypass-llmd521992Merge branch 'staging' into fix/noodle-image-instructions-bypass-llm📊 Changes
6 files changed (+71 additions, -14 deletions)
View changed files
📝
CHANGELOG.md(+6 -0)📝
packages/client/src/localization/locales/en.json(+2 -2)📝
packages/server/src/services/image/illustrator-references.ts(+3 -1)📝
packages/server/src/services/noodle/noodle-prompt.ts(+6 -1)📝
packages/server/src/services/prompt-overrides/registry/noodle.ts(+7 -7)📝
scripts/regressions/noodle-prompt.regression.ts(+47 -3)📄 Description
Why
A user reported that Noodle image generation "bypasses the LLM": anything typed into Noodle Settings → image prompt instructions arrived at their local ComfyUI verbatim, with no character context. Their instruction string — "Create a social-media-ready character image. Mention build, clothing, appearance, body details, pose, expression, setting, lighting, mood, composition. Use precise language..." — appeared in the generated image's metadata as literal prompt text.
That is what the code does today. Noodle runs no LLM refinement pass for images. The timeline model writes
imagePromptalongside the post text (noodle-prompt.ts:375), and thennoodle-noodler-images.service.ts:115/noodle-public-images.service.ts:193string-join that draft with appearance notes, personality, card image habits, and the user's instructions, and send the result straight to the generator. The setting is named and positioned like a system prompt but behaves like a prompt suffix, so writing instructions into it is the natural mistake.Outside Noodle, the illustrator path does run instructions through the LLM first, which is why the behavior only looks broken here.
The reporter's ComfyUI screenshot shows the two halves cleanly: the model's own
imagePrompt(a competent scene description) followed by the pasted-on instruction sentence.What changed
1. Instructions go to the model that can act on them
imageGenerationPromptis appended to the Noodle timeline feature instructions inside theenableImagePromptsbranch, so the model reads it as direction while writingimagePrompt. The line states explicitly that the text is an instruction, not something to copy into the field.userInstructionsis removed from the defaultnoodle.imagePosttemplate. The variable stays registered, so custom templates referencing it still resolve.2. No LLM-facing prose in the image prompt
The personality block was sending
Let these traits naturally influence the subject, image quality, camera habits, mood, and compositionto the image model, plusCharacter personality and traits:/Character-specific image instructions:labels. Nothing re-reads this string after the template renders, so that framing was dead weight competing for CLIP token budget. Bare values now.3. Naming
noodle.imagePostoutput reaches the image model verbatim with no LLM pass after it.Both image services share the template, so the NoodleR and public-account feeds are both covered — fixing only the reported path would have left the other leaking.
Not our bug
In the reporter's screenshot the instruction text is split across positive and negative prompts, breaking on the word "avoid". Nothing in
packages/server/src/services/image/or the Noodle services does that — it is theircomfyui-umeairt-toolkitnode parsing the prompt for negatives. It resolves itself once we stop sending prose down that path.Behavior change to flag
Anyone using this field for style tokens (
photorealistic, 85mm, natural lighting) will now see those go to the LLM rather than the generator. Image style profiles are the supported home for that and still apply to every Noodle image. Noted in the CHANGELOG.Test plan
pnpm checkimagePromptvisibly reflects the instructions (asking for lighting and composition should produce those details)imagePrompt. This is the main residual risk:normalizeNoodleImagePrompt(noodle-image-prompt.ts:34) exists because weaker local models parrot these labels, and this change puts the instructions in front of the model. Worth testing on a smaller local model specifically.noodle.imagePostoverride referencing{{userInstructions}}renders without errorNotes
stagingperCONTRIBUTING.md § Branches.docs-i18nlanguage packs may need a follow-up.pnpm checkpasses, but no timeline refresh or ComfyUI generation was run.Correction and follow-up (negative-prompt leak)
I earlier told the reporter the positive/negative split was their ComfyUI toolkit's doing. That was wrong — it is ours. I had grepped
packages/server/src/services/image/and missed that the compiler is re-exported frompackages/shared.extractNegativeFragment(packages/shared/src/utils/image-prompt-compiler.ts:943) matches^(avoid|no|without|exclude|do not include|don't include)\s+(.+)against every positive fragment and moves the remainder into the negative prompt (image-prompt-compiler.ts:174-177). So"Use precise language, avoid euphemisms or sanitized wording"splits into positiveUse precise languageand negativeeuphemisms or sanitized wording— exactly the reporter's screenshot.For genuine visual prose (
"no hat"→ negativehat) this is the intended feature. The defect is that free prose reaches the compiler at all. Character card descriptions are full of sentences like "No one knows what happened to her sister", which this heuristic happily converts into the negative tagone knows what happened to her sister.This PR removes two of the three prose sources (settings instructions, block labels/framing). The third remains and needs a maintainer decision:
characterAppearanceFromRow(noodle-public-images.service.ts:87) falls back to the raw carddescriptionfield when no dedicated illustrator appearance is set:normalizeIllustratorAppearancecaps it at 1400 chars, so it is bounded, but it is still raw card prose going to a diffusion model — and any negation sentence inside it gets pulled into the negative prompt.Two candidate fixes, deliberately not taken here:
descriptionfallback for Noodle so only a real appearance field is used. Cleanest, but characters without that field lose appearance conditioning entirely — an image-quality tradeoff that is a maintainer call.extractNegativeFragmentto short tag-like fragments. This is a shared choke point used by every image path in the app; tightening it on a hunch risks breaking legitimate negatives ("no text or watermarks"is indistinguishable from card prose by word count alone).I did not want to guess at either from outside the project's quality bar.
Also spotted, out of scope:
buildSceneIllustrationAppearanceNotes(game-asset-generation.ts:1080) builds its ownCharacter appearance notes:header for the Game Mode scene path, andprompt.regression.ts:3957asserts that header is present. Same leak, different path, with a test pinning current behavior — worth a separate issue.Verification
pnpm check— passespnpm regression:noodle— passes (14 lanes)pnpm regression:prompt— passespnpm regression:roleplay— passesStill not verified at runtime: no timeline refresh or actual ComfyUI generation was run by the author.
Summary by CodeRabbit
New Features
Bug Fixes
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.