img2rig
Turn a single AI-generated illustration into a breathing, layered character
rig — fully agent-driven.
Mira, the bundled demo character: one txt2img illustration → 13 layers → idle / hit / stagger / enrage,
all procedural. Try it without installing anything GPU-side:
img2rig preview --spec examples/mira/mira.yaml, or interactively in the browser via
runtime/web/
One text prompt in; out comes a character that breathes, blinks, sways her
hair on spring physics, staggers when hit, and swings full-frame attack
keyframes — with zero manual rigging and zero manual mask painting. The
pipeline replaces both the rigger and the cleanup artist with an LLM agent
running a visual loop over local models (Stable Diffusion + GroundingDINO +
SAM), and the runtime is two dependency-free C++ headers.
prompt ──> [1] generate ──> [2] variants ──> [3] split ──> [4] cleanup ──> [5] export ──> [6] runtime
txt2img img2img DINO+SAM agent loop layer PNGs springs,
candidates states & text masks point tables, + rig.txt breath,
+ contact pose + PSD inpaint, QA blinks,
sheets keyframes sheets strikes
Why this exists
- Battle-grade 2D character rigging has no production-level automation —
mesh-deformation tools are manual by design. But most of what makes a
character feel alive on screen (timing, physical lag, impact) doesn't need
mesh warping: rigid layers + springs + full-frame pose keyframes cover it,
and that pipeline automates end to end.
- The "manual cleanup" in AI layer separation is really two jobs — the
clicker (interactive segmentation prompts) and the QA eye. Both are visual
judgment loops, and an agent with vision runs them: look at the probe →
edit the point table → rerun → look at the overlay. This repo is that loop,
made reproducible: all state in one YAML spec, all observations on disk as
images. See docs/agent-playbook.md.
Quickstart
Requirements: Python ≥ 3.10, a local
AUTOMATIC1111-compatible WebUI
with `-