# FrameBaker **Repository Path**: chong00li/FrameBaker ## Basic Information - **Project Name**: FrameBaker - **Description**: No description available - **Primary Language**: Unknown - **License**: MIT - **Default Branch**: main - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 0 - **Forks**: 0 - **Created**: 2026-08-25 - **Last Updated**: 2026-08-25 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README # FrameBaker **Pixel-art frame-by-frame animation editor — a Bun full-stack app.** Import sprites from anywhere (GIF/MP4 frame extraction, PNG upload, external CLI generation), cut out backgrounds with the built-in rembg matting engine, review results in the materials library, then edit frames on a PixiJS onion-skin canvas, arrange the timeline, preview playback, and export a spritesheet. > ✅ **Multi-axis / multi-track MVP:** animation variants, compositing tracks, shared steps, composite preview and export are available — along with skeletal binding, on-character motion editing, and freeform part warping. ![Bun](https://img.shields.io/badge/Bun-1.3-14151A?logo=bun) ![Elysia](https://img.shields.io/badge/Elysia-1.4-6f61c0) ![React](https://img.shields.io/badge/React-19-149eca?logo=react&logoColor=white) ![Core unit coverage](https://img.shields.io/badge/core%20unit%20coverage-100%25-brightgreen) ![License](https://img.shields.io/badge/License-MIT-green) **English** | [中文](README.zh-CN.md) ![Playback preview demo](docs/media/demo.gif) ### Skeletal Motion Workflow Assemble a character from parts, then edit motions directly on the bound character: drag bones or part control-point grids on the canvas, keyframe translation/rotation/scale/bend/warp per track, and preview the result live on the project board. | Motion workspace & live preview | On-character motion editor | | --- | --- | | ![Skeletal motion workspace with live preview](docs/media/skeletal-action-workspace.png) | ![Editing a motion on the bound character](docs/media/skeletal-action-editor.png) | ![Per-bone and per-part keyframe tracks on the motion timeline](docs/media/skeletal-action-timeline.png) ### Skeletal Parts Workflow Generate and matte a reference-locked character parts sheet, then refine its grid with per-cell movement, direct divider resizing, merge/split controls, quality checks, and per-cell erase editing before creating skeletal materials. | Character parts material | Interactive parts-grid editor | | --- | --- | | ![Generated and matted character parts material](docs/media/skeletal-parts-preview.png) | ![Interactive skeletal parts-grid editor](docs/media/skeletal-grid-editor.png) | | Frame editor | Materials library | | --- | --- | | ![Frame editor](docs/media/editor.png) | ![Materials library](docs/media/library.png) | | Playback preview | Dark theme (Magnetic Night) | | --- | --- | | ![Playback preview](docs/media/preview.png) | ![Dark theme](docs/media/library-dark.png) | | Video material (custom pixel-style player) | Frame extract editor (VIDEO CUT LAB) | | --- | --- | | ![Video material detail](docs/media/video-material.png) | ![Frame extract editor](docs/media/video-cut-lab.png) | ## Scene Layering Demo Scene layering reconstructs a flat image as independently editable, hideable, and movable RGBA layers. The demo material below was generated inside FrameBaker with `wan2.7-image`, then actually decomposed by the standalone `Qwen-Image-Layered` configuration using **4 layers / 50 steps / CFG 4**. | Generated flat scene | Scene-layer result | | --- | --- | | ![Generated moonlit alchemist scene](docs/media/scene-layering-source.png) | ![Background, props, ground, and whole-character layers](docs/media/scene-layering-layers.png) | - **L1 background:** sky and castle; **L2 props:** crystals, potion, and chest; **L3 ground:** grass platform; **L4 subject:** the complete alchemist character and moon. - This is semantic layer reconstruction, not strict pixel-label segmentation: the model may group the moon with the character or spread similar objects across layers, but every output remains independently compositable and editable. - **Scene layering does not promise head, torso, arm, or leg parts.** Character rig decomposition requires a separate mask/segmentation workflow and must not be represented by these outputs. - Full scenes skip pre-matting by default to preserve background and depth context. Enable background removal only when recursively refining an already isolated foreground. **The original scene and all four layer outputs as they appear in the materials library:** ![Scene-layer outputs in the FrameBaker materials library](docs/media/scene-layering-library.png) ## Features - **Multi-source import** — GIF / MP4 frame extraction via ffmpeg (adjustable fps), multi-select PNG upload, external generator CLI (`FRAMEBAKER_GEN_CLI`) - **Video materials & frame extract editor** — generated/uploaded videos get a custom pixel-style player (checkerboard backdrop, click-to-play, themed scrubber); the "VIDEO CUT LAB" editor scrubs to an exact frame and marks it, or fills a time range at a target fps, then extracts up to 64 frames as image materials in one batch (optionally matted on the way out) - **Built-in matting** — rembg works out of the box (u2net by default, custom models supported); custom CLI template optional; before/after compare slider to review cutouts - **Scene layering** — standalone Qwen-Image-Layered configuration decomposes flat art into RGBA background, whole-subject, prop, and foreground layers; recursive refinement is supported without pretending to produce character body parts - **Materials library** — a first-class staging area: generate or upload, matte, compare, then import into any project — single or batch - **Frame editor** — PixiJS v8 canvas with onion skin, grid, viewport zoom, draggable offsets, scale / rotation / opacity controls, crop-and-replace, per-frame duration, and keyframes - **Timeline & batch ops** — drag to reorder, Cmd/Ctrl+Click and Shift+Click multi-select, batch delete / duplicate / set duration - **Humanoid motion rig** — choose a CC0 Quaternius Universal Animation Library action sampled at 8–16 frames and get immediate playback, tune motion range / arm swing / leg stride / body bounce / lean across the entire clip, then optionally fine-tune individual FK joints before pose-sheet export - **Spritesheet export** — pure client-side canvas packing with frame transforms baked into aligned cells → `*.spritesheet.png` + `*.json` - **Cassette Futurism themes** — dark "Magnetic Night" / light "Beige Terminal"; follows system preference until you pick one (tri-state toggle) - **Live sync** — WebSocket broadcasts for job progress and frame/material changes - **Adjustable layout** — drag the split dividers to resize the frame list and timeline (persisted) - **MCP server** — built-in [Model Context Protocol](https://modelcontextprotocol.io) endpoint (`POST /mcp`, Streamable HTTP) exposing 48 tools for AI assistants (Claude Desktop, Cursor, Windsurf) to manage projects, frames, materials, generation, matting, jobs, and settings programmatically ## System Requirements - **Windows 10/11, macOS, or Linux** — Windows has been verified on real hardware for server startup, frontend serving, APIs, SQLite storage, and ffmpeg detection - **Bun 1.3+** — required; reopen your terminal after installation and verify that `bun --version` works - **ffmpeg** — only required for GIF/MP4 frame extraction; PNG imports and editing do not need it - **uv (recommended) or Python 3** — only needed for the bundled matting engine; uv can download an isolated Python without a system Python installation - A modern browser with WebGL (PixiJS v8 canvas) ### Windows prerequisites (PowerShell) ```powershell # 1. Install Bun (or see https://bun.sh/docs/installation) powershell -c "irm bun.sh/install.ps1 | iex" # 2. Install ffmpeg when GIF/MP4 extraction is needed winget install ffmpeg # 3. Install uv when matting is needed (or install Python from python.org and add it to PATH) powershell -ExecutionPolicy ByPass -c "irm https://astral.sh/uv/install.ps1 | iex" # Reopen PowerShell after installation, then verify: bun --version ffmpeg -version uv --version ``` > `setup_matting.ps1` prefers uv and creates an isolated Python 3.12 environment; it falls back to Python from `PATH` when uv is unavailable. The Microsoft Store `python.exe` app execution alias is not a Python installation. ## Quick Start ```bash bun install bun dev # dev mode (--hot) → http://localhost:3000 # or bun start # production ``` - ffmpeg is required for frame extraction: `brew install ffmpeg` (macOS) / `winget install ffmpeg` (Windows) - **Matting engine** (optional; install once per new environment): ```bash ./scripts/setup_matting.sh # macOS / Linux (CPU, default) ./scripts/setup_matting.sh --gpu # macOS / Linux (NVIDIA GPU via onnxruntime-gpu) # Windows (PowerShell): powershell -ExecutionPolicy Bypass -File scripts\setup_matting.ps1 # CPU powershell -ExecutionPolicy Bypass -File scripts\setup_matting.ps1 -Gpu # GPU ``` Creates `.venv-matting/` and installs `rembg[cli,cpu]` (or `rembg[cli,gpu]`); on Windows it prefers uv-managed Python 3.12. The u2net model downloads automatically to `storage/models` on first use. Skipping this leaves matting in passthrough mode (copies the original image with a warning). **GPU mode** requires an NVIDIA GPU and a matching CUDA Toolkit installation. `onnxruntime-gpu` version must align with your CUDA version (e.g. onnxruntime-gpu 1.16 ↔ CUDA 11.8, 1.17+ ↔ CUDA 12.x). If you get DLL load errors, verify CUDA is installed and the version matches. To switch between CPU and GPU, delete `.venv-matting/` and re-run the script with the other flag. - Type check: `bun run typecheck` - Unit tests: `bun run test` - Core unit-test coverage report: `bun run test:coverage` (currently covers shared rules, frame geometry, and ZIP export) ### Windows Notes & Gotchas The project runs on Windows but there are several platform-specific things to be aware of: 1. **`bun dev` uses `--watch`, not `--hot`** — Bun 1.3 on Windows has a bug where browser HMR reorders PixiJS 8's circular-dependency initialization, causing a blank canvas. The dev script therefore uses `--watch` (server auto-restart on file changes, but no frontend HMR). **You must manually refresh the browser** after editing frontend code. macOS/Linux keep full HMR. 2. **PixiJS is loaded from CDN, not from the npm package** — `apps/web/index.html` includes a `