Edits an image using a text prompt and optional mask. Request must be sent as multipart/form-data
with at least model, prompt (unless type is background_removal), and image (or image[]).
Model identifier in format provider/model
Image file to edit. Use field name image for a single file or image[] for multiple files.
Text prompt describing the edit. Required unless type is background_removal.
Optional mask image for inpainting (transparent areas indicate regions to edit)
Type of edit operation
inpainting, outpainting, background_removal Number of images to generate
1 <= x <= 10Size of the output image
256x256, 512x512, 1024x1024, 1536x1024, 1024x1536, auto Format of the response
url, b64_json When true, stream the response via Server-Sent Events
Background type for the image
transparent, opaque, auto How closely to follow the original image
low, high Number of partial images to generate when streaming
0 <= x <= 3Quality of the output image
auto, high, medium, low, standard Output image format
png, webp, jpeg Number of inference steps
Seed for reproducible editing
Compression level (0-100%)
0 <= x <= 100What to avoid in the edit
User identifier for tracking
Fallback models to try if primary model fails
Successful response. Returns JSON for non-streaming requests, or Server-Sent Events (SSE) stream when stream=true.
When streaming, events are sent with the following event types:
image_edit.partial_image: Intermediate image chunks with base64-encoded image dataimage_edit.completed: Final event for each image with usage informationerror: Error events with error detailsUnique identifier for the generation request
Unix timestamp when the image was created
Model used for generation
Array of generated images
Background type for the image
Output image format
png, webp, jpeg Quality of the generated image
Size of the generated image
256x256, 512x512, 1024x1024, 1792x1024, 1024x1792, 1536x1024, 1024x1536, auto Additional fields included in responses