[GH-ISSUE #7537] 2D and 3D avatar agents #4194

Closed
opened 2026-10-21 06:12:17 +07:00 by bsakaguchi · 6 comments
Owner

Originally created by @SpicyMarinara on GitHub (Oct 13, 2026).
Original GitHub issue: https://github.com/Pasta-Devs/Marinara-Engine/issues/7537

Originally assigned to: @SpicyMarinara on GitHub.

What problem does this solve?

Characters and personas only have still sprites. People want an animated avatar that changes its face while a reply streams in and moves its mouth with the text or the voice, like a VTuber model, for both 2D and 3D styles.

Proposed solution

Two downloadable agents, 2D Avatars (2d-avatars) and 3D Avatars (3d-avatars), for Characters and Personas.

Decisions (Mari, 2026-10-13):

  • The packages in Pasta-Devs/Marinara-Agents stay thin: agent definitions, default prompts, locales and catalog entries. The Engine owns everything else: storage, import, renderers, setup UI, the stream director, the classifier and the generation routes.
  • Renderers are Engine-owned and lazy-loaded. Their code loads only when the matching agent is installed and used; nothing heavy goes into the main bundle.
  • Setup lives on each agent's own page in the Agent editor, not in Sprite Cards.
  • No automatic full-body sprite suppression: the user turns the full-body sprite off by hand. Avatars work with or without the Expression Engine; when it is in the chat, its post-reply pick is the final face.
  • 2D formats: PNGTuber-style layered sprites (per-expression sprite plus optional mouth-open and eyes-closed variants, talk and blink swaps, bounce; reuses the owner's expression sprites; imports PNGTuber Plus .save files, Unlicense) and mesh-avatar (.mavatar, MIT, npm mesh-avatar pinned at exactly 0.1.1, pure JS WebGL2, no WASM, no CSP change). No Inochi2D, Rive or Spine.
  • 3D: VRM 0.x and 1.0 through three and @pixiv/three-vrm (plus three-vrm-animation), MIT, exact pins.
  • One expression contract for 2D and 3D: emotions neutral, happy, angry, sad, relaxed, surprised (the VRM 1.0 presets); visemes aa, ih, ou, ee, oh; states idle, thinking, talking, listening.
  • Expression source: Roleplay uses a local streaming classifier (tiered; no LLM-written tags; no Decision models, which run after generation). Game mode uses the Game Master's per-line expressions. The Expression Engine, if present, sets the final face after the reply.
  • Imports get no new size limit below the global upload cap. .mavatar archives are read with the Engine's strict archive reader (hardened in #7532), so only dishonest archives are refused.
  • Lip sync follows the visible dialogue text while streaming, and the TTS audio when TTS plays.
  • Generation: one click from a sprite makes PNGTuber variants (eyes closed, mouth open per expression) with the existing sprite and image generation, or a mesh-avatar rig with the user's vision model and a JavaScript (sharp) layer builder. No Python, OpenCV or GPU. Hosted 3D generation is out of scope for now.
  • Performance: phones draw at most 2 avatars and desktops 4; one WebGL context per renderer type; device pixel ratio capped at 1.5 on phones and 2 on desktop; 30 fps while talking, 15–20 fps idle on phones; 0 fps when hidden, offscreen or effects are paused; reduced motion honoured.
  • Assets: open-source assets only (CC0, MIT, Apache, CC BY with attribution next to the asset). Drawn fixtures and the setup preview avatar are generated, with a provenance note.

Lanes (each lane's PR works on its own on top of the contract):

  • Contract: shared types, inert skeleton, pinned dependencies
  • Base: storage, /api/avatar-models routes, setup on the agent pages, the stage in Roleplay and Game chats
  • 2D: PNGTuber and mesh-avatar renderers, .save and .mavatar import, their setup panels
  • 3D: VRM renderer, .vrm and .vrma import, its setup panel
  • Director: the streaming classifier (/api/avatar-classify) and the director (classifier faces, Game Master lines, Expression Engine final face, speech-clock lip sync)
  • TTS: voice level from text-to-speech playback for lip sync
  • Generation: /api/avatar-generation for PNGTuber variants and a mesh-avatar rig from a sprite
  • Packages: 2d-avatars and 3d-avatars in Pasta-Devs/Marinara-Agents

Alternatives considered

Live2D is intentionally unsupported for licensing reasons: its licence needs Live2D's review and a separate agreement even for free open-source apps, and its Cubism Core runtime cannot be bundled. Inochi2D (WASM, blocked by the CSP, few models), Rive, Spine, DragonBones and PNGTuber Remix were also ruled out.

Additional context

The user guide is docs/agents/avatars.md; each lane fills its own section.

Template check

Please uncheck (untick) the box below before submitting so we know you read the template. It is intentionally pre-checked:

  • I DID NOT read this template and provide the requested details.
Originally created by @SpicyMarinara on GitHub (Oct 13, 2026). Original GitHub issue: https://github.com/Pasta-Devs/Marinara-Engine/issues/7537 Originally assigned to: @SpicyMarinara on GitHub. ## What problem does this solve? Characters and personas only have still sprites. People want an animated avatar that changes its face while a reply streams in and moves its mouth with the text or the voice, like a VTuber model, for both 2D and 3D styles. ## Proposed solution Two downloadable agents, **2D Avatars** (`2d-avatars`) and **3D Avatars** (`3d-avatars`), for Characters and Personas. Decisions (Mari, 2026-10-13): - The packages in Pasta-Devs/Marinara-Agents stay thin: agent definitions, default prompts, locales and catalog entries. The Engine owns everything else: storage, import, renderers, setup UI, the stream director, the classifier and the generation routes. - Renderers are Engine-owned and lazy-loaded. Their code loads only when the matching agent is installed and used; nothing heavy goes into the main bundle. - Setup lives on each agent's own page in the Agent editor, not in Sprite Cards. - No automatic full-body sprite suppression: the user turns the full-body sprite off by hand. Avatars work with or without the Expression Engine; when it is in the chat, its post-reply pick is the final face. - 2D formats: PNGTuber-style layered sprites (per-expression sprite plus optional mouth-open and eyes-closed variants, talk and blink swaps, bounce; reuses the owner's expression sprites; imports PNGTuber Plus `.save` files, Unlicense) and mesh-avatar (`.mavatar`, MIT, npm `mesh-avatar` pinned at exactly 0.1.1, pure JS WebGL2, no WASM, no CSP change). No Inochi2D, Rive or Spine. - 3D: VRM 0.x and 1.0 through `three` and `@pixiv/three-vrm` (plus `three-vrm-animation`), MIT, exact pins. - One expression contract for 2D and 3D: emotions neutral, happy, angry, sad, relaxed, surprised (the VRM 1.0 presets); visemes aa, ih, ou, ee, oh; states idle, thinking, talking, listening. - Expression source: Roleplay uses a local streaming classifier (tiered; no LLM-written tags; no Decision models, which run after generation). Game mode uses the Game Master's per-line expressions. The Expression Engine, if present, sets the final face after the reply. - Imports get no new size limit below the global upload cap. `.mavatar` archives are read with the Engine's strict archive reader (hardened in #7532), so only dishonest archives are refused. - Lip sync follows the visible dialogue text while streaming, and the TTS audio when TTS plays. - Generation: one click from a sprite makes PNGTuber variants (eyes closed, mouth open per expression) with the existing sprite and image generation, or a mesh-avatar rig with the user's vision model and a JavaScript (sharp) layer builder. No Python, OpenCV or GPU. Hosted 3D generation is out of scope for now. - Performance: phones draw at most 2 avatars and desktops 4; one WebGL context per renderer type; device pixel ratio capped at 1.5 on phones and 2 on desktop; 30 fps while talking, 15–20 fps idle on phones; 0 fps when hidden, offscreen or effects are paused; reduced motion honoured. - Assets: open-source assets only (CC0, MIT, Apache, CC BY with attribution next to the asset). Drawn fixtures and the setup preview avatar are generated, with a provenance note. Lanes (each lane's PR works on its own on top of the contract): - [ ] Contract: shared types, inert skeleton, pinned dependencies - [ ] Base: storage, `/api/avatar-models` routes, setup on the agent pages, the stage in Roleplay and Game chats - [ ] 2D: PNGTuber and mesh-avatar renderers, `.save` and `.mavatar` import, their setup panels - [ ] 3D: VRM renderer, `.vrm` and `.vrma` import, its setup panel - [ ] Director: the streaming classifier (`/api/avatar-classify`) and the director (classifier faces, Game Master lines, Expression Engine final face, speech-clock lip sync) - [ ] TTS: voice level from text-to-speech playback for lip sync - [ ] Generation: `/api/avatar-generation` for PNGTuber variants and a mesh-avatar rig from a sprite - [ ] Packages: `2d-avatars` and `3d-avatars` in Pasta-Devs/Marinara-Agents ## Alternatives considered Live2D is intentionally unsupported for licensing reasons: its licence needs Live2D's review and a separate agreement even for free open-source apps, and its Cubism Core runtime cannot be bundled. Inochi2D (WASM, blocked by the CSP, few models), Rive, Spine, DragonBones and PNGTuber Remix were also ruled out. ## Additional context The user guide is `docs/agents/avatars.md`; each lane fills its own section. ## Template check Please **uncheck (untick)** the box below before submitting so we know you read the template. It is intentionally pre-checked: - [ ] I DID NOT read this template and provide the requested details.
bsakaguchi 2026-10-21 06:12:17 +07:00
Author
Owner

@SpicyMarinara commented on GitHub (Oct 13, 2026):

Contract PR (owner: @SpicyMarinara, via Claude Code): #7539. It fixes the shared types, the inert skeleton and the dependency pins every lane builds on. Translation follow-up for the new guide: #7540.

<!-- gh-comment-id:6150939446 --> @SpicyMarinara commented on GitHub (Oct 13, 2026): Contract PR (owner: @SpicyMarinara, via Claude Code): #7539. It fixes the shared types, the inert skeleton and the dependency pins every lane builds on. Translation follow-up for the new guide: #7540.
Author
Owner

@SpicyMarinara commented on GitHub (Oct 13, 2026):

Packages lane:

  • Pasta-Devs/Marinara-Agents#1369 (issue Pasta-Devs/Marinara-Agents#1368) adds the 2d-avatars and 3d-avatars packages, version 0.1.0, as host agents with Capability API 1.73, plus the three generation prompt defaults and the covers. Both stay in INCOMPLETE_PACKAGE_IDS (no catalog, no preview) until the setup, stage and a renderer are on staging.
  • Pasta-Devs/Marinara-Engine#7551 adds the docs: the Downloadable Agents Reference entries and the avatars guide's Downloading the agents section.
<!-- gh-comment-id:6151683910 --> @SpicyMarinara commented on GitHub (Oct 13, 2026): Packages lane: - Pasta-Devs/Marinara-Agents#1369 (issue Pasta-Devs/Marinara-Agents#1368) adds the `2d-avatars` and `3d-avatars` packages, version 0.1.0, as host agents with Capability API 1.73, plus the three generation prompt defaults and the covers. Both stay in `INCOMPLETE_PACKAGE_IDS` (no catalog, no preview) until the setup, stage and a renderer are on staging. - Pasta-Devs/Marinara-Engine#7551 adds the docs: the Downloadable Agents Reference entries and the avatars guide's **Downloading the agents** section.
Author
Owner

@SpicyMarinara commented on GitHub (Oct 13, 2026):

Director lane (streaming classifier and director): #7555, built on #7539.

<!-- gh-comment-id:6151874161 --> @SpicyMarinara commented on GitHub (Oct 13, 2026): Director lane (streaming classifier and director): #7555, built on #7539.
Author
Owner

@SpicyMarinara commented on GitHub (Oct 13, 2026):

3D lane (VRM renderer, importer and setup panel): #7557, built on #7539. It adds two optional fields to VrmAvatarData (meta, expressionNames) so setup can show the author's terms and the model's expressions; the PR body calls this out.

<!-- gh-comment-id:6151978189 --> @SpicyMarinara commented on GitHub (Oct 13, 2026): 3D lane (VRM renderer, importer and setup panel): #7557, built on #7539. It adds two optional fields to `VrmAvatarData` (`meta`, `expressionNames`) so setup can show the author's terms and the model's expressions; the PR body calls this out.
Author
Owner

@SpicyMarinara commented on GitHub (Oct 13, 2026):

Generation lane (make an avatar from a sprite: PNGTuber blink/talk pictures and a mesh avatar from one sprite): #7554, built on #7539. No contract file is changed. Saving needs the base lane's storage, and keeping a mesh avatar needs the 2D lane's .mavatar importer; until that importer lands, mesh generation answers 503 before any model call.

<!-- gh-comment-id:6152642699 --> @SpicyMarinara commented on GitHub (Oct 13, 2026): Generation lane (make an avatar from a sprite: PNGTuber blink/talk pictures and a mesh avatar from one sprite): #7554, built on #7539. No contract file is changed. Saving needs the base lane's storage, and keeping a mesh avatar needs the 2D lane's `.mavatar` importer; until that importer lands, mesh generation answers 503 before any model call.
Author
Owner

@SpicyMarinara commented on GitHub (Oct 14, 2026):

Landed on staging. Engine: contract #7539, base #7556 (+ #7578), 2D #7549 (+ #7576), 3D #7557, live faces and mood reader #7555, TTS lip sync #7547 (+ #7575), generation #7554, docs #7551, polish and reuse #7581, real-file imports and "Make your own model" #7580, Download Agents filters #7583. Agents: packages #1369 and staging catalog #1372 (2D Avatars and 3D Avatars 0.1.1, staging-only preview).

Findings from staging testing go into follow-up PRs. Translation: #7540.

<!-- gh-comment-id:6160600716 --> @SpicyMarinara commented on GitHub (Oct 14, 2026): Landed on staging. Engine: contract #7539, base #7556 (+ #7578), 2D #7549 (+ #7576), 3D #7557, live faces and mood reader #7555, TTS lip sync #7547 (+ #7575), generation #7554, docs #7551, polish and reuse #7581, real-file imports and "Make your own model" #7580, Download Agents filters #7583. Agents: packages #1369 and staging catalog #1372 (2D Avatars and 3D Avatars 0.1.1, staging-only preview). Findings from staging testing go into follow-up PRs. Translation: #7540.
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#4194
No description provided.