[PR #7623] [MERGED] fix(avatars): Cancel stops avatar generation on the server, and 2D avatars have no background #7842

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

📋 Pull Request Information

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

Base: staging ← Head: fix/pngtuber-cancel-and-clean-backgrounds


📝 Commits (6)

  • 9137e5f refactor(sprites): move the sprite background cleanup into its service
  • cd987fb fix(avatars): Cancel stops generation on the server, and 2D avatars have no background
  • 11194d4 docs(avatars): describe Cancel and avatars without backgrounds
  • e01bb13 fix(avatars): a late Cancel never stops the next job, and cut-outs need an owner
  • 6c53e1d Merge branch 'staging' into fix/pngtuber-cancel-and-clean-backgrounds
  • f1c9515 fix(avatars): blink pictures keep the cut-out's own edge, and fallback cut-outs are redone

📊 Changes

20 files changed (+1732 additions, -295 deletions)

View changed files

📝 docs/agents/avatars.md (+7 -4)
📝 e2e/avatar-2d.e2e.ts (+5 -0)
➕ e2e/avatar-generation.e2e.ts (+249 -0)
📝 e2e/avatar-setup.e2e.ts (+7 -0)
📝 packages/client/src/features/avatars/generation/use-avatar-generation.ts (+50 -14)
📝 packages/client/src/features/avatars/stage/avatar-stage-logic.ts (+14 -2)
📝 packages/server/src/routes/avatar-generation.routes.ts (+19 -3)
📝 packages/server/src/routes/avatar-models.routes.ts (+28 -0)
📝 packages/server/src/routes/sprites.routes.ts (+5 -199)
➕ packages/server/src/services/avatars/cutouts.ts (+187 -0)
📝 packages/server/src/services/avatars/formats/pngtuber.ts (+29 -17)
📝 packages/server/src/services/avatars/generation/generation-context.ts (+112 -24)
📝 packages/server/src/services/avatars/generation/mesh-rig.ts (+14 -8)
📝 packages/server/src/services/avatars/generation/pngtuber-variants.ts (+41 -13)
📝 packages/server/src/services/image/sprite-background.service.ts (+218 -4)
📝 scripts/regressions/avatar-2d-importers.regression.ts (+5 -1)
📝 scripts/regressions/avatar-2d-renderers.regression.ts (+3 -2)
➕ scripts/regressions/avatar-backgrounds.regression.ts (+491 -0)
➕ scripts/regressions/avatar-generation-cancel.regression.ts (+232 -0)
📝 scripts/regressions/avatar-stage-logic.regression.ts (+16 -4)

📄 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

No linked issue: requested by the maintainer on 2026-10-14.

Why this change

  • Cancel didn't stop the picture being made. In the 2D Avatars agent's "Make an avatar from a sprite" panel, Cancel only closed the browser's request. The server stopped the image request only if that close reached it. Behind a proxy or tunnel that keeps the server's side open, the picture kept being drawn and the avatar stayed "already being made" (409) until it finished. The panel also put the cancelled picture back to "Waiting" next to the rest of the queue, so it looked paused rather than stopped.
  • Avatars showed the sprite's background. A sprite drawn on a background showed as a box around the PNGTuber face, the blink and talk pictures drawn from it had the background too, and a mesh avatar built from it kept it. The maintainer asked for the PNGTuber and the mesh avatar to always have the background removed with the Engine's own cleanup.

What changed

What works differently for users:

  • Cancel stops the work on the server too, and the panel goes back to idle. Pictures not made yet are dropped; pictures already made stay. You can start again right away. The same goes for the mesh avatar.
  • PNGTuber avatars have no background. A sprite face shows as a cut-out of the sprite. Blink and talk pictures have exactly the cut-out's outline and keep its own edge pixels, so blinking or talking never flashes a background, a halo or a lighter or darker rim. PNGTuber Plus costumes drawn on a background are imported as cut-outs.
  • Mesh avatars have no background. The layers are built from the sprite's cut-out.
  • Your sprites are never changed. The cut-out is stored once per sprite version in the avatar's own folder. Sprites that already have a transparent background, animated sprites and SVG sprites show as they are, and so do all sprites on servers without image processing.
  • If the AI background remover is missing or fails, the built-in cleaner makes the cut-out, and it is made again later. It is redone once the remover is installed. If an installed remover failed on that sprite, it is tried again after the server restarts.
  • Saved avatars are not rewritten. Faces that show your sprites become cut-outs the first time they show. Blink and talk pictures, imported costumes and mesh avatars saved before this change keep their background until you make or import them again.
  • Saving a new picture can drop older ones. For a face saved before this change whose sprite has a background, saving a new blink or talk picture drops that face's older pictures, because they would still show the background. Make those again too.

How:

  • The Cancel button now also calls POST /api/avatar-generation/cancel (owner + kind). It aborts the job's provider requests through the job's AbortSignal and frees the avatar right away. This covers the image edit (and its fallback connection) and the mesh avatar's vision request. Closing the request still works as before. A new start waits for the last Cancel request, so a late cancel never stops the next job.
  • The sprite background cleanup (removeSpriteBackgroundPng and the AI remover's mask softening) moved unchanged from routes/sprites.routes.ts into services/image/sprite-background.service.ts. Its result now also says fallback when the AI remover was wanted but gave nothing. The new services/avatars/cutouts.ts reuses it, with the configured engine: the built-in cleaner for a flat background, and the AI remover when it is installed and the background isn't flat (or always, when it is the configured engine). When the AI remover is missing or fails, the built-in cleaner is used, as on Lite and Termux. A picture counts as already transparent by the matte cleanup's own test (a tenth of it see-through, or some see-through pixels reaching the border).
  • A sprite's fallback cut-out is stored apart (cutout-1-<hash>-fallback.png) and served with no-cache, not immutable. It is made again when the AI remover is installed. If the installed remover failed on that sprite, it is not run again until the server restarts.
  • Blink and talk pictures: the image model is shown the sprite with its background, as on staging, because some image services drop see-through pixels. applyAvatarSourceOutline then gives the drawn picture the cut-out's alpha. Within a few pixels of the cut-out's see-through part it keeps the cut-out's own pixels, because the model drew those mixed with its background. That band is used rather than "every pixel short of solid" because the AI remover's mask is often just short of solid inside the face, and the drawn eyes and mouth must show there.
  • New GET /api/avatar-models/:ownerType/:ownerId/sprite-cutouts/:label serves a sprite's cut-out, made on first request. The stage, setup panel and preview ask for it instead of the raw sprite. The URL carries the sprite's own ?v= version.
  • PNGTuber Plus imports: each costume variant keeps the base's cut-out wherever it shows the same pixel as the base.
  • Docs: docs/agents/avatars.md describes Cancel and the cut-outs, in short sentences.

Decision for the maintainer: the cut-outs use the sprite cleanup's configured engine, as sprite generation does. On the default setting, a flat background goes to the built-in cleaner even when the AI remover is installed, and a busier one goes to the AI remover. The request said "AI remover when available". The built-in cleaner is much faster for flat backgrounds, and the AI remover runs one Python process per picture. Making the AI remover always go first is a one-line change in cutouts.ts; say if you want it.

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

Commands run by the agent (results as reported, not a substitute for the boxes above):

  • pnpm check (on f1c9515dc): passed. pnpm lint shows one warning in a client file this PR doesn't touch.
  • pnpm localization:check: passed (no new UI copy).
  • node scripts/run-regressions.mjs --filter avatar (on f1c9515dc): 16/16 passed, including the new avatar-generation-cancel and avatar-backgrounds regressions. --filter sprite 2/2 passed on f1c9515dc. --filter image-generation 1/1 passed on the same changes before the size cap below was added. --filter pixelize 1/1 and --filter open-issues 1/1 passed on the earlier head.
  • Fail-before for the review fixes, each with only that part reverted in avatar-backgrounds: the old outline function fails on the edge is the cut-out's own (no rim from the model's background). Keeping only fully solid pixels from the drawn picture fails on the drawn mark stays for a cut-out whose inside is alpha 250. Showing the model the cut-out fails on the model sees the sprite as it is. The old cutouts.ts fails on it is stored as a fallback.
  • Fail-before: avatar-generation-cancel against staging's avatar code fails with after Cancel, the next picture: the Engine answered 409 {"error":"This avatar is already being made. …"}. The new e2e against staging's code fails on the cancelled panel still showing 2 "Waiting" pictures. Without the "wait for the last Cancel" change, the e2e fails because the late cancel closed the next picture's request.
  • Playwright: mobile-chromium avatar-generation, avatar-2d, avatar-setup passed (15) on f1c9515dc. desktop-chromium avatar-generation, avatar-2d, avatar-setup, avatar-preview passed (17) on the same changes before the size cap below was added. narrator-macro-avatars fails locally because its fixture packages/client/public/sprites/mari/Mari_wave.png is not in the repository (not on staging either); it is unrelated to this change.
  • Local CodeRabbit (coderabbit review --agent --committed): the first run had 2 findings, both fixed. A late /cancel could stop the next job; a new start now waits for it, and the e2e proves it. The cut-out route didn't check that the owner exists; it now does and cleans up after a deletion race. The second run had 0 findings. The run on the review-fix commit had 1 trivial finding (the set of sprites the AI remover failed on had no size cap), fixed in that commit.
  • GitHub CodeRabbit: 1 thread (docs bullet too long, translations). Fixed and resolved; the translations follow-up is #7618.

Manual verification notes

  • Manually verify in a browser, on a character whose sprites have a flat background (white, say): open Agents → 2D Avatars, pick the character, and check the PNGTuber faces and the chat avatar show no background.
  • Manually verify Make pictures with two pictures, then Cancel during the first. The panel should go idle at once with no "Waiting" pictures. Your image provider should show the request ended (for a local ComfyUI/A1111/Draw Things backend, see the note below). Make pictures again should start at once, without "already being made".
  • Manually verify that a kept blink picture, after Save kept pictures, blinks in the chat with no background flash, halo or lighter/darker rim, in both light and dark themes.
  • Manually verify Make mesh avatar: Cancel during "Building the mesh avatar…", then build and save one. The avatar should have no background.
  • Manually verify importing a PNGTuber Plus .save whose costume has a background layer: the faces come in as cut-outs.
  • Manually verify a sprite with a transparent background, and an animated (GIF) sprite, still show as they are.
  • Manually verify on a server behind your reverse proxy/tunnel (the setup where Cancel failed) that Cancel now stops the picture.
  • Manually verify with the AI background remover installed (pnpm backgroundremover:install) on a sprite with a busy, non-flat background: the face is a clean cut-out, and a blink picture made from it still shows its closed eyes. Then on Lite/Termux (built-in cleaner only).
  • Manually verify a sprite with a busy background shown before the AI remover is installed, then after installing it: the face's cut-out is made again.
  • Manually verify sprite-built faces with _blink/_talk sprites on a busy background with the AI remover: each sprite is cut out on its own, so check that the edge doesn't shimmer when it blinks. With the built-in cleaner the outlines match exactly; with the AI remover this is untested.

Not covered: the real AI remover (the tests use a fake command). Also, local backends (ComfyUI, A1111, Draw Things, SwarmUI) keep drawing after their HTTP request is aborted, because the shared image service sends no interrupt. That affects every image feature, not only avatars, and is left for a separate change.

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)

docs/agents/avatars.md changed. The follow-up for translations is added to the open #7618 ([docs-i18n] docs/agents/avatars.md).

UI evidence (if applicable)

Before/after screenshots were taken locally and are not uploaded. They show a PNGTuber face, its blink picture and a mesh avatar from a sprite on a cream background: staging shows the background box, this branch shows cut-outs. They also show the cancelled panel and a drawn blink picture.

Summary by CodeRabbit

  • New Features
    • Sprite backgrounds are removed when displaying avatar sprites, generating PNGTuber images and mesh avatars, and importing PNGTuber Plus costumes. Existing saved avatars and imported costumes keep their backgrounds until recreated or reimported.
    • Avatar generation can be cancelled, freeing the avatar for a new generation request.
  • Bug Fixes
    • Generated and saved PNGTuber images better retain the original sprite’s transparent outline.
    • Transparent and animated sprites are preserved during background cleanup.

🔄 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/7623 **Author:** [@SpicyMarinara](https://github.com/SpicyMarinara) **Created:** 10/14/2026 **Status:** ✅ Merged **Merged:** 10/14/2026 **Merged by:** [@SpicyMarinara](https://github.com/SpicyMarinara) **Base:** `staging` ← **Head:** `fix/pngtuber-cancel-and-clean-backgrounds` --- ### 📝 Commits (6) - [`9137e5f`](https://github.com/Pasta-Devs/Marinara-Engine/commit/9137e5fb6a78e9b8e3dc4d62528238ec86e83641) refactor(sprites): move the sprite background cleanup into its service - [`cd987fb`](https://github.com/Pasta-Devs/Marinara-Engine/commit/cd987fb2a5cd2b32eefa0f34e111bfaaa430931f) fix(avatars): Cancel stops generation on the server, and 2D avatars have no background - [`11194d4`](https://github.com/Pasta-Devs/Marinara-Engine/commit/11194d4025cac5912a87bf46908060f334b2fafb) docs(avatars): describe Cancel and avatars without backgrounds - [`e01bb13`](https://github.com/Pasta-Devs/Marinara-Engine/commit/e01bb13e696d6076a39a7c0e30531033c352abde) fix(avatars): a late Cancel never stops the next job, and cut-outs need an owner - [`6c53e1d`](https://github.com/Pasta-Devs/Marinara-Engine/commit/6c53e1d693defaebef6e30af1dddba17da70bda5) Merge branch 'staging' into fix/pngtuber-cancel-and-clean-backgrounds - [`f1c9515`](https://github.com/Pasta-Devs/Marinara-Engine/commit/f1c9515dc67cce9668842e724cc592da26d3415a) fix(avatars): blink pictures keep the cut-out's own edge, and fallback cut-outs are redone ### 📊 Changes **20 files changed** (+1732 additions, -295 deletions) <details> <summary>View changed files</summary> 📝 `docs/agents/avatars.md` (+7 -4) 📝 `e2e/avatar-2d.e2e.ts` (+5 -0) ➕ `e2e/avatar-generation.e2e.ts` (+249 -0) 📝 `e2e/avatar-setup.e2e.ts` (+7 -0) 📝 `packages/client/src/features/avatars/generation/use-avatar-generation.ts` (+50 -14) 📝 `packages/client/src/features/avatars/stage/avatar-stage-logic.ts` (+14 -2) 📝 `packages/server/src/routes/avatar-generation.routes.ts` (+19 -3) 📝 `packages/server/src/routes/avatar-models.routes.ts` (+28 -0) 📝 `packages/server/src/routes/sprites.routes.ts` (+5 -199) ➕ `packages/server/src/services/avatars/cutouts.ts` (+187 -0) 📝 `packages/server/src/services/avatars/formats/pngtuber.ts` (+29 -17) 📝 `packages/server/src/services/avatars/generation/generation-context.ts` (+112 -24) 📝 `packages/server/src/services/avatars/generation/mesh-rig.ts` (+14 -8) 📝 `packages/server/src/services/avatars/generation/pngtuber-variants.ts` (+41 -13) 📝 `packages/server/src/services/image/sprite-background.service.ts` (+218 -4) 📝 `scripts/regressions/avatar-2d-importers.regression.ts` (+5 -1) 📝 `scripts/regressions/avatar-2d-renderers.regression.ts` (+3 -2) ➕ `scripts/regressions/avatar-backgrounds.regression.ts` (+491 -0) ➕ `scripts/regressions/avatar-generation-cancel.regression.ts` (+232 -0) 📝 `scripts/regressions/avatar-stage-logic.regression.ts` (+16 -4) </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`. <!-- See CONTRIBUTING.md § Branches. --> ## Linked issue No linked issue: requested by the maintainer on 2026-10-14. ## Why this change - **Cancel didn't stop the picture being made.** In the 2D Avatars agent's "Make an avatar from a sprite" panel, Cancel only closed the browser's request. The server stopped the image request only if that close reached it. Behind a proxy or tunnel that keeps the server's side open, the picture kept being drawn and the avatar stayed "already being made" (409) until it finished. The panel also put the cancelled picture back to "Waiting" next to the rest of the queue, so it looked paused rather than stopped. - **Avatars showed the sprite's background.** A sprite drawn on a background showed as a box around the PNGTuber face, the blink and talk pictures drawn from it had the background too, and a mesh avatar built from it kept it. The maintainer asked for the PNGTuber and the mesh avatar to always have the background removed with the Engine's own cleanup. ## What changed What works differently for users: - **Cancel stops the work on the server too, and the panel goes back to idle.** Pictures not made yet are dropped; pictures already made stay. You can start again right away. The same goes for the mesh avatar. - **PNGTuber avatars have no background.** A sprite face shows as a cut-out of the sprite. Blink and talk pictures have exactly the cut-out's outline and keep its own edge pixels, so blinking or talking never flashes a background, a halo or a lighter or darker rim. PNGTuber Plus costumes drawn on a background are imported as cut-outs. - **Mesh avatars have no background.** The layers are built from the sprite's cut-out. - **Your sprites are never changed.** The cut-out is stored once per sprite version in the avatar's own folder. Sprites that already have a transparent background, animated sprites and SVG sprites show as they are, and so do all sprites on servers without image processing. - **If the AI background remover is missing or fails, the built-in cleaner makes the cut-out, and it is made again later.** It is redone once the remover is installed. If an installed remover failed on that sprite, it is tried again after the server restarts. - **Saved avatars are not rewritten.** Faces that show your sprites become cut-outs the first time they show. Blink and talk pictures, imported costumes and mesh avatars saved before this change keep their background until you make or import them again. - **Saving a new picture can drop older ones.** For a face saved before this change whose sprite has a background, saving a new blink or talk picture drops that face's older pictures, because they would still show the background. Make those again too. How: - The Cancel button now also calls `POST /api/avatar-generation/cancel` (owner + kind). It aborts the job's provider requests through the job's `AbortSignal` and frees the avatar right away. This covers the image edit (and its fallback connection) and the mesh avatar's vision request. Closing the request still works as before. A new start waits for the last Cancel request, so a late cancel never stops the next job. - The sprite background cleanup (`removeSpriteBackgroundPng` and the AI remover's mask softening) moved unchanged from `routes/sprites.routes.ts` into `services/image/sprite-background.service.ts`. Its result now also says `fallback` when the AI remover was wanted but gave nothing. The new `services/avatars/cutouts.ts` reuses it, with the configured engine: the built-in cleaner for a flat background, and the AI remover when it is installed and the background isn't flat (or always, when it is the configured engine). When the AI remover is missing or fails, the built-in cleaner is used, as on Lite and Termux. A picture counts as already transparent by the matte cleanup's own test (a tenth of it see-through, or some see-through pixels reaching the border). - A sprite's fallback cut-out is stored apart (`cutout-1-<hash>-fallback.png`) and served with `no-cache`, not `immutable`. It is made again when the AI remover is installed. If the installed remover failed on that sprite, it is not run again until the server restarts. - Blink and talk pictures: the image model is shown the sprite with its background, as on staging, because some image services drop see-through pixels. `applyAvatarSourceOutline` then gives the drawn picture the cut-out's alpha. Within a few pixels of the cut-out's see-through part it keeps the cut-out's own pixels, because the model drew those mixed with its background. That band is used rather than "every pixel short of solid" because the AI remover's mask is often just short of solid inside the face, and the drawn eyes and mouth must show there. - New `GET /api/avatar-models/:ownerType/:ownerId/sprite-cutouts/:label` serves a sprite's cut-out, made on first request. The stage, setup panel and preview ask for it instead of the raw sprite. The URL carries the sprite's own `?v=` version. - PNGTuber Plus imports: each costume variant keeps the base's cut-out wherever it shows the same pixel as the base. - Docs: `docs/agents/avatars.md` describes Cancel and the cut-outs, in short sentences. **Decision for the maintainer:** the cut-outs use the sprite cleanup's configured engine, as sprite generation does. On the default setting, a flat background goes to the built-in cleaner even when the AI remover is installed, and a busier one goes to the AI remover. The request said "AI remover when available". The built-in cleaner is much faster for flat backgrounds, and the AI remover runs one Python process per picture. Making the AI remover always go first is a one-line change in `cutouts.ts`; say if you want it. ## 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` Commands run by the agent (results as reported, not a substitute for the boxes above): - `pnpm check` (on f1c9515dc): passed. `pnpm lint` shows one warning in a client file this PR doesn't touch. - `pnpm localization:check`: passed (no new UI copy). - `node scripts/run-regressions.mjs --filter avatar` (on f1c9515dc): 16/16 passed, including the new `avatar-generation-cancel` and `avatar-backgrounds` regressions. `--filter sprite` 2/2 passed on f1c9515dc. `--filter image-generation` 1/1 passed on the same changes before the size cap below was added. `--filter pixelize` 1/1 and `--filter open-issues` 1/1 passed on the earlier head. - Fail-before for the review fixes, each with only that part reverted in `avatar-backgrounds`: the old outline function fails on `the edge is the cut-out's own (no rim from the model's background)`. Keeping only fully solid pixels from the drawn picture fails on `the drawn mark stays` for a cut-out whose inside is alpha 250. Showing the model the cut-out fails on `the model sees the sprite as it is`. The old `cutouts.ts` fails on `it is stored as a fallback`. - Fail-before: `avatar-generation-cancel` against staging's avatar code fails with `after Cancel, the next picture: the Engine answered 409 {"error":"This avatar is already being made. …"}`. The new e2e against staging's code fails on the cancelled panel still showing 2 "Waiting" pictures. Without the "wait for the last Cancel" change, the e2e fails because the late cancel closed the next picture's request. - Playwright: mobile-chromium `avatar-generation`, `avatar-2d`, `avatar-setup` passed (15) on f1c9515dc. desktop-chromium `avatar-generation`, `avatar-2d`, `avatar-setup`, `avatar-preview` passed (17) on the same changes before the size cap below was added. `narrator-macro-avatars` fails locally because its fixture `packages/client/public/sprites/mari/Mari_wave.png` is not in the repository (not on `staging` either); it is unrelated to this change. - Local CodeRabbit (`coderabbit review --agent --committed`): the first run had 2 findings, both fixed. A late `/cancel` could stop the next job; a new start now waits for it, and the e2e proves it. The cut-out route didn't check that the owner exists; it now does and cleans up after a deletion race. The second run had 0 findings. The run on the review-fix commit had 1 trivial finding (the set of sprites the AI remover failed on had no size cap), fixed in that commit. - GitHub CodeRabbit: 1 thread (docs bullet too long, translations). Fixed and resolved; the translations follow-up is #7618. ### Manual verification notes - Manually verify in a browser, on a character whose sprites have a flat background (white, say): open **Agents → 2D Avatars**, pick the character, and check the PNGTuber faces and the chat avatar show no background. - Manually verify **Make pictures** with two pictures, then **Cancel** during the first. The panel should go idle at once with no "Waiting" pictures. Your image provider should show the request ended (for a local ComfyUI/A1111/Draw Things backend, see the note below). **Make pictures** again should start at once, without "already being made". - Manually verify that a kept blink picture, after **Save kept pictures**, blinks in the chat with no background flash, halo or lighter/darker rim, in both light and dark themes. - Manually verify **Make mesh avatar**: **Cancel** during "Building the mesh avatar…", then build and save one. The avatar should have no background. - Manually verify importing a PNGTuber Plus `.save` whose costume has a background layer: the faces come in as cut-outs. - Manually verify a sprite with a transparent background, and an animated (GIF) sprite, still show as they are. - Manually verify on a server behind your reverse proxy/tunnel (the setup where Cancel failed) that Cancel now stops the picture. - Manually verify with the AI background remover installed (`pnpm backgroundremover:install`) on a sprite with a busy, non-flat background: the face is a clean cut-out, and a blink picture made from it still shows its closed eyes. Then on Lite/Termux (built-in cleaner only). - Manually verify a sprite with a busy background shown before the AI remover is installed, then after installing it: the face's cut-out is made again. - Manually verify sprite-built faces with `_blink`/`_talk` sprites on a busy background with the AI remover: each sprite is cut out on its own, so check that the edge doesn't shimmer when it blinks. With the built-in cleaner the outlines match exactly; with the AI remover this is untested. Not covered: the real AI remover (the tests use a fake command). Also, local backends (ComfyUI, A1111, Draw Things, SwarmUI) keep drawing after their HTTP request is aborted, because the shared image service sends no interrupt. That affects every image feature, not only avatars, and is left for a separate change. ## 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) `docs/agents/avatars.md` changed. The follow-up for translations is added to the open #7618 (`[docs-i18n] docs/agents/avatars.md`). ## UI evidence (if applicable) Before/after screenshots were taken locally and are not uploaded. They show a PNGTuber face, its blink picture and a mesh avatar from a sprite on a cream background: staging shows the background box, this branch shows cut-outs. They also show the cancelled panel and a drawn blink picture. <!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit * **New Features** * Sprite backgrounds are removed when displaying avatar sprites, generating PNGTuber images and mesh avatars, and importing PNGTuber Plus costumes. Existing saved avatars and imported costumes keep their backgrounds until recreated or reimported. * Avatar generation can be cancelled, freeing the avatar for a new generation request. * **Bug Fixes** * Generated and saved PNGTuber images better retain the original sprite’s transparent outline. * Transparent and animated sprites are preserved during background cleanup. <!-- 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:03 +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#7842
No description provided.