Image Generation
Image Input
Transform or condition on a source image (img2img and inpainting)
Image Input
Some image models accept input images, not just a text prompt — so you can transform an existing picture (img2img) or edit part of one (inpainting), guided by your prompt.
Image input is available only on models that accept image input, and each such model allows up to a maximum number of input images.
img2img
Pass one or more source images with images; the model uses them as the basis for the result:
{
"prompt": "the same hero, now in winter armor",
"images": ["data:image/png;base64,..."]
}Inpainting
Provide a mask alongside the image to regenerate only the masked region, leaving the rest intact — useful for edits like swapping an item or changing a detail.
When to use it
- Restyle or iterate on existing art instead of generating from scratch.
- Keep a character consistent across variations.
- Edit a specific area without redrawing the whole image.
For the exact call in your language, see the JavaScript, Unity, or Unreal image generation guide.