Edit (legacy)

Edit a given image synchronously using the provided mask. The mask indicates which part of the image should be edited, while the prompt and chosen style type can further guide the edit.

Supported image formats include JPEG, PNG, and WebP.

Images links are available for a limited period of time; if you would like to keep the image, you must download it.

Headers

Api-KeystringRequired

Request

This endpoint expects a multipart form with multiple files.
image_filefileRequired

An image binary (max size 10MB); only JPEG, WebP and PNG formats are supported at this time.

maskfileRequired

A black and white image of the same size as the image being edited (max size 10MB). Black regions in the mask should match up with the regions of the image that you would like to edit; only JPEG, WebP and PNG formats are supported at this time.

promptstringRequired

The prompt used to describe the edited result.

modelenumRequired

The model used to generate an image or edit one. /generate and /remix supports all model types, however, /edit is only supported for V_2 and V_2_TURBO.

magic_prompt_optionenumOptional

Determine if MagicPrompt should be used in generating the request or not.

Allowed values:
num_imagesintegerOptional>=1<=8

The number of images to generate.

seedintegerOptional>=0<=2147483647

Random seed. Set for reproducible generation.

style_typeenumOptional

The style type to generate with; this is only applicable for models V_2 and above and should not be specified for model versions V_1.

Response

Image edits generated successfully.

createddatetime

The time the request was created.

datalist of objects

A list of ImageObjects that contain the generated image(s).

Errors