Generate a sprite from a text prompt
generate_spriteGenerate a Game Boy sprite from a text prompt, quantize to 4-color DMG palette, and save as sprite.png with .gbsres for immediate use in GB Studio projects.
Instructions
Generate a GB Studio sprite from a text prompt. Calls the configured image-generation provider (SPRITE_PROVIDER env var ∈ {openai, gemini, replicate, fal}; default openai), runs the result through a 4-colour DMG quantiser, and writes (sprite.png + sprite.png.gbsres) under assets/sprites/. Returns a spriteSheetId you can pass to create_actor immediately. Frames are 16×16; for multi the provider is called 3× (one per direction), for multi_movement 6× (idle + walk per direction). After quantisation a heuristic quality check runs; degenerate outputs refuse to save unless force: true.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| name | Yes | Display name; also seeds the on-disk slug. | |
| force | No | Skip the post-quantisation quality check and save the sprite even if it looks degenerate. | |
| prompt | Yes | Description of the character. Will be auto-wrapped with a pixel-art preamble; do not include palette / size hints yourself. | |
| provider | No | Override the SPRITE_PROVIDER env default for this single call. | |
| animationType | Yes |