mirror of
https://github.com/Pasta-Devs/Marinara-Engine.git
synced 2026-12-03 19:00:50 +07:00
[GH-ISSUE #7962] [Issue]: 2D Avatars: fixed colour threshold in blink/talk compositing fails dark-skinned talk pictures and leaves the open eye showing in blinks #4371
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#4371
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?
Originally created by @surrealle on GitHub (Oct 21, 2026).
Original GitHub issue: https://github.com/Pasta-Devs/Marinara-Engine/issues/7962
Originally assigned to: @SpicyMarinara on GitHub.
Summary
The blink/talk compositor (
keepAvatarFaceChangeinservices/avatars/generation/variant-composite.js) uses a fixed colour difference,CHANGE_THRESHOLD = 48on the largest RGB channel, both to detect the edit and to decide which pixels to copy. That causes two bugs, depending on the character's colours:Expected behavior
Actual behavior
Talk pictures, dark-skinned character (skin ≈ rgb 86,64,88):
Blinks, pale character with amber eyes (skin ≈ 243,193,180, iris ≈ 254,208,149):
Reproduced without any image model, by calling
keepAvatarFaceChange(face, picture, variant)directly in the container on the saved 313×313neutral-base.pngfaces, with hand-painted edits:The same mouth edit passes or fails depending only on skin tone. A blink fails to apply even when the input picture is a perfect closed eye.
Cause, from reading the code:
reach.A maroon mouth on dark purple skin differs by about 45–55, so it is not detected. A light amber iris differs from a pale eyelid by less than 48, so it is treated as unchanged and copied back from the open-eyed face.
Steps to reproduce
Model-independent repro: inside the container, import
keepAvatarFaceChangefrom/app/packages/server/dist/services/avatars/generation/variant-composite.js. Pass the savedneutral-base.pngas raw RGBA{data, width, height}, plus a copy of it with an open mouth or closed eyes painted on, and the variant"mouth-open"or"eyes-closed". Check whether it throws, and look at the returnedpicture.Environment
Logs, screenshots, or video
Server log for a failing talk picture (repeated about 20 times for the same character):
Attached:
lillith-mouth-test.png: the three painted mouths on the dark-skinned face: maroon (FAIL), white teeth (PASS), and the same maroon mouth on the lightened face (PASS).elara-saved-blinks.jpg: the open face, then two saved blinks from two image models, each with an amber iris strip under the lid.elara-compositor-test.jpg: the open face, then a perfectly closed eye painted by hand, then whatkeepAvatarFaceChangereturns for it (the iris shows through).Additional context
Suggested direction:
Workaround today: for dark skin, asking the model for a row of bright white teeth gets talk pictures through. There is no prompt workaround for the blink ghosting.
Related, but not the same: #7840 (white outlines/bottom stripe), #7681.
Template check
@SpicyMarinara commented on GitHub (Oct 21, 2026):
Maintainer update: Claude is handling this issue. Codex has stopped its initial investigation; no implementation changes, commits or PR were created. Ownership remains with Claude.