mirror of
https://github.com/Pasta-Devs/Marinara-Engine.git
synced 2026-12-03 19:00:50 +07:00
[GH-ISSUE #1155] Bundle AI sprite background cleanup runtime/dependencies #574
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#574
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 @ghost on GitHub (May 24, 2026).
Original GitHub issue: https://github.com/Pasta-Devs/Marinara-Engine/issues/1155
Migrated from Pasta-Devs/Marinara-Engine-Refactor#24: https://github.com/Pasta-Devs/Marinara-Engine-Refactor/issues/24
Original author: @Xelvanis
Original created: 05/20/2026 05:23:53
Original updated: 05/24/2026 18:59:16
Original assignees: None
Original state: OPEN
Context
A dev wants to look at bundling the optional AI sprite background cleanup dependencies into the app/install package by default, instead of requiring users to already have
backgroundremoveravailable on their machine.Current
mainbehavior does not install Python, pip packages, orbackgroundremover. It only checks for an already-available background remover command/runtime and falls back to built-in matte cleanup when optional AI cleanup is unavailable.Current behavior on
mainRelevant current-code anchors from
main:Cleanup first tries optional
backgroundremover, then falls back to built-in cleanup unless AI cleanup was explicitly required:github.com/Pasta-Devs/Marinara-Engine-Refactor@9ca5d9e7d3/src-tauri/src/commands/storage/sprites.rs (L906-L925)Runtime discovery checks env vars, a local
.venv, thenPATH:github.com/Pasta-Devs/Marinara-Engine-Refactor@9ca5d9e7d3/src-tauri/src/commands/storage/sprites.rs (L1564-L1685)The user-facing unavailable message currently comes from the Rust status payload:
github.com/Pasta-Devs/Marinara-Engine-Refactor@9ca5d9e7d3/src-tauri/src/commands/storage/sprites.rs (L1664-L1685)The actual CLI call writes a temp input/output image and configures model paths under the app data background-remover runtime dir:
github.com/Pasta-Devs/Marinara-Engine-Refactor@9ca5d9e7d3/src-tauri/src/commands/storage/sprites.rs (L1723-L1786)Tauri cleanup command entry point:
github.com/Pasta-Devs/Marinara-Engine-Refactor@9ca5d9e7d3/src-tauri/src/commands/storage/commands/media.rs (L33-L36)Frontend API wrapper for sprite cleanup:
github.com/Pasta-Devs/Marinara-Engine-Refactor@9ca5d9e7d3/src/shared/api/image-generation-api.ts (L4-L10)Generated sprite modal applies cleanup through
spriteApi.cleanupand currently forcesengine: "builtin"from this path:github.com/Pasta-Devs/Marinara-Engine-Refactor@9ca5d9e7d3/src/shared/components/ui/SpriteGenerationModal.tsx (L980-L1008)Generated sprite modal cleanup UI/message area:
github.com/Pasta-Devs/Marinara-Engine-Refactor@9ca5d9e7d3/src/shared/components/ui/SpriteGenerationModal.tsx (L1890-L1926)Saved sprite cleanup in the character editor also currently forces
engine: "builtin":github.com/Pasta-Devs/Marinara-Engine-Refactor@9ca5d9e7d3/src/features/characters/components/CharacterEditor.tsx (L2287-L2305)Possible implementation directions
backgroundremoverexecutable/runtime with the app and update discovery to prefer the bundled command before checking env vars/local app data/PATH.Acceptance criteria
Original comments
@cha1latte on 05/24/2026 18:59:16
Taking this one.
Source: https://github.com/Pasta-Devs/Marinara-Engine-Refactor/issues/24#issuecomment-4529679325
@cha1latte commented on GitHub (May 24, 2026):
Status update:
Phase 1 is already shipped on the
refactorbranch via #1172. That PR added the runtime discovery/status plumbing: Marinara now checks packagedresources/background-remover/...runtimes before env vars, app-data.venv, or PATH, and sprite cleanup UI paths requestengine: "auto"so a bundled/app-managed runtime can be used when one exists.This issue is not fully complete yet because #1172 did not bundle the actual third-party runtime, Python environment, dependencies, or model payload. That remaining work is being tracked separately in #1175 as the Phase 2 architecture/release decision.
Phase 2 needs a maintainer decision before implementation: app-managed first-run download vs fully bundled installer runtime, including hosting, checksums/signatures, supported platforms, model files, update/removal behavior, license/security review, and installer size.
So the current split is:
@ghost commented on GitHub (May 25, 2026):
ohh hmmm, this one is tricky. We can't have local sidecars or anything on mobile at all since its a packaged app. There are alternatives, but we'll need to figure out feature gating first, where we can disable certain things both on the UI and the backend depending on what platform we are on. I would personally wait for this and figure that out first (which I can tackle this week, but its a tricky one)
@cha1latte commented on GitHub (May 25, 2026):
@munimunigamer (From my AI):
I'd suggest we make the next step a small platform capability manifest rather than solving AI cleanup directly. The server should expose a typed capability/status payload for local-process/runtime features, and the frontend should use that to hide or disable unsupported controls. The backend still enforces the same gates.
Initial capabilities could be:
That gives mobile packaged builds a clean way to say "unsupported here" while desktop/source installs can still report "available", "missing dependency", "disabled by config", or "requires admin". Once that contract exists, #1175 can choose the actual AI cleanup distribution path without guessing how mobile/desktop gating should work.
@cha1latte commented on GitHub (May 25, 2026):
Triage note: labeling this as
scope-riskbecause bundled AI sprite cleanup is aligned, but runtime packaging touches platform support, installer size, mobile gating, downloads, checksums, model files, and license/security review.The least risky next step is to keep this as the umbrella and let #1175 drive the distribution decision before more packaging work starts.