[PR #7256] [MERGED] fix(images): keep the card appearance when an image override is set, and give /selfie the personality (#7258, #7259) #7651

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

📋 Pull Request Information

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

Base: staging ← Head: feat/image-appearance-followups


📝 Commits (8)

  • 79a097f fix(selfie): stop an appearance override from replacing the card appearance
  • 01037a6 fix(selfie): require override tags verbatim and keep the card as context (#7243)
  • 0167684 fix(gallery): resolve the override separately from the card appearance (#7243)
  • 1e41753 docs(selfie): describe how the override actually reaches the writer (#7243)
  • 13605ae fix(gallery): pass personality and image instructions to selfie prompts (#7259)
  • 8325337 fix(selfie): keep saved custom selfie templates working with an override (#7258)
  • f020ecc fix(selfie): tighten override wording after manual testing (#7258)
  • 56e7e33 fix(selfie): drop the override block from custom templates without an override (#7258)

📊 Changes

7 files changed (+122 additions, -28 deletions)

View changed files

📝 CHANGELOG.md (+2 -0)
📝 packages/client/src/localization/locales/en.json (+2 -2)
📝 packages/server/src/routes/gallery.routes.ts (+24 -10)
📝 packages/server/src/services/conversation/selfie-prompt.ts (+31 -9)
📝 packages/server/src/services/generation/conversation-selfie-command-runtime.ts (+9 -4)
📝 packages/server/src/services/prompt-overrides/load-prompt.ts (+5 -2)
📝 packages/server/src/services/prompt-overrides/registry/conversation.ts (+49 -1)

📄 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 #7258
Closes #7259

Also addresses #7243 (opened automatically from the Discord thread, but it only captured a follow-up message; #7258 is the full report). Follows up the Image Appearance Override feature, #7053 / PR #7059.

Why this change

  • #7258: In Conversation chats, an enabled Image Appearance Override replaced the card's Appearance in the selfie prompt writer's instructions. The writer then saw only the override. For a ComfyUI user whose override was a LoRA trigger, that was one meaningless token, so the writer dropped it and invented the character's look. Roleplay mode never had this problem: it keeps the override to the illustrator block on purpose (agent-executor.ts:3190-3193). The help text didn't mention what the override cost.
  • #7259: /selfie and the gallery selfie button share one route (/selfie is a client-local command). That route never passed Personality or the conversation image instructions, so these selfies came out thinner than the ones a character sends on its own.

What changed

The fix stops one variable from meaning two things. ${appearance} is the card's Appearance again, and the override goes beside it as ${imageAppearance}. That block disappears when it's empty, the same way ${personality} and ${characterImageInstructions} do.

  1. fix(selfie): stop an appearance override from replacing the card appearance: resolve the override separately. No rendering change on its own.
  2. fix(selfie): require override tags verbatim and keep the card as context: when there is an override, it renders as its own block. The block says the tags must appear exactly as written, names the unrecognized-tag (LoRA) case, and makes the card Appearance background only: it fills in details the override doesn't cover and never contradicts or repeats it. The appearance line only appears when the card has text. ${imageAppearance} is registered for custom templates, and its example value is non-empty on purpose. The editor rebuilds Reset to Default by swapping example values back into tokens, so an empty example would leave the block out of the editor completely.
  3. fix(gallery): resolve the override separately from the card appearance: the same split for the gallery route, which /selfie also uses.
  4. docs(selfie): describe how the override actually reaches the writer: corrected help text and a CHANGELOG entry.
  5. fix(gallery): pass personality and image instructions to selfie prompts (#7259): the two missing fields, read the same way the character-sent selfie path reads them.
  6. fix(selfie): keep saved custom selfie templates working with an override: found by local CodeRabbit. Custom templates (global override or per-chat selfie prompt) saved before this change only use ${appearance}, which used to carry the override. Unless a template mentions ${imageAppearance}, ${appearance} keeps its old meaning there, so those users don't silently lose their LoRA trigger.
  7. fix(selfie): tighten override wording after manual testing: the background-information line no longer refers to an appearance "above" when the card has none; both override help texts trimmed.

Cards without an override are unaffected. The built default prompt is byte-identical to before.

Deliberately not changed: the Attach Card Appearance append to the outgoing prompt stays. The instruction is meant to keep the token when the writer rewrites the prompt, and the append is the only channel that guarantees it reaches the image prompt verbatim.

Ruled out by running the real code: the prompt compiler (kind: "selfie", all profiles) and the ComfyUI transport both keep the trigger byte-for-byte.

Found while testing, tracked separately (not in this PR): the gallery//selfie route claims "based on the current conversation context" but sends none; /selfie saves only to the gallery, not the chat; the first tag of the appended Name's Appearance: block isn't de-duplicated (e.g. Jessica's Appearance: 1girl); the 1400-character clip on appended appearance; no ComfyUI-specific prompt guidance.

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

Agent-run (not a substitute for the boxes above): pnpm check, pnpm localization:check and pnpm regression:prompt pass after rebasing onto current staging. Ad-hoc probes (not committed, per the no-.test.ts rule) cover:

  • the default prompt is byte-identical with no override
  • the override block renders, including when the card has no Appearance
  • the editor's Reset to Default round-trip
  • legacy vs. new custom templates (per-chat, global, disabled)

Local CodeRabbit (3 runs against current origin/staging): two findings fixed (instruction wording in commit 2, legacy custom templates in commit 6). One minor finding rejected: it asked the character-command path to also fall back to a top-level data.appearance. That fallback chain predates this PR (untouched in the diff), and character Appearance lives in extensions.appearance (character.ts:42). There is no top-level field to read, so the change would affect no real card.

Manual verification notes

  • Manually verify a character-sent selfie with an override set to a LoRA trigger: the trigger appears in the outgoing prompt, and build and clothing still match the card.
  • Manually verify /selfie and the gallery selfie button do the same, and their prompt-writer input now includes Character personality and traits.
  • Manually verify a card without an override produces the same writer prompt as before.
  • Manually verify a card with an override but an empty Appearance still keeps the trigger.
  • Manually verify Settings → Prompt Overrides → Conversation Selfie shows the override block in the template, lists ${imageAppearance}, and Reset to Default restores it.
  • Manually verify a custom selfie template using only ${appearance} still receives the override (legacy behavior).
  • Manually verify the Image Appearance Override help text on the character card.
  • Manually verify Roleplay-mode illustrations are unchanged.

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)

CHANGELOG [Unreleased] has two entries (#7258, #7259). No docs/ files changed, so no docs-i18n follow-up.

UI evidence (if applicable)

Help-text change only. A screenshot of the character card's override section can be added after manual testing.

Summary by CodeRabbit

  • New Features
    • Image Appearance Override tags are now preserved as written in prompts for /selfie, character-sent selfies, and Conversation gallery selfies. The card’s Appearance remains background context, and cards without an override are unaffected.
    • Conversation selfie prompts now include the character’s Personality and conversation image instructions.
  • Documentation
    • Updated Image Appearance Override guidance to explain how tags are used and recommend omitting variable clothing.

🔄 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/7256 **Author:** [@ylli-selmani](https://github.com/ylli-selmani) **Created:** 10/7/2026 **Status:** ✅ Merged **Merged:** 10/7/2026 **Merged by:** [@SpicyMarinara](https://github.com/SpicyMarinara) **Base:** `staging` ← **Head:** `feat/image-appearance-followups` --- ### 📝 Commits (8) - [`79a097f`](https://github.com/Pasta-Devs/Marinara-Engine/commit/79a097fac01ae9863ec5433ca038c1bb55563f85) fix(selfie): stop an appearance override from replacing the card appearance - [`01037a6`](https://github.com/Pasta-Devs/Marinara-Engine/commit/01037a68baa85be0c70b07e10cd93bc9e358d316) fix(selfie): require override tags verbatim and keep the card as context (#7243) - [`0167684`](https://github.com/Pasta-Devs/Marinara-Engine/commit/01676845e54477c2f2c5e1bb029d1bfee45e43b0) fix(gallery): resolve the override separately from the card appearance (#7243) - [`1e41753`](https://github.com/Pasta-Devs/Marinara-Engine/commit/1e417531f426aa93b91ffcaee3e0b4a750971ff7) docs(selfie): describe how the override actually reaches the writer (#7243) - [`13605ae`](https://github.com/Pasta-Devs/Marinara-Engine/commit/13605ae14c0f6667b15545690fade1ee3aa3e65f) fix(gallery): pass personality and image instructions to selfie prompts (#7259) - [`8325337`](https://github.com/Pasta-Devs/Marinara-Engine/commit/8325337b1e4b26eeb8eea94b2c834ba01d6bf98d) fix(selfie): keep saved custom selfie templates working with an override (#7258) - [`f020ecc`](https://github.com/Pasta-Devs/Marinara-Engine/commit/f020ecc8ce77139fd28b884772c622157bcdb254) fix(selfie): tighten override wording after manual testing (#7258) - [`56e7e33`](https://github.com/Pasta-Devs/Marinara-Engine/commit/56e7e33ece9d5319bd7721c61e3314ec349a686c) fix(selfie): drop the override block from custom templates without an override (#7258) ### 📊 Changes **7 files changed** (+122 additions, -28 deletions) <details> <summary>View changed files</summary> 📝 `CHANGELOG.md` (+2 -0) 📝 `packages/client/src/localization/locales/en.json` (+2 -2) 📝 `packages/server/src/routes/gallery.routes.ts` (+24 -10) 📝 `packages/server/src/services/conversation/selfie-prompt.ts` (+31 -9) 📝 `packages/server/src/services/generation/conversation-selfie-command-runtime.ts` (+9 -4) 📝 `packages/server/src/services/prompt-overrides/load-prompt.ts` (+5 -2) 📝 `packages/server/src/services/prompt-overrides/registry/conversation.ts` (+49 -1) </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 #7258 Closes #7259 Also addresses #7243 (opened automatically from the Discord thread, but it only captured a follow-up message; #7258 is the full report). Follows up the Image Appearance Override feature, #7053 / PR #7059. ## Why this change - **#7258:** In Conversation chats, an enabled **Image Appearance Override** *replaced* the card's Appearance in the selfie prompt writer's instructions. The writer then saw only the override. For a ComfyUI user whose override was a LoRA trigger, that was one meaningless token, so the writer dropped it and invented the character's look. Roleplay mode never had this problem: it keeps the override to the illustrator block on purpose (`agent-executor.ts:3190-3193`). The help text didn't mention what the override cost. - **#7259:** `/selfie` and the gallery selfie button share one route (`/selfie` is a client-local command). That route never passed **Personality** or the conversation image instructions, so these selfies came out thinner than the ones a character sends on its own. ## What changed The fix stops one variable from meaning two things. `${appearance}` is the card's Appearance again, and the override goes beside it as `${imageAppearance}`. That block disappears when it's empty, the same way `${personality}` and `${characterImageInstructions}` do. 1. **`fix(selfie): stop an appearance override from replacing the card appearance`**: resolve the override separately. No rendering change on its own. 2. **`fix(selfie): require override tags verbatim and keep the card as context`**: when there is an override, it renders as its own block. The block says the tags **must** appear exactly as written, names the unrecognized-tag (LoRA) case, and makes the card Appearance background only: it fills in details the override doesn't cover and never contradicts or repeats it. The appearance line only appears when the card has text. `${imageAppearance}` is registered for custom templates, and its example value is non-empty on purpose. The editor rebuilds **Reset to Default** by swapping example values back into tokens, so an empty example would leave the block out of the editor completely. 3. **`fix(gallery): resolve the override separately from the card appearance`**: the same split for the gallery route, which `/selfie` also uses. 4. **`docs(selfie): describe how the override actually reaches the writer`**: corrected help text and a CHANGELOG entry. 5. **`fix(gallery): pass personality and image instructions to selfie prompts`** (#7259): the two missing fields, read the same way the character-sent selfie path reads them. 6. **`fix(selfie): keep saved custom selfie templates working with an override`**: found by local CodeRabbit. Custom templates (global override or per-chat selfie prompt) saved before this change only use `${appearance}`, which used to carry the override. Unless a template mentions `${imageAppearance}`, `${appearance}` keeps its old meaning there, so those users don't silently lose their LoRA trigger. 7. **`fix(selfie): tighten override wording after manual testing`**: the background-information line no longer refers to an appearance "above" when the card has none; both override help texts trimmed. Cards **without** an override are unaffected. The built default prompt is byte-identical to before. Deliberately **not** changed: the **Attach Card Appearance** append to the outgoing prompt stays. The instruction is meant to keep the token when the writer rewrites the prompt, and the append is the only channel that guarantees it reaches the image prompt verbatim. **Ruled out** by running the real code: the prompt compiler (`kind: "selfie"`, all profiles) and the ComfyUI transport both keep the trigger byte-for-byte. **Found while testing, tracked separately (not in this PR):** the gallery/`/selfie` route claims "based on the current conversation context" but sends none; `/selfie` saves only to the gallery, not the chat; the first tag of the appended `Name's Appearance:` block isn't de-duplicated (e.g. `Jessica's Appearance: 1girl`); the 1400-character clip on appended appearance; no ComfyUI-specific prompt guidance. ## Validation - [x] `pnpm check` passes locally - [ ] Container (Docker / Podman) built and ran without issue - [x] Ran the app, clicked through the changes manually - [ ] Checked edge cases (light + dark mode, mobile viewport, empty states, error paths) - [x] Above manual verification completed (describe below) - [x] Read and followed `CONTRIBUTING.md` Agent-run (not a substitute for the boxes above): `pnpm check`, `pnpm localization:check` and `pnpm regression:prompt` pass after rebasing onto current `staging`. Ad-hoc probes (not committed, per the no-`.test.ts` rule) cover: - the default prompt is byte-identical with no override - the override block renders, including when the card has no Appearance - the editor's Reset to Default round-trip - legacy vs. new custom templates (per-chat, global, disabled) Local CodeRabbit (3 runs against current `origin/staging`): two findings fixed (instruction wording in commit 2, legacy custom templates in commit 6). One minor finding rejected: it asked the character-command path to also fall back to a top-level `data.appearance`. That fallback chain predates this PR (untouched in the diff), and character Appearance lives in `extensions.appearance` (`character.ts:42`). There is no top-level field to read, so the change would affect no real card. ### Manual verification notes - [x] Manually verify a character-sent selfie with an override set to a LoRA trigger: the trigger appears in the outgoing prompt, and build and clothing still match the card. - [x] Manually verify `/selfie` and the gallery selfie button do the same, and their prompt-writer input now includes **Character personality and traits**. - [x] Manually verify a card **without** an override produces the same writer prompt as before. - [x] Manually verify a card with an override but an **empty** Appearance still keeps the trigger. - [x] Manually verify **Settings → Prompt Overrides → Conversation Selfie** shows the override block in the template, lists `${imageAppearance}`, and **Reset to Default** restores it. - [x] Manually verify a custom selfie template using only `${appearance}` still receives the override (legacy behavior). - [x] Manually verify the **Image Appearance Override** help text on the character card. - [x] Manually verify Roleplay-mode illustrations are unchanged. ## Docs and release impact - [ ] No docs changes needed - [x] 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) CHANGELOG `[Unreleased]` has two entries (#7258, #7259). No `docs/` files changed, so no `docs-i18n` follow-up. ## UI evidence (if applicable) Help-text change only. A screenshot of the character card's override section can be added after manual testing. <!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit * **New Features** * Image Appearance Override tags are now preserved as written in prompts for `/selfie`, character-sent selfies, and Conversation gallery selfies. The card’s Appearance remains background context, and cards without an override are unaffected. * Conversation selfie prompts now include the character’s Personality and conversation image instructions. * **Documentation** * Updated Image Appearance Override guidance to explain how tags are used and recommend omitting variable clothing. <!-- 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: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#7651
No description provided.