Inpaint
Regional editing of existing images using mask-based inpainting.
Inpaint
Edit specific regions of an image by providing a mask. Areas marked in black on the mask will be regenerated based on your prompt, while the rest of the image is preserved.
Endpoint
POST /api/image-ops/inpaintParameters
| Name | Type | Required | Description |
|---|---|---|---|
asset_id | string | Yes | ID of the asset to inpaint |
mask | string | Yes | Mask image URL or base64. Black pixels = areas to edit |
prompt | string | Yes | Description of what to generate in the masked area |
seed | integer | No | Random seed for reproducible results. 0 = random |
Example
curl -X POST https://api.spritesynth.com/api/image-ops/inpaint \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"asset_id": "asset_abc123",
"mask": "https://example.com/mask.png",
"prompt": "a golden crown with gems",
"seed": 42
}'Response
{
"id": "inpaint_890",
"status": "completed",
"asset": {
"url": "https://cdn.spritesynth.com/assets/inpaint_890.png",
"width": 128,
"height": 128
},
"credits_cost": 1,
"duration_ms": 2000
}Tips
- Keep the mask simple — solid black for edit areas, white for preserved areas.
- The mask must be the same dimensions as the source image.
- Use the Pixel Editor to paint masks precisely.
Need help?
Join our Discord community for support and tips.
Was this page helpful?