Edit Image
Interface description: Edit images synchronously, edit based on reference images and instructions.
Before calling this interface, please request the “Image Editing Models” interface (GET /api/ai/models/image/edit) to obtain the currently available model list and the size, maximum number of input images, and price supported by each model, and then fill in the parameters of this interface accordingly.
Image editing as image-to-image: You must pass in the reference image image, and follow the prompts to modify, redraw or stylize it based on it. If you want to generate a new image (text-to-image) using only text, please use the “Generate Image” interface.
If you are already using the OpenAI SDK or ecological tools, you can use the OpenAI compatible endpoint “OpenAI Image Editing” instead.
Authorizations
Need to get API Key from AiToEarn. Click to go to "API Key Obtaining Tutorial".
Body
Image editing model name. First call the "Image Editing Models" interface (GET /api/ai/models/image/edit) and pass in the data[n].name returned by it; the size, maximum number of input images and price supported by each model shall be subject to the return of this interface.
original picture
Edit description
1 - 4000Mask image URL for partial redraw (optional). It needs to be a PNG image with the same size as image: the completely transparent area (alpha is 0) represents the part that needs to be redrawn according to the prompt word, and the opaque area remains unchanged. Edit the entire image when not uploading.
Number of images generated
1 <= x <= 1Image size. The optional values vary from model to model, and are subject to the data[n].sizes returned by the "Image Editing Models" interface; the prices for different sizes are different, see data[n].pricing.
Return format
url, b64_json Response
The request has been processed by the service. Business success is determined by whether the response body has code === 0.

