S
spritesynthDOCS

Using Init Images & Inpainting

Use reference images to guide generation and inpaint specific regions of your sprites.

Overview

Init images let you provide a starting point for generation instead of relying solely on text prompts. Combined with inpainting, you can refine specific areas of an existing sprite without regenerating the whole thing.

When to Use Init Images

  • You have a rough sketch and want the AI to polish it
  • You want style consistency across multiple sprites
  • You need to regenerate only part of an image

Step 1: Prepare Your Reference Image

Upload a PNG, JPG, or WebP file. There are no strict size requirements, but the image will be resized to match your target generation dimensions. For best results:

  • Use a sprite or sketch at roughly the target resolution
  • Keep backgrounds simple or transparent
  • Match the pixel art style you want as output

Step 2: Generate with Style Reference

Use the style reference endpoint to combine your image with a text prompt:

curl -X POST https://api.spritesynth.com/v1/generations/style \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
"prompt": "warrior sprite, medieval armor, idle pose",
    "style_reference": "base64_encoded_image_data",
    "width": 64,
    "height": 64
  }'

The model uses your reference to guide color palette, proportions, and overall aesthetic while interpreting the text prompt.

Step 3: Inpaint a Region

Once you have a base sprite, use inpainting to fix or modify specific areas without starting over:

curl -X POST https://api.spritesynth.com/v1/image-ops/inpaint \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "image": "base64_encoded_sprite",
    "mask": "base64_encoded_mask",
    "prompt": "red cape flowing behind the character"
  }'

The mask is a black-and-white image where white pixels mark the area to regenerate.

Tips

  • Iterate in the editor — Open generated sprites in the pixel art editor, paint a rough mask, and use the inpaint tool for targeted fixes.
  • Style consistency — Generate your first sprite, then use it as a style reference for all subsequent sprites in the same project.
  • Mask precision — Paint masks at the same resolution as the sprite for pixel-accurate inpainting.

Need help?

Join our Discord community for support and tips.

Was this page helpful?

On this page