mirror of
https://github.com/Pasta-Devs/Marinara-Engine.git
synced 2026-12-03 19:00:50 +07:00
[PR #7360] [MERGED] fix(images): image prompt writers follow Style text and instructions without pasting them #7697
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#7697
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/7360
Author: @SpicyMarinara
Created: 10/9/2026
Status: ✅ Merged
Merged: 10/9/2026
Merged by: @SpicyMarinara
Base:
staging← Head:fix/7357-image-prompt-instructions📝 Commits (9)
1da362efix(images): image prompt writers follow Style text and instructions without pasting them (#7357)eba18f3Move the CHANGELOG entry away from other open PRs6591855fix(images): clean only the prompt writer's own output (#7357)537c2f3fix(images): tidy removed guidance without a slow regex (#7357)901e278fix(images): find copied guidance by words, keep tag phrases and a subject (#7357)b4aab7efix(images): keep wrapped guidance sentences whole; check every writer path (#7357)03af05efix(images): drop an Illustrator style that only repeats the Style text (#7357)e0eee6cdocs(noodle): say Style text is still added with Interpret image prompts off (#7357)204150ddocs(changelog): copied short phrases and tag lists stay (#7357)📊 Changes
15 files changed (+597 additions, -42 deletions)
View changed files
📝
CHANGELOG.md(+2 -0)📝
docs/media/style-profiles.md(+1 -1)📝
docs/noodle/settings.md(+3 -1)📝
packages/server/src/routes/gallery.routes.ts(+7 -1)📝
packages/server/src/routes/generate.routes.ts(+15 -3)📝
packages/server/src/routes/generate/retry-agents-route.ts(+15 -4)📝
packages/server/src/services/agents/agent-executor.ts(+1 -1)📝
packages/server/src/services/generation/conversation-selfie-command-runtime.ts(+19 -2)📝
packages/server/src/services/generation/illustrator-background-generation.ts(+22 -10)📝
packages/server/src/services/generation/illustrator-manual-prompt-generation.ts(+13 -10)📝
packages/server/src/services/image/image-prompt-compiler.ts(+1 -0)📝
packages/server/src/services/prompt-overrides/registry/noodle.ts(+2 -1)📝
packages/shared/src/utils/image-prompt-compiler.ts(+72 -8)➕
scripts/regressions/image-prompt-guidance.regression.ts(+281 -0)📝
scripts/regressions/prompt.regression.ts(+143 -0)📄 Description
Linked issue
Closes #7357
Package side: Noodle 1.5.3 for Pasta-Devs/Marinara-Agents#1282. Follows Pasta-Devs/Marinara-Engine#7342 and Pasta-Devs/Marinara-Engine#7352 (#7318).
Why this change
stylefield". The Engine then prepends the writer'sstyleto the image prompt. So a writer that echoed the Style text (for example the Danbooru profile's "Danbooru-tagged anime generation for SDXL, Illustrious, Pony, NovelAI, and similar checkpoints.") put it back into the prompt word for word. #7342'somitProfileStyleTextonly stopped the Engine itself from adding it./illustrategave the writer the instructions in the system prompt, above the character cards and the whole chat. The automatic Illustrator call puts them in the final user message, next to the request.resolveImageStyleGuidanceTextignored every profile based on Auto. Selfie prompts are compiled withomitProfileStyleText, so that text went nowhere.What changed
packages/shared/src/utils/image-prompt-compiler.ts:removeCopiedPromptGuidance(text, guidance)removes each sentence of guidance that a writer copied word for word, ignoring case and punctuation. It compares word tokens, with no regex built from settings text..,!or?and has at least four words between commas. Tag lists and tag phrases such as "masterpiece, best quality" or "cold lighting with deep shadows" are never removed.ponytail:note records that shorter or unpunctuated instructions are kept even when copied.resolveImageStyleGuidanceTextnow leaves out only the unedited built-in Auto sentence.compileImagePromptitself is unchanged.The writer's own output is cleaned before any configured text (positive tags, appearance notes, reference lines) is added, so literal fields stay literal:
generate.routes.tsandgenerate/retry-agents-route.ts(Illustrator, also Image Prompt Review): the writer'spromptandstyle, against the style instruction it got and the image connection's Image Prompting Instructions;conversation-selfie-command-runtime.tsandgallery.routes.ts(selfies): the writer's prompt, against the style guidance, the connection's instructions and the card's conversation image instructions;illustrator-background-generation.ts: the background writer's scene prompt.agent-executor.ts,illustrator-manual-prompt-generation.ts,illustrator-background-generation.ts: the style instructions now say to express the style in image-model words and never copy the instruction's sentences. Model-facing text only.illustrator-manual-prompt-generation.ts: the<image_prompting_instructions>block moves from the system prompt into the final request message, like the automatic Illustrator call.illustrator-background-generation.ts: the background writer gets the image connection's instructions.prompt-overrides/registry/noodle.ts: the Engine's copy ofnoodle.imagePostmatches Noodle 1.5.3. ThecharacterDescriptionvariable now says the rewrite model gets the notes as context. Diffed identical fromNOODLE_IMAGE_POSTdown.Docs:
docs/media/style-profiles.mdsays in one sentence where Style text goes.docs/noodle/settings.mdadds Interpret image prompts and says what it and Include descriptions do.CHANGELOG.md: one[Unreleased]entry.scripts/regressions/prompt.regression.ts: new case "Image prompt writers follow Style text and Image Prompting Instructions without pasting them (#7357)". It covers:It fails against staging's code.
Every image-prompt path (audit for #7357)
<illustrator_image_style>block; copies removed (new). Game with a campaign art style uses that instead (unchanged, by design)/illustrate, retries, Image Prompt Review/selfie, gallery selfieCard appearance stays literal where it is documented as such (Attach Card Appearance, Image Appearance Override); Personality and image habits only reach writers.
Not changed here (needs a maintainer decision)
User image instructions: …, asdocs/game/storyboard.mddocuments ("Required image instructions still apply").Validation
pnpm checkpasses locallyCONTRIBUTING.mdManual verification notes
/selfiewith a copy of Auto whose Style text is "watercolor" comes out in a watercolor style (the debug log[debug/commands/selfie] prompt-builder systemshows the style guidance).characterDescriptionnote.Agent-run checks:
pnpm check(through the shared slot limiter) passes.pnpm regression:promptpasses. Targeted regressions all pass:noodle/prompt,illustrator-disconnect,illustrator-manual-cadence,illustrator-reference-scope,illustrator-visual-retry,illustrator-message-range,illustrator-character-prompts,roleplay-commands,novelai-character-caption-cap,issue-sweep-5380-5434,open-issues,assigned-issue-sweep,assigned-chat-sweep,agent-runtime,capability-agent-runtime,manual-agent-retry-resolution,avatar-lead-prompt,sprite-background,lorebook-image-prompt. The new #7357 case was run against the original code with the new helper stubbed out. It fails there on the echoed Style sentence, and it was the only failure. No browser or live image generation was run.Local CodeRabbit (
coderabbit review --agent --committed, 4 findings), all handled in659185520:compileImagePromptcould also remove a configured positive prompt that repeats an instruction sentence. Fixed: the cleanup moved to the writer's own output at each call site, before configured text is added. The regression now covers that case.style-profiles.mdwas too long. Split.CodeQL flagged the comma cleanup in
removeCopiedPromptGuidanceas a polynomial regular expression on long runs of whitespace. Fixed in537c2f3bd: each line is now split on commas, trimmed and joined without empty parts. CodeQL is clean on the new head.GitHub CodeRabbit raised four threads, all fixed and resolved. Fixed in
901e2784f:That commit also counts only guidance written as a sentence, following the same review on the Noodle copy. Fixed in
b4aab7ea1:Docs and release impact
docs-i18nbranch updated to match, or a[docs-i18n]follow-up issue opened (see CONTRIBUTING.md § Translated documentation)docs/media/style-profiles.mdanddocs/noodle/settings.mdchanged; the[docs-i18n]follow-up is #7359. CHANGELOG is updated.UI evidence (if applicable)
No layout change. Image Prompt Review shows prompts without copied Style text or instructions.
Summary by CodeRabbit
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.