camenduru / TostAI-Sprite-Sheet-Studio
git clone https://github.com/camenduru/TostAI-Sprite-Sheet-Studio.git
Turn a raw video into a game-ready sprite sheet
+0
stars, 24h Β· #37,117
+~0
stars, 7 days Β· #42,571
+77
stars, 30 days Β· #8,962
77
β
total
5
forks Β· 0 open issues
Star history (as recorded here)
LanguagePython
Licenseβ
Created2026-09-26 (26d ago)
Last push20d ago
Watchers1
OwnerUser
Links
README excerpt
π£ Please follow me for new updates: https://x.com/camenduru π₯ Please join our discord server: https://discord.gg/k5BwmmvJJU π₯³ Please become my sponsor: https://github.com/sponsors/camenduru π TostUI repo: https://github.com/camenduru/TostUI #### π Tost AI - Sprite Sheet Studio https://github.com/user-attachments/assets/7aec9682-719a-45fd-842c-abe9877205ea Two tools in one server: 1. **Generator** β turn a raw video into a game-ready sprite sheet: **VRMBG-3.0 video matting (or an optional mask video) β optional backdrop repair β tight auto-crop β packed grid sheet + sidecar JSON + preview player + GIF**, with an invariant gate that checks the result instead of trusting it. 2. **Editor** β open any existing sheet (from a run, from `walk/`, from `sprites/`, or any PNG + sidecar) and fix it: align the pivot, repair the matte, key out a colour, repaint, re-grid, re-time, re-export. ## Run it [code] - **http://127.0.0.1:8765** β the generator - **http://127.0.0.1:8765/editor** β the editor Options: `--host`, `--port`. Requires the Python that has the ML stack (`torch`, `cv2`, `transformers`, `PIL`, `numpy`, `fastapi`, `uvicorn`) β on this machine that is the 3.13.9 install above, not the sandboxed runtime. `ffmpeg` is optional and only used by the helper scripts. ### Docker The image is self-contained: it carries the model and the three pixel ops. 1. **Install Docker**\ Download Docker Desktop (Windows AMD64) and run it. 2. **Update the container (optional)** [code] 3. **Run the container** [code] *Requires NVIDIA GPU (Min 4GB VRAM)* 4. **Open app**\ Go to: http://localhost:8765 (generator) or http://localhost:8765/editor (editor) **Build.** The one token arrives as a **secret mount sourced from env var** β never `--build-arg`, because a build-arg token is visible in `docker history --no-trunc`. It lives in `.env`: [code] - `HF_TOKEN` β the VRMBG-3.0 repo is gated; the model download 401s without it. - `CACHEBUST` β the app clone is deliberately unpinned (always latest source), and a cached `git clone` silently re-serves the first snapshot. Bumping this forces a re-clone. **Omit it and you get stale code with no warning.** The commit that landed is written to `.sprite_rev` inside the image. **Run:** [code] - `--gpus all` is **not optional** β without it `torch.cuda.is_available()` is `False` and matting falls back to CPU. - **http://127.0.0.1:8765** β the generator - **http://127.0.0.1:8765/editor** β the editor **Check it actually came up.** The healthcheck probes the app: A from-scratch rebuild (`--no-cache`) re-downloads ~7.4 GB, including the 845 MB model. ## The workflow 1. **Input** β type a path, use *Browseβ¦*, or drag a file onto the drop zone (uploads land in `uploads/`). *Read video* shows frame count, fps, size, a **playable preview of the clip**, and the valid column counts. 2. **Background removal** β VRMBG-3.0, autoregressive along time. Pick the inference size, a frame range and a step. - **β¦or a mask video