forge_animation
Generate pixel art animation frames using AI. Splits sprite sheets into individual PNGs with background removal and cropping, returning ready-to-use frame files.
Instructions
Generate pixel art animation frames. Produces a sprite sheet via Gemini, then automatically splits it into individual frame PNGs with background removal and cropping. Returns an array of ready-to-use frame files.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| size | No | Target frame size in pixels (default: 48). Snaps to nearest standard size. Recommended: 16-24 for particle effects/small FX, 32 for item animations, 48 for character animations (PixelLab default), 64 for detailed characters, 96-128 for bosses. Set to 0 to skip downscale. | |
| model | No | Model alias or full ID. Aliases: 25, nano-banana, banana, banana-2, nano-banana-2, gemini-flash, flash, gemini-pro, pro, gemini-25, gemini-flash-25 (default: nano-banana) | |
| names | No | Frame names (default: frame-0, frame-1, ...) | |
| style | No | Visual style preset (default: clean) | |
| action | Yes | What the animation shows (e.g. "bouncing up and down", "walking cycle", "idle breathing") | |
| frames | No | Number of animation frames (default: 3) | |
| square | No | Pad each frame to square (default: true) | |
| background | No | Background color for generation. Use "auto" to pick based on description. Use "chromakey" for best transparency (HSV-based green screen removal). Named colors: chromakey, forest, sky, dungeon, lava, ocean, sand, snow, night. (default: black) | |
| references | No | Paths to existing PNG/JPEG assets to match visual style. The animation frames will be generated in a similar art style, color palette, and detail level as the reference images. | |
| description | Yes | What is being animated (e.g. "green slime enemy", "player knight") | |
| useTemplate | No | Use grid template reference for precise frame placement (default: false). When true, generates a numbered grid template and sends it as a reference image for more consistent frame splitting. | |
| outputPrefix | Yes | Output path prefix — frames saved as {prefix}-{name}.png (e.g. "public/assets/games/rpg/slime") | |
| frameDescriptions | No | Optional per-frame descriptions (e.g. ["compressed flat", "stretching up", "at peak"]) | |
| useReferenceChain | No | Generate each frame individually using the first frame as style reference (default: true). Produces much more consistent animations than sprite sheet splitting. Each frame is a separate API call with the idle/first frame as reference image. |