Edit an image you already have (inpainting)
ai_image_editUse when an agent must change part of an image and leave the rest untouched: pass the image and a black-and-white mask, and Stable Diffusion inpainting repaints only the white area following your prompt. Image and mask go as https URLs or as base64, up to 10 MB each. Returns a hosted image URL valid for 24 hours. You are only charged if the edit is delivered. No API key, no account. $0.02 per call, paid over x402 (USDC).
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| url | No | https URL of the image to edit. Use this or image. | |
| mask | No | The mask, as base64. Use this or mask_url. | |
| seed | No | Same inputs and same seed give the same edit. | |
| image | No | The image to edit, as base64. Use this or url. | |
| steps | No | Diffusion steps, 1-20. | |
| prompt | Yes | What to paint into the masked area, up to 2048 characters. | |
| guidance | No | How closely to follow the prompt, 0-20. | |
| mask_url | No | https URL of the mask: white where it should repaint, black where it must not. Use this or mask. |