Sprite Gen skill

Generates images and game sprites through GPT or Grok with guided provider choices, separate saved defaults, automatic cleanup and optional curation.

by aldegad·Apache-2.0 license·★ 2,365 Stars on the repo·GitHub ↗

Use now

Files of Sprite Gen

aldegad/main1 file
SKILL.md
Show the full text127 lines

Sprite Gen

Generation entry points: make sprites, make an image, or animate a still into a video. Existing generation, extraction and export tools do the work; the user chooses the result and provider. For repeat a background, project a shadow, inspect motion or compose a scene, use the independent routes below directly with existing assets.

Start every generation request here

For a standalone video clip, read video and use sprite-gen video. This route works from any agent engine and delivers a verified MP4 plus report. For sprites or ordinary images, use the guides below.

Read user-workflow, then run the appropriate read-only guide:

$SPRITE_GEN_ROOT/.venv/bin/sprite-gen workflow --kind sprite
$SPRITE_GEN_ROOT/.venv/bin/sprite-gen workflow --kind image

Pass choices already stated in the request. The guide checks access, combines explicit choices with saved defaults, and returns only missing questions. Follow its start and finish stages. Always pass the resolved provider explicitly to generation tools. Deliver checked files before offering the curation view; save defaults only when the user agrees. The complete conversation and settings contract is owned by the linked document, not duplicated in individual pipeline docs.

Side-view facing

Keep the side still, canvas placement and motion prompt facing the same direction. video-set observes each side input once before canvas placement and uses the requested --facing for both the canvas and clip prompt. Observation is record-only by default; it never changes the requested direction. Image correction requires explicit opt-in.

Command option Values and default Behavior
gen --facing preserve (default), right, left With --ref, an explicit direction adds a prompt requirement and checks the generated still.
gen --facing-fix none (default), mirror, regen Record without correction; opt into mirroring an observed opposite or regenerating once and rechecking. A still-opposite regeneration is mirrored.
video --direction side, front, back, front_diagonal, back_diagonal; unset by default side opts into facing inspection and a matching prompt requirement; the others skip it. The two diagonals are three-quarter views turned right (VIEW_TEXT); a walk or run in one is filmed pinned (pins_last_frame).
video --facing, video-set --facing right (default), left Required side direction.
video --facing-fix, video-set --facing-fix none (default), mirror Record the observation; opt into mirroring an observed opposite in a copy. Batch side inspection is enabled by default.

Direction is requested through the generation and motion prompts, which cannot guarantee model compliance. The detector can be wrong even at high confidence: review the still before choosing mirror or regen. Generation reports record direction, model, requested direction, model-reported confidence and correction under extra.facing; video reports and batch items use facing. final_direction is an observation or a value derived from it, not independent verification; final_direction_source identifies which. An uncertain or failed inspection records unknown and its reason and continues without correction; front-facing observations also remain unchanged. Mirroring does not preserve left/right accessory handedness.

Execution routes

Task Entry Contract
GPT image sprites prepare, gen-set --provider codex, extract, compose and QA atlas-workflow
Standalone video / animate a still, pin a last frame, reference images video (--image, --last-frame, --reference) video
Continue or edit an existing clip video-extend, video-edit video
Grok video sprites video-set video-pipeline
Ordinary image or edit gen --provider codex or gen --provider grok (subscription routes) gen
Image generation with no login available (server, container, SaaS) gen --provider openai — server/SaaS route on OPENAI_API_KEY, billed per call, never a default or a fallback gen
Base and direction anchors anchor directional-anchor-workflow
Curation view or existing image candidates curation, unpack-atlas --pngs-dir curation
Uniform background removal or imported sheets cutout, slice-sheet sheet-slicing
Palette swap sprite-gen recolor-palette, sprite-gen recolor recolor
Rig layer composition sprite-gen compose-layers layer-tracks
Idle breathing curation choice, baked by compose breathing
Engine exports export-aseprite, export-pngs engine-export
Background recipe or repeating tile existing gen / cutout, then optional background-tile asset-tools
Standalone projected shadow shadow asset-tools
Duplicate poses, foot contact and stride measurement inspect-motion asset-tools
Optional scene placement, lighting, camera and render scene-render, scene-inspect scene
Defaults defaults show, defaults save, defaults clear user-workflow

Use existing automatic pipeline stages for background removal, extraction, alignment and export. Do not ask users to select each script. For a direct utility request, run that utility; no unrelated generation questions are needed. Preserve the row pipeline and component extraction for image sprites. One-shot grid generation and fixed cell cutting are not an alternative sprite-generation route.

For attack repeat coverage, observed one-shot returns and structured loop failure reports, follow video-pipeline.

Scene creation consumes finished assets and remains optional. Asset metadata owns frames, native durations and anchors; scene specs own placement, scale, playback rate, planes, camera and light. Measure stride only with declared same-foot contact and an isolated foot ROI; unknown contact stays unverified. Apply only a verified report for the exact selected asset with an explicit scene direction. Never infer walking direction from the bottommost silhouette, reverse frames or change source assets to make a scene work.

실행 인터프리터

SPRITE_GEN_ROOT is the absolute installed repository path. Use $SPRITE_GEN_ROOT/.venv/bin/sprite-gen or $SPRITE_GEN_ROOT/.venv/bin/python; do not assume an activated shell. 폴백 금지: create a missing venv or report the failure, never use an arbitrary global Python. NumPy 가 없는 인터프리터 fails at package import. Setup and diagnosis: interpreter.

RIFE for walk and run loops

video-loop repairs a walk's or run's jump frames and video-set gives a direction set one cycle length, both with RIFE in-betweens. Install it once per machine: $SPRITE_GEN_ROOT/.venv/bin/sprite-gen rife install (pinned rife-ncnn-vulkan 20221029 and model rife-v4.6, SHA-256 checked, into the user data directory, ending with a check frame; Linux without a GPU first needs libvulkan1 mesa-vulkan-drivers). Without it every loop is still cut, as filmed, and says so: a warning: line on stderr, jump_repair.applied: false in the loop report, cycle_align.<state>.applied: false and warnings in set.report.json. When that happens, tell the user which loops went unrepaired and offer the install; after it, cut those loops again and run video-cycle-align. video-loop --repair on and video-cycle-align fail without RIFE instead. loop-repair.

Contracts and advanced tools

run-contract owns numeric requests, run layout, atomic publication and curated exports. architecture explains domain ownership. docs index lists every specialized feature and QA procedure. sprite-gen --help derives the command map from the package catalog. Never replace canonical extraction with temporary crop scripts while presenting the result as a pipeline output.

1---
2name: sprite-gen
3version: 2.20.0
4description: "Generates images and game sprites through GPT or Grok with guided provider choices, separate saved defaults, automatic cleanup and optional curation. Handles sprite requests, ordinary image generation/editing, standalone image-to-video clips (i2v, animate this still, 그록 영상, 이매진 비디오, 스틸 움직여줘, first/last frame, reference-to-video, 영상 이어붙이기, 영상 편집, extend/edit a clip), chroma removal, animation atlases, video loops, 큐레이션뷰, image candidates, 팔레트 스왑, palette swap, recolor, rig layers, engine exports, repeating backgrounds, projected shadows, motion/contact inspection and optional scene composition from existing assets."
5license: Apache-2.0
6depends_on:
7 required_bins:
8 - name: codex
9 why: "gen --provider codex (image_gen via ChatGPT OAuth)"
10 - name: ffmpeg
11 why: "video-frames (clip -> frames) and video-set"
12 - name: img2webp
13 why: "video-loop WebP with exact alpha (libwebp); Pillow's animated writer drops -exact"
14 - name: rife-ncnn-vulkan
15 why: "video-loop jump repair and video-cycle-align (RIFE v4.6 in-betweens, release 20221029). Install once with `sprite-gen rife install` (sha256-checked, into the user data directory); SPRITE_GEN_RIFE or PATH override it; Linux without a GPU also needs libvulkan1 mesa-vulkan-drivers. Without it, walk and run loops are cut as filmed with a warning"
16 required_scripts:
17 - scripts/prepare_sprite_run.py
18 - scripts/generate_sprite_image.py
19 - scripts/gen_set.py
20 - scripts/generate_sprite_video.py
21 - scripts/video_canvas.py
22 - scripts/video_frames.py
23 - scripts/video_loop.py
24 - scripts/video_set.py
25 - scripts/extract_sprite_row_frames.py
26 - scripts/interpolate_frames.py
27 - scripts/compose_sprite_atlas.py
28 - scripts/preview_animation.py
29 - scripts/compose_selected_cycle.py
30 - scripts/compose_sprite_gif.py
31 - scripts/inspect_sprite_run.py
32 - scripts/score_sprite_run.py
33 - scripts/run_correction_loop.py
34 - scripts/curation.py
35 - scripts/serve_curation.py
36 - scripts/slice_sheet_cells.py
37 - scripts/unpack_atlas_run.py
38 - scripts/export_curated_pngs.py
39 - scripts/recolor.py
40 - scripts/compose_layers.py
41modes:
42 default: component-row
43---
44 
45# Sprite Gen
46 
47Generation entry points: **make sprites**, **make an image**, or **animate a still into a video**. Existing generation, extraction and export tools do the work; the user chooses the result and provider. For **repeat a background**, **project a shadow**, **inspect motion** or **compose a scene**, use the independent routes below directly with existing assets.
48 
49## Start every generation request here
50 
51For a standalone video clip, read [video](docs/video.md) and use `sprite-gen video`.
52This route works from any agent engine and delivers a verified MP4 plus report.
53For sprites or ordinary images, use the guides below.
54 
55Read [user-workflow](docs/user-workflow.md), then run the appropriate read-only guide:
56 
57```bash
58$SPRITE_GEN_ROOT/.venv/bin/sprite-gen workflow --kind sprite
59$SPRITE_GEN_ROOT/.venv/bin/sprite-gen workflow --kind image
60```
61 
62Pass choices already stated in the request. The guide checks access, combines explicit choices with saved defaults, and returns only missing questions. Follow its start and finish stages. Always pass the resolved provider explicitly to generation tools. Deliver checked files before offering the curation view; save defaults only when the user agrees. The complete conversation and settings contract is owned by the linked document, not duplicated in individual pipeline docs.
63 
64## Side-view facing
65 
66Keep the side still, canvas placement and motion prompt facing the same direction.
67`video-set` observes each side input once before canvas placement and uses the requested
68`--facing` for both the canvas and clip prompt. Observation is record-only by default;
69it never changes the requested direction. Image correction requires explicit opt-in.
70 
71| Command option | Values and default | Behavior |
72|---|---|---|
73| `gen --facing` | `preserve` (default), `right`, `left` | With `--ref`, an explicit direction adds a prompt requirement and checks the generated still. |
74| `gen --facing-fix` | `none` (default), `mirror`, `regen` | Record without correction; opt into mirroring an observed opposite or regenerating once and rechecking. A still-opposite regeneration is mirrored. |
75| `video --direction` | `side`, `front`, `back`, `front_diagonal`, `back_diagonal`; unset by default | `side` opts into facing inspection and a matching prompt requirement; the others skip it. The two diagonals are three-quarter views turned right (`VIEW_TEXT`); a walk or run in one is filmed pinned (`pins_last_frame`). |
76| `video --facing`, `video-set --facing` | `right` (default), `left` | Required side direction. |
77| `video --facing-fix`, `video-set --facing-fix` | `none` (default), `mirror` | Record the observation; opt into mirroring an observed opposite in a copy. Batch side inspection is enabled by default. |
78 
79Direction is requested through the generation and motion prompts, which cannot guarantee model compliance.
80The detector can be wrong even at high confidence: review the still before choosing `mirror` or `regen`.
81Generation reports record direction, model, requested direction, model-reported confidence and correction
82under `extra.facing`; video reports and batch items use `facing`. `final_direction` is an observation
83or a value derived from it, not independent verification; `final_direction_source` identifies which.
84An uncertain or failed inspection records `unknown` and its reason and continues without correction;
85front-facing observations also remain unchanged. Mirroring does not preserve left/right accessory handedness.
86 
87## Execution routes
88 
89| Task | Entry | Contract |
90|---|---|---|
91| GPT image sprites | `prepare`, `gen-set --provider codex`, `extract`, compose and QA | [atlas-workflow](docs/atlas-workflow.md) |
92| Standalone video / animate a still, pin a last frame, reference images | `video` (`--image`, `--last-frame`, `--reference`) | [video](docs/video.md) |
93| Continue or edit an existing clip | `video-extend`, `video-edit` | [video](docs/video.md) |
94| Grok video sprites | `video-set` | [video-pipeline](docs/video-pipeline.md) |
95| Ordinary image or edit | `gen --provider codex` or `gen --provider grok` (subscription routes) | [gen](docs/gen.md) |
96| Image generation with no login available (server, container, SaaS) | `gen --provider openai` — server/SaaS route on `OPENAI_API_KEY`, **billed per call**, never a default or a fallback | [gen](docs/gen.md#subscription-first--openai-is-named-or-it-does-not-run) |
97| Base and direction anchors | `anchor` | [directional-anchor-workflow](docs/directional-anchor-workflow.md) |
98| Curation view or existing image candidates | `curation`, `unpack-atlas --pngs-dir` | [curation](docs/curation.md) |
99| Uniform background removal or imported sheets | `cutout`, `slice-sheet` | [sheet-slicing](docs/sheet-slicing.md) |
100| Palette swap | `sprite-gen recolor-palette`, `sprite-gen recolor` | [recolor](docs/recolor.md) |
101| Rig layer composition | `sprite-gen compose-layers` | [layer-tracks](docs/layer-tracks.md) |
102| Idle breathing | curation choice, baked by compose | [breathing](docs/breathing.md) |
103| Engine exports | `export-aseprite`, `export-pngs` | [engine-export](docs/engine-export.md) |
104| Background recipe or repeating tile | existing `gen` / `cutout`, then optional `background-tile` | [asset-tools](docs/asset-tools.md#background-recipe) |
105| Standalone projected shadow | `shadow` | [asset-tools](docs/asset-tools.md#projected-shadows) |
106| Duplicate poses, foot contact and stride measurement | `inspect-motion` | [asset-tools](docs/asset-tools.md#motion-and-contact-evidence) |
107| Optional scene placement, lighting, camera and render | `scene-render`, `scene-inspect` | [scene](docs/scene.md) |
108| Defaults | `defaults show`, `defaults save`, `defaults clear` | [user-workflow](docs/user-workflow.md#one-settings-owner) |
109 
110Use existing automatic pipeline stages for background removal, extraction, alignment and export. Do not ask users to select each script. For a direct utility request, run that utility; no unrelated generation questions are needed. Preserve the row pipeline and component extraction for image sprites. One-shot grid generation and fixed cell cutting are not an alternative sprite-generation route.
111 
112For attack repeat coverage, observed one-shot returns and structured loop failure reports, follow [video-pipeline](docs/video-pipeline.md#one-shot-actions--cycle-autoperiodicone-shot).
113 
114Scene creation consumes finished assets and remains optional. Asset metadata owns frames, native durations and anchors; scene specs own placement, scale, playback rate, planes, camera and light. Measure stride only with declared same-foot contact and an isolated foot ROI; unknown contact stays unverified. Apply only a verified report for the exact selected asset with an explicit scene direction. Never infer walking direction from the bottommost silhouette, reverse frames or change source assets to make a scene work.
115 
116## 실행 인터프리터
117 
118`SPRITE_GEN_ROOT` is the absolute installed repository path. Use `$SPRITE_GEN_ROOT/.venv/bin/sprite-gen` or `$SPRITE_GEN_ROOT/.venv/bin/python`; do not assume an activated shell. **폴백 금지**: create a missing venv or report the failure, never use an arbitrary global Python. **NumPy 가 없는 인터프리터** fails at package import. Setup and diagnosis: [interpreter](docs/interpreter.md).
119 
120## RIFE for walk and run loops
121 
122`video-loop` repairs a walk's or run's jump frames and `video-set` gives a direction set one cycle length, both with RIFE in-betweens. Install it once per machine: `$SPRITE_GEN_ROOT/.venv/bin/sprite-gen rife install` (pinned rife-ncnn-vulkan 20221029 and model rife-v4.6, SHA-256 checked, into the user data directory, ending with a check frame; Linux without a GPU first needs `libvulkan1 mesa-vulkan-drivers`). Without it every loop is still cut, as filmed, and says so: a `warning:` line on stderr, `jump_repair.applied: false` in the loop report, `cycle_align.<state>.applied: false` and `warnings` in `set.report.json`. When that happens, tell the user which loops went unrepaired and offer the install; after it, cut those loops again and run `video-cycle-align`. `video-loop --repair on` and `video-cycle-align` fail without RIFE instead. [loop-repair](docs/loop-repair.md).
123 
124## Contracts and advanced tools
125 
126[run-contract](docs/run-contract.md) owns numeric requests, run layout, atomic publication and curated exports. [architecture](docs/architecture.md) explains domain ownership. [docs index](docs/README.md) lists every specialized feature and QA procedure. `sprite-gen --help` derives the command map from the package catalog. Never replace canonical extraction with temporary crop scripts while presenting the result as a pipeline output.
127 

Discussion