[PR #4032] [MERGED] fix(selfie): feed Generation Style Text to the prompt model instead of the image prompt (#4028) #6210

Closed
opened 2026-10-23 04:08:11 +07:00 by bsakaguchi · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/Pasta-Devs/Marinara-Engine/pull/4032
Author: @SpicyMarinara
Created: 7/24/2026
Status: ✅ Merged
Merged: 7/24/2026
Merged by: @SpicyMarinara

Base: staging ← Head: fix/4028-selfie-style-guidance


📝 Commits (2)

  • ee87efe fix(selfie): feed Generation Style Text to the prompt model, not the prompt
  • a7cad11 fix(selfie): honor the connection's style profile in the fallback order

📊 Changes

5 files changed (+87 additions, -25 deletions)

View changed files

📝 CHANGELOG.md (+1 -0)
📝 packages/server/src/routes/gallery.routes.ts (+25 -12)
📝 packages/server/src/services/generation/conversation-selfie-command-runtime.ts (+24 -11)
📝 packages/server/src/services/image/image-prompt-compiler.ts (+6 -1)
📝 packages/shared/src/utils/image-prompt-compiler.ts (+31 -1)

📄 Description

Why

In Conversation Selfie mode, the image style profile's Generation Style Text was being pasted verbatim into the final image prompt submitted to the generator (#4028). Users saw their style guide duplicated in every selfie prompt — redundant, wordy, and diluting CLIP attention. The reporter confirmed this happens in Selfie mode but not Roleplay illustration.

Root cause: Roleplay illustration passes generatedStyle into compileImagePrompt, which suppresses the profile's raw styleText (the style is already reflected in the generated prompt). The two selfie paths omit generatedStyle, so the compiler falls through to appending profile.styleText verbatim.

The maintainer's design intent (from the Discord thread): the style should guide the prompt-building LLM, not be copied into the output — while still reaching image providers that lack a native style field.

What changed

  • packages/shared/.../image-prompt-compiler.ts: new omitProfileStyleText input flag that suppresses the verbatim profile.styleText append; two small exported helpers — resolveImageStyleGuidanceText() (the active profile's style text when a real base style is set) and formatImageStylePromptGuidance() (the guidance block appended to the prompt-builder's system prompt).
  • Both selfie paths — the [selfie] Conversation command (conversation-selfie-command-runtime.ts) and the gallery selfie route (gallery.routes.ts) — now inject the active style as guidance into the prompt-builder's system prompt and pass omitProfileStyleText: true. The style still shapes the image (and still reaches providers without a style field, via the generated prompt), just not pasted verbatim.

Roleplay illustration, backgrounds, portraits, avatars, sprites, and game assets are untouched.

Test plan

  • With a style profile that has a non-empty Generation Style Text and a real base style, trigger a [selfie] in a Conversation and confirm the submitted image prompt (gallery → prompt) no longer contains the style text verbatim, while the image still reflects the style.
  • Repeat via the Gallery "selfie" button (the /:chatId/selfie route), including preview-only.
  • With a style profile set to base style "auto" (or empty style text), confirm behavior is unchanged (no guidance injected, nothing suppressed).
  • Confirm Roleplay illustration prompts are unchanged.
  • pnpm check passes. (It passed in the authoring session; re-verify locally.)

Fixes #4028.

Summary by CodeRabbit

  • Bug Fixes
    • Improved Conversation Gallery Selfie mode prompt generation.
    • Image style guidance now influences prompt construction without being repeated verbatim in the final image prompt.
    • Reduced redundant style text, resulting in clearer and more consistent generated selfies.

🔄 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/4032 **Author:** [@SpicyMarinara](https://github.com/SpicyMarinara) **Created:** 7/24/2026 **Status:** ✅ Merged **Merged:** 7/24/2026 **Merged by:** [@SpicyMarinara](https://github.com/SpicyMarinara) **Base:** `staging` ← **Head:** `fix/4028-selfie-style-guidance` --- ### 📝 Commits (2) - [`ee87efe`](https://github.com/Pasta-Devs/Marinara-Engine/commit/ee87efeea25bee146f4ccb6f0adfb8f50f121363) fix(selfie): feed Generation Style Text to the prompt model, not the prompt - [`a7cad11`](https://github.com/Pasta-Devs/Marinara-Engine/commit/a7cad11ce2c609a136588d1bd05a2c3812af4063) fix(selfie): honor the connection's style profile in the fallback order ### 📊 Changes **5 files changed** (+87 additions, -25 deletions) <details> <summary>View changed files</summary> 📝 `CHANGELOG.md` (+1 -0) 📝 `packages/server/src/routes/gallery.routes.ts` (+25 -12) 📝 `packages/server/src/services/generation/conversation-selfie-command-runtime.ts` (+24 -11) 📝 `packages/server/src/services/image/image-prompt-compiler.ts` (+6 -1) 📝 `packages/shared/src/utils/image-prompt-compiler.ts` (+31 -1) </details> ### 📄 Description ## Why In Conversation **Selfie** mode, the image style profile's *Generation Style Text* was being pasted verbatim into the final image prompt submitted to the generator (#4028). Users saw their style guide duplicated in every selfie prompt — redundant, wordy, and diluting CLIP attention. The reporter confirmed this happens in Selfie mode but **not** Roleplay illustration. **Root cause:** Roleplay illustration passes `generatedStyle` into `compileImagePrompt`, which suppresses the profile's raw `styleText` (the style is already reflected in the generated prompt). The two selfie paths omit `generatedStyle`, so the compiler falls through to appending `profile.styleText` verbatim. The maintainer's design intent (from the Discord thread): the style should *guide the prompt-building LLM*, not be copied into the output — while still reaching image providers that lack a native style field. ## What changed - **`packages/shared/.../image-prompt-compiler.ts`**: new `omitProfileStyleText` input flag that suppresses the verbatim `profile.styleText` append; two small exported helpers — `resolveImageStyleGuidanceText()` (the active profile's style text when a real base style is set) and `formatImageStylePromptGuidance()` (the guidance block appended to the prompt-builder's system prompt). - **Both selfie paths** — the `[selfie]` Conversation command (`conversation-selfie-command-runtime.ts`) and the gallery selfie route (`gallery.routes.ts`) — now inject the active style as guidance into the prompt-builder's system prompt and pass `omitProfileStyleText: true`. The style still shapes the image (and still reaches providers without a style field, via the generated prompt), just not pasted verbatim. Roleplay illustration, backgrounds, portraits, avatars, sprites, and game assets are untouched. ## Test plan - [ ] With a style profile that has a non-empty Generation Style Text and a real base style, trigger a `[selfie]` in a Conversation and confirm the submitted image prompt (gallery → prompt) no longer contains the style text verbatim, while the image still reflects the style. - [ ] Repeat via the Gallery "selfie" button (the `/:chatId/selfie` route), including preview-only. - [ ] With a style profile set to base style "auto" (or empty style text), confirm behavior is unchanged (no guidance injected, nothing suppressed). - [ ] Confirm Roleplay illustration prompts are unchanged. - [ ] `pnpm check` passes. (It passed in the authoring session; re-verify locally.) Fixes #4028. <!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit * **Bug Fixes** * Improved Conversation Gallery Selfie mode prompt generation. * Image style guidance now influences prompt construction without being repeated verbatim in the final image prompt. * Reduced redundant style text, resulting in clearer and more consistent generated selfies. <!-- 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-23 04:08:11 +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#6210
No description provided.