mirror of
https://github.com/Pasta-Devs/Marinara-Engine.git
synced 2026-12-03 19:00:50 +07:00
[PR #7554] [MERGED] feat(avatars): make an avatar from a sprite (PNGTuber variants and mesh avatars) #7793
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#7793
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/7554
Author: @SpicyMarinara
Created: 10/13/2026
Status: ✅ Merged
Merged: 10/14/2026
Merged by: @SpicyMarinara
Base:
staging← Head:feat/avatars-generation📝 Commits (10+)
a60776afeat(avatars): make PNGTuber variants and a mesh avatar from a spritea4ba56afeat(avatars): generation panel for the 2D Avatars agent page4eaef30fix(avatars): faster layer builder, fuller eye outline, one start per click9324400fix(avatars): keep the compiled negative prompt when a reviewed prompt leaves it outa606d44fix(avatars): refuse mesh generation before any model call when .mavatar can't be keptcbe06c1fix(avatars): show a failed retry instead of the old picture; plainer guidebe7d471Merge branch 'staging' into feat/avatars-generation5e1f172fix(avatars): keep generation responsive, lined up and from losing faces79b0e7dfix(avatars): ask GPT Image 2 for a canvas size it keeps7b1c7b6fix(avatars): log a cancelled generation as a cancellation📊 Changes
14 files changed (+4006 additions, -37 deletions)
View changed files
📝
docs/agents/avatars.md(+21 -1)📝
packages/client/src/features/avatars/generation/AvatarGenerationPanel.tsx(+142 -5)➕
packages/client/src/features/avatars/generation/MeshAvatarSection.tsx(+171 -0)➕
packages/client/src/features/avatars/generation/PngtuberVariantsSection.tsx(+277 -0)➕
packages/client/src/features/avatars/generation/SpritePicker.tsx(+56 -0)➕
packages/client/src/features/avatars/generation/use-avatar-generation.ts(+286 -0)📝
packages/client/src/localization/locales/en.json(+44 -0)📝
packages/server/src/routes/avatar-generation.routes.ts(+133 -10)➕
packages/server/src/services/avatars/generation/generation-context.ts(+483 -0)➕
packages/server/src/services/avatars/generation/mesh-layer-builder.ts(+571 -0)➕
packages/server/src/services/avatars/generation/mesh-rig-layout.ts(+412 -0)📝
packages/server/src/services/avatars/generation/mesh-rig.ts(+298 -10)📝
packages/server/src/services/avatars/generation/pngtuber-variants.ts(+476 -11)➕
scripts/regressions/avatar-generation.regression.ts(+636 -0)📄 Description
Linked issue
Refs #7537 (generation lane of the avatar agents epic)
Built on the avatar contract, #7539, which is now merged into
staging. This branch hasstagingmerged in, so the diff shows only this lane. Saving and the panel itself still need the base lane (#7556, storage and the setup page). Mesh avatars also need the 2D lane (#7549, the.mavatarimporter).Why this change
What changed
AvatarGenerationPanelthe base lane's setup mounts throughAVATAR_GENERATION_PANEL; it is inert until that PR lands):updateAvatarConfig). A change saved in the meantime (another tab, an import) is therefore kept.generatedsetup, so Update from sprites can't wipe the new pictures. Existing bindings and motion stay, and a set drawn for a different base picture is replaced rather than mixed.sprites.jsonas the full set (half-closed and smiling eyes, four mouth shapes) and switches its own lids and mouth off..mavataris checked with the 2D importer before it is offered. The user sees the sprite with the found face parts drawn on it, and Save as mesh avatar checks the archive again, like any upload, before storing it.avatarGenerationTemplates(ids inAVATAR_PROMPT_TEMPLATE_IDS). The Engine keeps one-sentence fallbacks only for a package that ships no template. Card text (name, appearance) reaches a prompt only as one capped line inside a template variable, the vision call adds a fixed line that the description is never an instruction, and the model's answer can only become a layout that passes the checks. Every prompt is logged withlogDebugOverride(debug mode orDEBUG_AGENTS), the vision messages with the picture redacted..mavatarfiles, Make mesh avatar is refused with 503 before any model call, so no paid request is wasted./api/avatar-generation, documented in the route header):POST /pngtuber-variants/preview,POST /pngtuber-variants(drafts),POST /pngtuber-variants/save,POST /mesh-rig(draft),POST /mesh-rig/save. The contract request types and schemas are reused unchanged.promptOverrides, the drafts'sourceHashand the draft/save bodies are lane-local, like the sprite routes' own body types. A closed request aborts with anAbortError, so a cancelled job is logged as a cancellation. No contract file is edited.avatars.generation.*inen.json;docs/agents/avatars.mdgets its "Making an avatar from a sprite" section (translation follow-up: #7540).Design notes for reviewers
ponytail:comment names the ceiling: refine from eye-white pixels).fill_skin), not model inpainting: the existing image path has no edit mask.ponytail:comment names the ceiling (flat shading under the lids; upgrade: masked inpainting once the image path accepts a mask). Hands, hanging accessories, buns and hair strands are not rigged; the hair moves with the head.spriteBuiltPngtuber) carries aponytail:comment: the two must change together until one copy moves into@marinara-engine/sharedwith a contract PR. A secondponytail:comment covers pictures of a replaced imported set. They stay on disk until the next PNGTuber import or removal tidies the folder, because storage has no queued tidy call for generation to use.Validation
pnpm checkpasses locallyCONTRIBUTING.mdCommands run by the agent on this branch (not a substitute for the boxes above):
pnpm checkon79b0e7d2b: passed (exit 0). The last commit,7b1c7b698, only changes an abort reason, one docs sentence and the regression's fake server.tsc --noEmit, Prettier and the regression were re-run and pass.pnpm checkrun.node scripts/run-regressions.mjs --filter avatar-: 7/7 passed, including the reworkedavatar-generationregression and the contract'savatar-contract.pnpm localization:check: passed. Twoavatars.generation.drawVariants*keys were removed with the mesh drawing option.sourceHash.process.threadCpuUsage, because the machine was heavily loaded:storage.ts(swapped in, then restored):happy_talkstays happy's mouth-open picture.--committed, base797877c54) on79b0e7d2braised 3 findings, all fixed in7b1c7b698: the fake server's size came from the request, the cancel reason was a plain Error, and the fallback connection was missing from the privacy sentence.7b1c7b698raised 2 findings. Both were rejected with these reasons:repairJsonTextreturns only text thatJSON.parsealready accepted, sotryParseJsonRecordcannot throw. The cited{"headBox":[x0,y0,x1,y1]}comes back as strings, the strict schema refuses it, and the retry path runs.globals.cssalready setsfont-size: 1remoninput, select, textareaunder@media (pointer: coarse). That rule is outside any@layer, so it outranks Tailwind's layeredtext-sm.Manual verification needed
This lane needs the base lane (storage, setup page) and the 2D lane (
.mavatarimporter) onstagingbefore the panel shows up and saving works.full_sprites on one character, check only the portraits are offered for blink and talk pictures.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.mdgains its "Making an avatar from a sprite" section; the translation follow-up for this guide is #7540 (it covers later edits to the section too). No CHANGELOG entry (release notes are compiled from this description).UI evidence (if applicable)
Summary by CodeRabbit
New Features
Documentation
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.