[PR #7682] [MERGED] fix(avatars): talking head blink/talk pictures keep the bust, six feeling faces, visible Try again #7879

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

📋 Pull Request Information

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

Base: staging ← Head: fix/talking-head-variants


📝 Commits (6)

  • 9a6c4a0 fix(avatars): send blink/talk edits as written with the bust on white
  • 7f9b6fb fix(avatars): six feeling faces, per-face blink/talk pictures, visible Try again
  • ae26f58 fix(avatars): keep soft pixels, provided blinks and imports intact
  • c26d8e3 fix(avatars): toast when a single blink/talk picture or redo fails
  • 250b3da fix(avatars): a saved face keeps talk/blink sprites added since when saving
  • 6889317 fix(avatars): Keep all waits while a blink/talk picture is being made

📊 Changes

18 files changed (+757 additions, -272 deletions)

View changed files

📝 docs/agents/avatars.md (+5 -5)
📝 e2e/avatar-generation.e2e.ts (+39 -7)
📝 e2e/avatar-setup.e2e.ts (+21 -10)
📝 packages/client/src/components/ui/SpriteGenerationModal.tsx (+46 -12)
📝 packages/client/src/features/avatars/generation/AvatarGenerationPanel.tsx (+6 -3)
📝 packages/client/src/features/avatars/generation/PngtuberVariantsSection.tsx (+262 -160)
📝 packages/client/src/features/avatars/generation/use-avatar-generation.ts (+41 -22)
📝 packages/client/src/features/avatars/renderers/pngtuber/pngtuber-layers.ts (+44 -0)
📝 packages/client/src/localization/locales/en.json (+5 -3)
📝 packages/server/src/services/avatars/generation/generation-context.ts (+21 -24)
📝 packages/server/src/services/avatars/generation/pngtuber-variants.ts (+28 -18)
📝 packages/server/src/services/image/image-generation.ts (+4 -1)
📝 packages/shared/src/types/avatars.ts (+6 -0)
📝 packages/shared/src/types/generation-integration.ts (+3 -0)
📝 scripts/regressions/avatar-2d-renderers.regression.ts (+66 -0)
📝 scripts/regressions/avatar-contract.regression.ts (+10 -0)
📝 scripts/regressions/avatar-generation.regression.ts (+139 -6)
📝 scripts/regressions/codex-chatgpt-image.regression.ts (+11 -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 #7681

Why this change

Testing the 2D Avatars talking head on staging with the newest GPT Image model turned up these problems:

  • The blink and talk pictures came back broken. Sometimes the model returned a full-body sprite instead of the same bust with one change, and some mouth-open pictures showed a patch of dark pixels.
  • Make faces from avatar offered the generic expression list, not the six feelings the talking head uses.
  • Try again looked like it did nothing.
  • The Blink and talk pictures section listed every sprite and none of the blink/talk pictures you already have.

Root cause of the broken pictures: the Engine ran the 2D Avatars edit template through the sprite prompt compiler. That cut the template down to tags. The mouth-open prompt became roughly eyes, hair, red eyes, brown hair, which shows the "angry" expression, tall: "open the mouth" and "do not crop / redraw" were gone, and most style profiles added "full body". The model also saw the cut-out sprite on black, because see-through pixels read as black, so dark clothes and hair merged into the background. GPT Image therefore redrew the character. Cutting that redraw into the bust's outline is what left the solid dark patches. A saved angry-mouth-open.png was checked: its "dark pixels" are opaque black, not holes.

Try again did run. The card kept showing the old picture with no spinner. Progress showed only at the top of the section, counted among every card, so a single redo read "7 of 12".

What changed

  • Blink/talk prompts are sent as written. That means the agent's template, or the prompt reviewed in the dialog, with no style profile and no tag compiler. The sprite is still the only reference.
  • A cut-out goes to the model on plain white. Only its mostly see-through pixels turn white; the rest keep their own colour, so soft pixels inside a face don't come back lighter. Its own outline is restored afterwards, as before.
  • ChatGPT image route: on an in-place edit it no longer says "do not inherit the reference's canvas, compose for this ratio".
  • Face binding: a face named after a feeling (relaxed) is that feeling's face, even when a love sprite also exists.
  • Make faces from avatar offers exactly neutral, happy, angry, sad, relaxed and surprised (new optional expressionChoices prop). The character and persona editors are unchanged.
  • Blink and talk pictures lists only the talking head's faces, one per feeling, merged when feelings share a face. Each face shows its Blink and Talk pictures, whether saved, provided as _blink/_talk sprites, or new drafts. You can make the missing ones or redo any of them.
    • A sprite face added after the setup was saved keeps its own _blink/_talk sprite when you save a new picture for it.
    • A PNGTuber Plus import keeps its own faces; sprite faces aren't listed for it or saved into it.
    • Keep all and Save kept count only pictures of the faces listed.
  • Try again dims the picture and shows a spinner while it redoes it. Progress counts only that run, a failed redo shows a toast, a failed slot's error shows in full under it, and Keep is unavailable mid-redo.
  • Regressions:
    • The prompt reaches the provider verbatim, with no "full body".
    • The reference is white behind a cut-out, and soft inside pixels keep their colour.
    • ChatGPT gets no recompose hint on an in-place edit, and avatar edits set the flag.
    • A named feeling face wins.
    • A later face's blink sprite survives a save.
    • The talking-head face list, including imports.
    • The e2e redo / keep / save flow.
  • Docs: docs/agents/avatars.md describes the new section. The translated copies are tracked in #7638 (comment added).

The package side is Pasta-Devs/Marinara-Agents#1406 (2D Avatars 0.1.2). It removes the "Appearance notes: ${appearance}" line from the two variant templates, so the model gets only the bust and the one change. An install that saved its own copy of those prompts keeps that copy until it is reset.

Review: local CodeRabbit raised 1 finding, the docs-i18n link, now resolved. A 4-lens adversarial review raised 7 findings. Its verifiers confirmed 5, all fixed in ae26f58f5. They rejected 2: the docs-i18n issue was already tracked in #7638, and the referenceIsCanvas wiring was not a defect (a source check was added anyway).

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 on the 2D Avatars page with a GPT Image connection: make a mouth-open and an eyes-closed picture for a cut-out bust. Each should keep the same bust and framing, with only the mouth or eyes changed.
  • Manually verify that Make faces from avatar offers exactly neutral, happy, angry, sad, relaxed and surprised, and that the new faces land on the right feelings.
  • Manually verify that Blink and talk pictures shows only the talking head's faces, with saved and _blink/_talk pictures, at phone width too.
  • Manually verify that Try again shows a spinner over the picture and then replaces it.
  • Manually verify the local validation listed below on your machine (pnpm check).

Agent-run validation, for reference:

  • client, server and e2e tsc
  • client lint, check-locales, localization:check, impeccable:check
  • regressions: avatar-generation, avatar-contract, avatar-2d-renderers, codex-chatgpt-image
  • Playwright avatar-generation + avatar-setup on desktop-chromium and mobile-chromium (12/12)

Docs and release impact

  • No docs changes needed
  • Updated docs (README / CONTRIBUTING / android/README) 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)

UI evidence (if applicable)

The e2e run writes pngtuber-picture.png, pngtuber-redo.png and avatar-faces-generator.png to its test output folder. No screenshots are attached here.

Summary by CodeRabbit

  • New Features
    • Generate avatar faces for six available feelings, with expression choices tailored to the selected layout.
    • Create and manage eyes-closed and mouth-open pictures for each face, individually or in batches. View progress, retry failed attempts, and keep completed pictures.
    • Use generated sprite faces in avatar emotion and talking-head views.
  • Bug Fixes
    • Image edits better preserve reference framing, and transparent sprites appear against a white background.
    • Exact sprite emotion labels take priority when matching faces.
    • Saving new pictures preserves existing faces and sprite variants.

🔄 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/7682 **Author:** [@SpicyMarinara](https://github.com/SpicyMarinara) **Created:** 10/15/2026 **Status:** ✅ Merged **Merged:** 10/15/2026 **Merged by:** [@SpicyMarinara](https://github.com/SpicyMarinara) **Base:** `staging` ← **Head:** `fix/talking-head-variants` --- ### 📝 Commits (6) - [`9a6c4a0`](https://github.com/Pasta-Devs/Marinara-Engine/commit/9a6c4a0a321158754d4dde61dcc6ace139859ae0) fix(avatars): send blink/talk edits as written with the bust on white - [`7f9b6fb`](https://github.com/Pasta-Devs/Marinara-Engine/commit/7f9b6fb08a8779075c1efb65c203543c6c14c8ff) fix(avatars): six feeling faces, per-face blink/talk pictures, visible Try again - [`ae26f58`](https://github.com/Pasta-Devs/Marinara-Engine/commit/ae26f58f5e0e73c544f2f187d15b3f582971ffe5) fix(avatars): keep soft pixels, provided blinks and imports intact - [`c26d8e3`](https://github.com/Pasta-Devs/Marinara-Engine/commit/c26d8e33c3f3f048915cf93de4b744d7ed16501e) fix(avatars): toast when a single blink/talk picture or redo fails - [`250b3da`](https://github.com/Pasta-Devs/Marinara-Engine/commit/250b3da864ea29e040743b04e1c6b262867380a2) fix(avatars): a saved face keeps talk/blink sprites added since when saving - [`6889317`](https://github.com/Pasta-Devs/Marinara-Engine/commit/688931724067bd41037ec10427dc586e80620ff4) fix(avatars): Keep all waits while a blink/talk picture is being made ### 📊 Changes **18 files changed** (+757 additions, -272 deletions) <details> <summary>View changed files</summary> 📝 `docs/agents/avatars.md` (+5 -5) 📝 `e2e/avatar-generation.e2e.ts` (+39 -7) 📝 `e2e/avatar-setup.e2e.ts` (+21 -10) 📝 `packages/client/src/components/ui/SpriteGenerationModal.tsx` (+46 -12) 📝 `packages/client/src/features/avatars/generation/AvatarGenerationPanel.tsx` (+6 -3) 📝 `packages/client/src/features/avatars/generation/PngtuberVariantsSection.tsx` (+262 -160) 📝 `packages/client/src/features/avatars/generation/use-avatar-generation.ts` (+41 -22) 📝 `packages/client/src/features/avatars/renderers/pngtuber/pngtuber-layers.ts` (+44 -0) 📝 `packages/client/src/localization/locales/en.json` (+5 -3) 📝 `packages/server/src/services/avatars/generation/generation-context.ts` (+21 -24) 📝 `packages/server/src/services/avatars/generation/pngtuber-variants.ts` (+28 -18) 📝 `packages/server/src/services/image/image-generation.ts` (+4 -1) 📝 `packages/shared/src/types/avatars.ts` (+6 -0) 📝 `packages/shared/src/types/generation-integration.ts` (+3 -0) 📝 `scripts/regressions/avatar-2d-renderers.regression.ts` (+66 -0) 📝 `scripts/regressions/avatar-contract.regression.ts` (+10 -0) 📝 `scripts/regressions/avatar-generation.regression.ts` (+139 -6) 📝 `scripts/regressions/codex-chatgpt-image.regression.ts` (+11 -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`. ## Linked issue Closes #7681 ## Why this change Testing the 2D Avatars talking head on staging with the newest GPT Image model turned up these problems: - The blink and talk pictures came back broken. Sometimes the model returned a full-body sprite instead of the same bust with one change, and some mouth-open pictures showed a patch of dark pixels. - **Make faces from avatar** offered the generic expression list, not the six feelings the talking head uses. - **Try again** looked like it did nothing. - The **Blink and talk pictures** section listed every sprite and none of the blink/talk pictures you already have. **Root cause of the broken pictures:** the Engine ran the 2D Avatars edit template through the *sprite* prompt compiler. That cut the template down to tags. The mouth-open prompt became roughly `eyes, hair, red eyes, brown hair, which shows the "angry" expression, tall`: "open the mouth" and "do not crop / redraw" were gone, and most style profiles added "full body". The model also saw the cut-out sprite on black, because see-through pixels read as black, so dark clothes and hair merged into the background. GPT Image therefore redrew the character. Cutting that redraw into the bust's outline is what left the solid dark patches. A saved `angry-mouth-open.png` was checked: its "dark pixels" are opaque black, not holes. **Try again** did run. The card kept showing the old picture with no spinner. Progress showed only at the top of the section, counted among every card, so a single redo read "7 of 12". ## What changed - **Blink/talk prompts are sent as written.** That means the agent's template, or the prompt reviewed in the dialog, with no style profile and no tag compiler. The sprite is still the only reference. - **A cut-out goes to the model on plain white.** Only its mostly see-through pixels turn white; the rest keep their own colour, so soft pixels inside a face don't come back lighter. Its own outline is restored afterwards, as before. - **ChatGPT image route:** on an in-place edit it no longer says "do not inherit the reference's canvas, compose for this ratio". - **Face binding:** a face named after a feeling (`relaxed`) is that feeling's face, even when a `love` sprite also exists. - **Make faces from avatar** offers exactly neutral, happy, angry, sad, relaxed and surprised (new optional `expressionChoices` prop). The character and persona editors are unchanged. - **Blink and talk pictures** lists only the talking head's faces, one per feeling, merged when feelings share a face. Each face shows its Blink and Talk pictures, whether saved, provided as `_blink`/`_talk` sprites, or new drafts. You can make the missing ones or redo any of them. - A sprite face added after the setup was saved keeps its own `_blink`/`_talk` sprite when you save a new picture for it. - A PNGTuber Plus import keeps its own faces; sprite faces aren't listed for it or saved into it. - Keep all and Save kept count only pictures of the faces listed. - **Try again** dims the picture and shows a spinner while it redoes it. Progress counts only that run, a failed redo shows a toast, a failed slot's error shows in full under it, and Keep is unavailable mid-redo. - **Regressions:** - The prompt reaches the provider verbatim, with no "full body". - The reference is white behind a cut-out, and soft inside pixels keep their colour. - ChatGPT gets no recompose hint on an in-place edit, and avatar edits set the flag. - A named feeling face wins. - A later face's blink sprite survives a save. - The talking-head face list, including imports. - The e2e redo / keep / save flow. - **Docs:** `docs/agents/avatars.md` describes the new section. The translated copies are tracked in #7638 (comment added). The package side is Pasta-Devs/Marinara-Agents#1406 (2D Avatars 0.1.2). It removes the "Appearance notes: ${appearance}" line from the two variant templates, so the model gets only the bust and the one change. An install that saved its own copy of those prompts keeps that copy until it is reset. **Review:** local CodeRabbit raised 1 finding, the docs-i18n link, now resolved. A 4-lens adversarial review raised 7 findings. Its verifiers confirmed 5, all fixed in ae26f58f5. They rejected 2: the docs-i18n issue was already tracked in #7638, and the `referenceIsCanvas` wiring was not a defect (a source check was added anyway). ## 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 on the 2D Avatars page with a GPT Image connection: make a mouth-open and an eyes-closed picture for a cut-out bust. Each should keep the same bust and framing, with only the mouth or eyes changed. - Manually verify that **Make faces from avatar** offers exactly neutral, happy, angry, sad, relaxed and surprised, and that the new faces land on the right feelings. - Manually verify that **Blink and talk pictures** shows only the talking head's faces, with saved and `_blink`/`_talk` pictures, at phone width too. - Manually verify that **Try again** shows a spinner over the picture and then replaces it. - Manually verify the local validation listed below on your machine (`pnpm check`). Agent-run validation, for reference: - client, server and e2e `tsc` - client lint, `check-locales`, `localization:check`, `impeccable:check` - regressions: avatar-generation, avatar-contract, avatar-2d-renderers, codex-chatgpt-image - Playwright `avatar-generation` + `avatar-setup` on desktop-chromium and mobile-chromium (12/12) ## Docs and release impact - [ ] No docs changes needed - [ ] Updated docs (README / CONTRIBUTING / android/README) 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) ## UI evidence (if applicable) The e2e run writes `pngtuber-picture.png`, `pngtuber-redo.png` and `avatar-faces-generator.png` to its test output folder. No screenshots are attached here. <!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit * **New Features** * Generate avatar faces for six available feelings, with expression choices tailored to the selected layout. * Create and manage eyes-closed and mouth-open pictures for each face, individually or in batches. View progress, retry failed attempts, and keep completed pictures. * Use generated sprite faces in avatar emotion and talking-head views. * **Bug Fixes** * Image edits better preserve reference framing, and transparent sprites appear against a white background. * Exact sprite emotion labels take priority when matching faces. * Saving new pictures preserves existing faces and sprite variants. <!-- 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:08:26 +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#7879
No description provided.