Communitygithub.com

sprite-stage

Builds original 2D sprite cartoons from character reference sheets and a reference video. Use when someone asks for a 2D cartoon, sprite film, character animation, OpenVoice preschool voices, or to set up Sprite Stage.

What is sprite-stage?

sprite-stage is a Claude Code agent skill that builds original 2D sprite cartoons from character reference sheets and a reference video. Use when someone asks for a 2D cartoon, sprite film, character animation, OpenVoice preschool voices, or to set up Sprite Stage.

Works with✓Claude Code✓Codex CLI✓Cursor✓Gemini CLI✓OpenCode
npx skills add https://github.com/rizwanaabbas/sprite-stage/tree/main/.cursor/skills/sprite-stage

Ask in your favorite AI

Open a new chat with this agent skill pre-loaded.

Documentation

Sprite Stage

One setup command. Then make an original 2D film from character sheets and a reference video.

First action

If .ready is missing, run this and wait for Sprite Stage is ready.

bash setup.sh

Do that yourself. Do not hand the person a list of packages to install. The script is safe to run again.

Picture replay uses system Python. New voices use the virtualenv the script creates.

python3 render.py
.venv/bin/python voices.py
python3 render.py

The finished sample is renders/long-slide.mp4.

What you keep original

A reference video supplies the premise only: the place, the order of actions, and the feeling. Write a new script in the user's own character names. Do not copy the source title, character names, logos, lyrics, or spoken lines into prompts, on-screen text, or the soundtrack.

Wardrobe and voice locks for the included cast are in characters/CAST.md. Prompt examples are in examples/prompts.md.

Make a new film

  1. Put each character's reference image in characters/. One person per file. Front view, full body, plain background.
  2. Generate sprite sheets into sprites/{name}-{action}.png. Actions used by the sample renderer: walk, front, talking, back, sitting. Sheets are four cells side by side on magenta (#FF00FF).

Free sprites

Default to a free image tool. That makes the sprite images $0. The agent-token table in COSTS.md still applies.

python3 scripts/free_sprites.py --provider prompt --name lina --action walk,front,back,talking,sitting

Each file in sprites/prompts/ names the two pictures to attach and the prompt to paste. Sample prompts are in examples/prompts.md. Save the tool's image as sprites/{name}-{action}.png.

Use Gemini only when GEMINI_API_KEY is already in the environment. Never ask for the key, never print it, and never write it into the repo.

python3 scripts/free_sprites.py --provider gemini --name lina --action walk

If that model is outside the key's free allowance, stop and use --provider prompt.

  1. Write original lines in voices.py, then .venv/bin/python voices.py. Pitch uses the file's real sample rate, then each line is slowed to about two words a second so the mouth can stay open for the whole line.
  2. Point render.py NAMES and HEIGHT at the cast. Build the timeline so only one person climbs and only one person slides. Call python3 render.py. Mouths open for duration + 0.2s. The slide cheer starts when the slide starts.

Sprite rules that keep clothes intact

  • Key only strong magenta: red > 200, green < 100, blue > 200. A loose chroma key punches holes in pink cloth.
  • Do not delete a connected region just because it is a face. Keep components of about 1800 pixels or more.
  • Walk cells share one timing: long stride, feet together, opposite stride, feet together.
  • Side view faces right. Mirror it in the renderer when the character walks left.
  • Sit the rider on the chute path and cover the legs with the near lip of the slide. Do not float the body above the chute.

Voices

OpenVoice V2 shifts tone. MeloTTS speaks the words with a British English base. Children are higher and a little quicker than the adult. Give each person a different target tone. Do not give the whole cast one pitch.

If a line is still shorter than its mouth window, lower the MeloTTS speed or stretch with atempo below 1. Do not speed a line up to fill a gap.

Cost and machine

A 1-minute film is about 300k–500k input tokens and 60k–100k output tokens when the sprites already exist, or about 1.0M–1.5M input and 200k–300k output when you also make sprites and revise once. Dollar figures for OpenCode, Claude, Codex, and Cursor, and the OpenVoice CPU requirements (8 GB RAM, Python 3.11–3.13, no GPU required), are in COSTS.md.

When the person wants the film to cost nothing, run this skill inside OpenCode on a model marked Free, and make the sheets with --provider prompt. That agent line is $0 while the film stays inside the daily free-model quota. A paid model on the same app bills that provider.

Credits

OpenVoice and MeloTTS are MIT software from MyShell. ffmpeg draws the frames. PyTorch runs the voice models. Checkpoints come from the public myshell-ai/OpenVoiceV2 model. Full links are in the README.

Related Skills