[PR #4228] [MERGED] Improve matched full-body sprite generation #6293

Closed
opened 2026-10-23 04:09:01 +07:00 by bsakaguchi · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/Pasta-Devs/Marinara-Engine/pull/4228
Author: @SpicyMarinara
Created: 7/28/2026
Status: ✅ Merged
Merged: 7/28/2026
Merged by: @SpicyMarinara

Base: staging ← Head: fix/full-body-sprite-generation


📝 Commits (1)

  • 7437fac Improve matched full-body sprite generation

📊 Changes

9 files changed (+946 additions, -74 deletions)

View changed files

📝 e2e/core-flows.e2e.ts (+145 -0)
📝 packages/client/src/components/characters/CharacterEditor.tsx (+2 -4)
📝 packages/client/src/components/personas/PersonaEditor.tsx (+2 -4)
📝 packages/client/src/components/ui/SpriteGenerationModal.tsx (+221 -36)
📝 packages/client/src/localization/locales/en.json (+14 -4)
📝 packages/server/src/routes/sprites.routes.ts (+297 -18)
📝 packages/server/src/services/image/sprite-background.service.ts (+173 -6)
📝 packages/server/src/services/prompt-overrides/registry/sprites.ts (+3 -1)
📝 scripts/regressions/sprite-background.regression.ts (+89 -1)

📄 Description

Linked issue

Closes #4227

Why this change

Full-body sprite batches could begin without establishing a canonical neutral design, so later expressions drifted in clothing and proportions. Existing expression portraits were not paired with their full-body counterparts, the image contract still allowed waist-up framing, and GPT Image 2 background cleanup could preserve white or green fringe pixels around otherwise transparent sprites.

What changed

  • Generate a neutral full-body sprite first and require explicit approval or regeneration before continuing.
  • Reuse the approved neutral as the body-design reference for every remaining expression.
  • Pair matching saved portrait expressions with their full-body generation requests.
  • Generate full-body expressions individually at a portrait canvas size with strict head-to-toe framing constraints.
  • Use an explicit adaptive chroma contract for GPT Image 2 and strengthen matte cleanup, decontamination, enclosed-region handling, and final hue sanitation.
  • Add localized approval UI plus E2E and sprite-background regression coverage.

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 completed during implementation:

  • pnpm check
  • pnpm regression:sprites
  • Targeted Playwright coverage for matched full-body sprite generation

pnpm check completed with the existing NoodleHome.tsx exhaustive-deps warning and no errors.

Manual verification notes

Maintainer manually tested the GPT Image 2 full-body workflow in Firefox on macOS through multiple cleanup iterations. The final result was confirmed to have correct framing, neutral approval/reference behavior, and clean transparent edges without visible chroma fringe.

Docs and release impact

  • No docs changes needed
  • Updated docs (README / CONTRIBUTING / android/README / CHANGELOG) as needed
  • Translated docs on the docs-i18n branch updated to match, or a [docs-i18n] <paths> follow-up issue opened (see CONTRIBUTING.md § Translated documentation)
  • Version/release files updated (only if this PR includes a version bump)

No user-facing documentation or release metadata changes are required.

UI evidence (if applicable)

Maintainer-provided screenshots were used during manual iteration to verify removal of white and green edge artifacts.


🔄 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/4228 **Author:** [@SpicyMarinara](https://github.com/SpicyMarinara) **Created:** 7/28/2026 **Status:** ✅ Merged **Merged:** 7/28/2026 **Merged by:** [@SpicyMarinara](https://github.com/SpicyMarinara) **Base:** `staging` ← **Head:** `fix/full-body-sprite-generation` --- ### 📝 Commits (1) - [`7437fac`](https://github.com/Pasta-Devs/Marinara-Engine/commit/7437facff85a86e549cccc7454ea85d6d88756fd) Improve matched full-body sprite generation ### 📊 Changes **9 files changed** (+946 additions, -74 deletions) <details> <summary>View changed files</summary> 📝 `e2e/core-flows.e2e.ts` (+145 -0) 📝 `packages/client/src/components/characters/CharacterEditor.tsx` (+2 -4) 📝 `packages/client/src/components/personas/PersonaEditor.tsx` (+2 -4) 📝 `packages/client/src/components/ui/SpriteGenerationModal.tsx` (+221 -36) 📝 `packages/client/src/localization/locales/en.json` (+14 -4) 📝 `packages/server/src/routes/sprites.routes.ts` (+297 -18) 📝 `packages/server/src/services/image/sprite-background.service.ts` (+173 -6) 📝 `packages/server/src/services/prompt-overrides/registry/sprites.ts` (+3 -1) 📝 `scripts/regressions/sprite-background.regression.ts` (+89 -1) </details> ### 📄 Description ## Linked issue Closes #4227 ## Why this change Full-body sprite batches could begin without establishing a canonical neutral design, so later expressions drifted in clothing and proportions. Existing expression portraits were not paired with their full-body counterparts, the image contract still allowed waist-up framing, and GPT Image 2 background cleanup could preserve white or green fringe pixels around otherwise transparent sprites. ## What changed - Generate a neutral full-body sprite first and require explicit approval or regeneration before continuing. - Reuse the approved neutral as the body-design reference for every remaining expression. - Pair matching saved portrait expressions with their full-body generation requests. - Generate full-body expressions individually at a portrait canvas size with strict head-to-toe framing constraints. - Use an explicit adaptive chroma contract for GPT Image 2 and strengthen matte cleanup, decontamination, enclosed-region handling, and final hue sanitation. - Add localized approval UI plus E2E and sprite-background regression coverage. ## 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 completed during implementation: - `pnpm check` - `pnpm regression:sprites` - Targeted Playwright coverage for matched full-body sprite generation `pnpm check` completed with the existing `NoodleHome.tsx` exhaustive-deps warning and no errors. ### Manual verification notes Maintainer manually tested the GPT Image 2 full-body workflow in Firefox on macOS through multiple cleanup iterations. The final result was confirmed to have correct framing, neutral approval/reference behavior, and clean transparent edges without visible chroma fringe. ## Docs and release impact - [ ] No docs changes needed - [ ] Updated docs (README / CONTRIBUTING / android/README / CHANGELOG) as needed - [ ] Translated docs on the `docs-i18n` branch updated to match, or a `[docs-i18n] <paths>` follow-up issue opened (see CONTRIBUTING.md § Translated documentation) - [ ] Version/release files updated (only if this PR includes a version bump) No user-facing documentation or release metadata changes are required. ## UI evidence (if applicable) Maintainer-provided screenshots were used during manual iteration to verify removal of white and green edge artifacts. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
bsakaguchi 2026-10-23 04:09:01 +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#6293
No description provided.