[PR #7342] [MERGED] fix(images): keep the Auto style instruction out of final image prompts #7689

Closed
opened 2026-10-24 04:06:34 +07:00 by bsakaguchi · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/Pasta-Devs/Marinara-Engine/pull/7342
Author: @SpicyMarinara
Created: 10/9/2026
Status: ✅ Merged
Merged: 10/9/2026
Merged by: @SpicyMarinara

Base: staging ← Head: fix/7318-image-prompt-instructions


📝 Commits (4)

  • f63500e fix(images): keep the Auto style instruction out of final image prompts
  • 72df329 Merge origin/staging into fix/7318-image-prompt-instructions
  • 325c6dd fix(images): keep user-written Auto Style text in image prompts
  • 2527497 Merge origin/staging into fix/7318-image-prompt-instructions

📊 Changes

3 files changed (+62 additions, -7 deletions)

View changed files

📝 CHANGELOG.md (+1 -0)
📝 packages/shared/src/utils/image-prompt-compiler.ts (+13 -7)
📝 scripts/regressions/prompt.regression.ts (+48 -0)

📄 Description

Important

Contributions target staging. Only SpicyMarinara may promote this repository's staging branch or a same-repository hotfix/* branch to main.
Outside and first-time contributors also require an approving review from SpicyMarinara.

Linked issue

Closes #7318

Why this change

  • The reporter (ComfyUI, Danbooru-style tags, Illustrator 1.0.4, Noodle 1.5.1) found text written for the AI prompt writer ending up word for word in the prompt sent to ComfyUI, after the quality tags and the model's output.
  • In the Engine, the clearest case is the Auto style profile, which is the default. Its Style text is an instruction for the prompt writer: "Infer a consistent visual style from the character, game, scene, and selected image model." When no prompt writer handled the style, the shared prompt compiler pasted that sentence into the final image prompt. This affected generated character avatars, character sheets and Professor Mari image commands. Reproduced on staging with an avatar prompt and the Auto profile: masterpiece, best quality, very aesthetic, Infer a consistent visual style from the character, game, scene, and selected image model, silver hair.
  • The shared helper resolveImageStyleGuidanceText (#4028) already treats Auto as "no explicit style", and an existing regression already expects that sentence to stay out of provider prompts when a writer handles the style. The compiler now keeps the built-in Auto sentence out of the final prompt too. It still applies Style text a user wrote into Auto or a clone of it, as staging does, because those clones keep the auto base style and the user cannot see or change it.

What changed

  • packages/shared/src/utils/image-prompt-compiler.ts: the compiler never adds the built-in Auto instruction sentence to the final prompt. Style text from every other profile, and Style text a user writes into Auto or a clone of it (Clone keeps the auto base style), is still added when no prompt writer handled the style. That behaviour is unchanged.
  • scripts/regressions/prompt.regression.ts: new case "Auto style guidance never reaches the final image prompt as text (#7318)". It covers avatar, illustration, background and selfie compiles plus a Game background prompt, and checks that the Anime profile and an Auto clone with its own Style text still apply their Style text. It fails on staging and passes with the fix.
  • CHANGELOG.md: one [Unreleased] entry.

How each image-prompt field is treated (audit for #7318)

These go to the prompt-writing model only and already stayed out of the Engine's Illustrator, Roleplay and selfie image prompts:

  • the image connection's Image Prompting Instructions
  • a profile's Style text, when the Illustrator or a selfie writer is used
  • the Illustrator prompt templates
  • a card's conversation image instructions, for selfies

These are labelled and documented as text added to the prompt, so they stay literal:

  • the connection's Prompt Prefix
  • a profile's Positive tags and per-image tags
  • the Illustrator's Positive prompt / tags
  • the selfie's positive tags
  • Image Appearance Override
  • Attach Card Appearance

Not changed here

  • Noodle (package-owned, Pasta-Devs/Marinara-Agents). Noodle builds its own image prompt with a frozen copy of the shared compiler, so this fix does not reach it. Its default noodle.imagePost template pastes the poster's card Personality and image habits into the image prompt. When the rewrite step is off or fails, it also appends User image instructions: <connection Image Prompting Instructions>. Both need a package fix.
  • Documented behaviour that needs a maintainer decision:
    • Game's Scene image instructions are given to the scene and storyboard writers and are also always added as User image instructions: …. docs/game/storyboard.md says "Required image instructions still apply."
    • Attach Card Appearance adds raw card Appearance text for providers other than NovelAI.
    • The Maps Location handling: … sentence is added for ComfyUI, Automatic1111 and NovelAI too, which is documented in docs/agents/hierarchical-maps.md.

Validation

  • pnpm check passes locally
  • Container (Docker / Podman) built and ran without issue
  • Ran the app, clicked through the changes manually
  • Checked edge cases (light + dark mode, mobile viewport, empty states, error paths)
  • Above manual verification completed (describe below)
  • Read and followed CONTRIBUTING.md

Manual verification notes

  • Manually verify in Settings → Generations → Image Generation → Style Profiles → Test bench that, with Auto selected and Image kind avatar or illustration, the Final positive prompt no longer contains "Infer a consistent visual style".
  • Manually verify that the same Test bench with Anime still shows that profile's Style text in the Final positive prompt.
  • Manually verify that cloning Auto and typing your own Style text (for example "watercolor") still shows that text in the Test bench Final positive prompt.
  • Manually verify a character avatar generated through a ComfyUI connection with the default Auto profile: the prompt review dialog, or the ComfyUI queue, shows no "Infer a consistent visual style" text.

Agent-run checks: pnpm check (through the shared slot limiter). Targeted regressions: prompt.regression.ts, avatar-lead-prompt, sprite-background, illustrator-character-prompts, illustrator-reference-scope and lorebook-image-prompt, all passing. The new #7318 case was also run against the original compiler: it fails there, and it is the only failure.

Docs and release impact

  • No docs changes needed
  • Updated docs (README / CONTRIBUTING / android/README / CHANGELOG) as needed
  • Translated docs on the docs-i18n branch updated to match, or a [docs-i18n] follow-up issue opened (see CONTRIBUTING.md § Translated documentation)
  • Version/release files updated (only if this PR includes a version bump)

No docs/ page describes the Auto sentence being added to prompts, so no docs or translation follow-up is needed. CHANGELOG is updated.

UI evidence (if applicable)

Not a UI change. The Style Profiles Test bench output changes as described above.

Summary by CodeRabbit

  • Bug Fixes
    • Prompts that weren’t written by an AI model no longer include the Auto style profile’s prompt-writing guidance in final image prompts.
    • Other style profiles’ Style text remains included when applicable.

🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/Pasta-Devs/Marinara-Engine/pull/7342 **Author:** [@SpicyMarinara](https://github.com/SpicyMarinara) **Created:** 10/9/2026 **Status:** ✅ Merged **Merged:** 10/9/2026 **Merged by:** [@SpicyMarinara](https://github.com/SpicyMarinara) **Base:** `staging` ← **Head:** `fix/7318-image-prompt-instructions` --- ### 📝 Commits (4) - [`f63500e`](https://github.com/Pasta-Devs/Marinara-Engine/commit/f63500ed6f615fe025033635fcfb25c0641b297b) fix(images): keep the Auto style instruction out of final image prompts - [`72df329`](https://github.com/Pasta-Devs/Marinara-Engine/commit/72df329fa423753ea76c86e82c2ff8583fea1840) Merge origin/staging into fix/7318-image-prompt-instructions - [`325c6dd`](https://github.com/Pasta-Devs/Marinara-Engine/commit/325c6dd9a8e86591d1a79697464fedc5d9e4e5fb) fix(images): keep user-written Auto Style text in image prompts - [`2527497`](https://github.com/Pasta-Devs/Marinara-Engine/commit/2527497bc2147311743226fac60ea45277c0a223) Merge origin/staging into fix/7318-image-prompt-instructions ### 📊 Changes **3 files changed** (+62 additions, -7 deletions) <details> <summary>View changed files</summary> 📝 `CHANGELOG.md` (+1 -0) 📝 `packages/shared/src/utils/image-prompt-compiler.ts` (+13 -7) 📝 `scripts/regressions/prompt.regression.ts` (+48 -0) </details> ### 📄 Description > [!IMPORTANT] > Contributions target `staging`. Only `SpicyMarinara` may promote this repository's `staging` branch or a same-repository `hotfix/*` branch to `main`. > Outside and first-time contributors also require an approving review from `SpicyMarinara`. <!-- See CONTRIBUTING.md § Branches. --> ## Linked issue Closes #7318 ## Why this change - The reporter (ComfyUI, Danbooru-style tags, Illustrator 1.0.4, Noodle 1.5.1) found text written for the AI prompt writer ending up word for word in the prompt sent to ComfyUI, after the quality tags and the model's output. - In the Engine, the clearest case is the **Auto** style profile, which is the default. Its Style text is an instruction for the prompt writer: "Infer a consistent visual style from the character, game, scene, and selected image model." When no prompt writer handled the style, the shared prompt compiler pasted that sentence into the final image prompt. This affected generated character avatars, character sheets and Professor Mari image commands. Reproduced on staging with an avatar prompt and the Auto profile: `masterpiece, best quality, very aesthetic, Infer a consistent visual style from the character, game, scene, and selected image model, silver hair`. - The shared helper `resolveImageStyleGuidanceText` (#4028) already treats Auto as "no explicit style", and an existing regression already expects that sentence to stay out of provider prompts when a writer handles the style. The compiler now keeps the built-in Auto sentence out of the final prompt too. It still applies Style text a user wrote into Auto or a clone of it, as staging does, because those clones keep the auto base style and the user cannot see or change it. ## What changed - `packages/shared/src/utils/image-prompt-compiler.ts`: the compiler never adds the built-in Auto instruction sentence to the final prompt. Style text from every other profile, and Style text a user writes into Auto or a clone of it (Clone keeps the auto base style), is still added when no prompt writer handled the style. That behaviour is unchanged. - `scripts/regressions/prompt.regression.ts`: new case "Auto style guidance never reaches the final image prompt as text (#7318)". It covers avatar, illustration, background and selfie compiles plus a Game background prompt, and checks that the Anime profile and an Auto clone with its own Style text still apply their Style text. It fails on staging and passes with the fix. - `CHANGELOG.md`: one `[Unreleased]` entry. ### How each image-prompt field is treated (audit for #7318) These go to the prompt-writing model only and already stayed out of the Engine's Illustrator, Roleplay and selfie image prompts: - the image connection's **Image Prompting Instructions** - a profile's **Style text**, when the Illustrator or a selfie writer is used - the Illustrator prompt templates - a card's conversation image instructions, for selfies These are labelled and documented as text added to the prompt, so they stay literal: - the connection's **Prompt Prefix** - a profile's **Positive tags** and per-image tags - the Illustrator's **Positive prompt / tags** - the selfie's positive tags - **Image Appearance Override** - **Attach Card Appearance** ### Not changed here - **Noodle (package-owned, Pasta-Devs/Marinara-Agents).** Noodle builds its own image prompt with a frozen copy of the shared compiler, so this fix does not reach it. Its default `noodle.imagePost` template pastes the poster's card **Personality** and image habits into the image prompt. When the rewrite step is off or fails, it also appends `User image instructions: <connection Image Prompting Instructions>`. Both need a package fix. - **Documented behaviour that needs a maintainer decision:** - Game's **Scene image instructions** are given to the scene and storyboard writers and are also always added as `User image instructions: …`. `docs/game/storyboard.md` says "Required image instructions still apply." - **Attach Card Appearance** adds raw card Appearance text for providers other than NovelAI. - The Maps `Location handling: …` sentence is added for ComfyUI, Automatic1111 and NovelAI too, which is documented in `docs/agents/hierarchical-maps.md`. ## Validation - [ ] `pnpm check` passes locally - [ ] Container (Docker / Podman) built and ran without issue - [ ] Ran the app, clicked through the changes manually - [ ] Checked edge cases (light + dark mode, mobile viewport, empty states, error paths) - [ ] Above manual verification completed (describe below) - [ ] Read and followed `CONTRIBUTING.md` ### Manual verification notes - Manually verify in **Settings → Generations → Image Generation → Style Profiles → Test bench** that, with **Auto** selected and Image kind **avatar** or **illustration**, the **Final positive prompt** no longer contains "Infer a consistent visual style". - Manually verify that the same Test bench with **Anime** still shows that profile's Style text in the **Final positive prompt**. - Manually verify that cloning **Auto** and typing your own **Style text** (for example "watercolor") still shows that text in the Test bench **Final positive prompt**. - Manually verify a character avatar generated through a ComfyUI connection with the default **Auto** profile: the prompt review dialog, or the ComfyUI queue, shows no "Infer a consistent visual style" text. Agent-run checks: `pnpm check` (through the shared slot limiter). Targeted regressions: `prompt.regression.ts`, `avatar-lead-prompt`, `sprite-background`, `illustrator-character-prompts`, `illustrator-reference-scope` and `lorebook-image-prompt`, all passing. The new #7318 case was also run against the original compiler: it fails there, and it is the only failure. ## Docs and release impact - [ ] No docs changes needed - [ ] Updated docs (README / CONTRIBUTING / android/README / CHANGELOG) as needed - [ ] Translated docs on the `docs-i18n` branch updated to match, or a `[docs-i18n]` follow-up issue opened (see CONTRIBUTING.md § Translated documentation) - [ ] Version/release files updated (only if this PR includes a version bump) No `docs/` page describes the Auto sentence being added to prompts, so no docs or translation follow-up is needed. CHANGELOG is updated. ## UI evidence (if applicable) Not a UI change. The Style Profiles Test bench output changes as described above. <!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit * **Bug Fixes** * Prompts that weren’t written by an AI model no longer include the **Auto** style profile’s prompt-writing guidance in final image prompts. * Other style profiles’ **Style text** remains included when applicable. <!-- end of auto-generated comment: release notes by coderabbit.ai --> --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
bsakaguchi 2026-10-24 04:06:34 +07:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
Pasta-Devs/Marinara-Engine#7689
No description provided.