mirror of
https://github.com/Pasta-Devs/Marinara-Engine.git
synced 2026-12-03 19:00:50 +07:00
[PR #7854] [MERGED] fix(avatars): blink and talk pictures change only the eyes or mouth, and are generated when the model cannot edit #7973
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#7973
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/7854
Author: @SpicyMarinara
Created: 10/19/2026
Status: ✅ Merged
Merged: 10/19/2026
Merged by: @SpicyMarinara
Base:
staging← Head:fix/avatar-variant-region-composite📝 Commits (1)
be9cbc3fix(avatars): blink and talk pictures change only the eyes or mouth, and are generated when the model cannot edit📊 Changes
15 files changed (+2056 additions, -280 deletions)
View changed files
📝
docs/agents/avatars.md(+6 -4)📝
e2e/avatar-generation.e2e.ts(+147 -12)📝
packages/client/src/features/avatars/generation/PngtuberVariantsSection.tsx(+27 -3)📝
packages/client/src/features/avatars/generation/use-avatar-generation.ts(+86 -9)📝
packages/client/src/localization/locales/en.json(+2 -0)📝
packages/server/src/routes/avatar-generation.routes.ts(+3 -1)📝
packages/server/src/routes/sprites.routes.ts(+189 -69)📝
packages/server/src/services/avatars/generation/generation-context.ts(+101 -87)📝
packages/server/src/services/avatars/generation/pngtuber-variants.ts(+156 -27)➕
packages/server/src/services/avatars/generation/variant-composite.ts(+706 -0)📝
scripts/regressions/avatar-backgrounds.regression.ts(+81 -56)📝
scripts/regressions/avatar-generation-cancel.regression.ts(+5 -3)➕
scripts/regressions/avatar-variant-composite.regression.ts(+537 -0)📝
scripts/regressions/image-edit-reference.regression.ts(+8 -9)📝
scripts/run-regressions.mjs(+2 -0)📄 Description
Linked issue
No issue: @SpicyMarinara's report while testing staging on 2026-10-19 (Agents → 2D Avatars → Blink and talk pictures). An issue should be opened for it if one is needed for tracking. Follow-up to #7682, #7690 and #7843; replaces the approach of the closed #7841.
Why this change
The Eyes closed and Mouth open pictures came back with a white line along the bottom and slightly wrong pixels everywhere else. The face was clean, and the image model was the same one that made the faces.
Root cause, in plain words: image models never send a picture back exactly where it went in. They pad it, move it a few pixels or zoom out a little. The Engine then pasted the model's whole picture back inside the face's outline. Wherever the model had shifted or shrunk the picture, its white padding landed inside the outline. The reported face (512×484) is a bust cut flat at the canvas bottom, so the padding showed as a white line just above the bottom. #7843 kept the bottom 13 rows as the face's own pixels, which is why the line sits a little above the edge rather than on it. Everything else was the model's redraw, scaled slightly, so pixels looked off all over.
Separately, an image connection that can't edit pictures (DALL-E, Pollinations, Together AI, Horde, a ComfyUI workflow without a picture slot) was refused outright, so those users had no way to get blink and talk pictures.
What changed
applyAvatarSourceOutlineand its band). The region composite keeps its guarantees: the face's own alpha and edge pixels, and no stripe along a bust cut at the canvas edge.routes/sprites.routes.tsis now one function that both Make faces from the avatar and the set use. Sheet behavior is unchanged.After updating, make the existing Eyes closed and Mouth open pictures again. Pictures saved before this change kept the model's whole picture, white line included. Use Try again on each, then Save kept pictures.
Validation
pnpm checkpasses locallyCONTRIBUTING.mdAgent-run validation (the boxes above are left for the human pass):
pnpm checkpassed on the pushed commit: localization, formatting, lint, TypeScript and production builds. The one lint warning is pre-existing, inHomeProfessorMariChat.tsx.node scripts/run-regressions.mjs --filter avatar-: 20/20 passed, including the newavatar-variant-composite. The filtersimage-edit-reference,sprite,gpt-image-2-5,open-issues,pixelizeandregeneration-contextalso passed.avatar-variant-composite:_talksprite doesn't stay. A character without an appearance gets the plain message.neutral.pngisn't committed.MARINARA_AVATAR_VARIANT_SOURCE=<png>runs the same edit checks on it, and it passed on the reported face.avatar-backgrounds: the outline-collar checks now target the region composite. A cut-out keeps its alpha and edge, a bust's bottom edge survives a white stripe, a fringe and a hair highlight never come through, and small cropped faces keep their eye and mouth edits.image-edit-reference: a connection that drops the picture is no longer refused; it reportscanEdit: false.avatar-generation-cancel: its fake model now answers with a real edit, because an unchanged picture is refused.avatar-generation,avatar-setupandgpt-image-2-5.staging:Manual verification notes
Docs and release impact
docs-i18nbranch updated to match, or a[docs-i18n]follow-up issue opened (see CONTRIBUTING.md § Translated documentation)docs/agents/avatars.mdchanged (Blink and talk pictures). Translations: follow-up issue #7853. No release metadata changed.UI evidence (if applicable)
Before/after pictures were made on the reported face and kept locally, not uploaded: the face, the old pipeline and the new one side by side for each simulated output, plus the real Codex edits and set. Old pipeline: a white line along the bottom (zoomed-out output), large white areas (letterboxed), and a slightly shrunken redraw inside the original outline. New pipeline: the face's own pixels everywhere except the closed eyes or open mouth.
The new New face row was screenshotted in the Playwright run: the hint line under the feeling names, then New face, Eyes closed and Mouth open with their pictures.
Summary by CodeRabbit
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.