Skip to main content

Image Edition

Edit an Image

POST/v1/images/edits

Edit an image following instructions given by the prompt. Compatible with OpenAI Image Edition API with some limitations (cf column "support" in the Request Body table).


Request

curl -X POST https://api.ig1.ai/v1/images/edits \
-H "Authorization: Bearer $IG1AI_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "qwen-image-edit",
"images": [
{
"image_url": "data:image/png;base64,<BASE64_ENCODED_IMAGE_DATA>"
}
],
"prompt": "Replace the iguana with a snake, keep the same neon theme and background.",
"quality": "low",
"size": "1280x720",
"output_format": "png"
}'

Request body

ParameterTypeRequiredSupportDescription
promptstring✅ FullEdit instruction
modelstring✅ Fullqwen-image-edit or qwen-image-edit-pe
imagesarray⚠️ PartialArray of image objects. Only image_url with base64 data URL supported. External URLs not supported
output_formatstring✅ Fullpng, jpeg, or webp
qualitystring✅ Fulllow, medium, standard, high, hd, auto
sizestring✅ FullTarget output size
ninteger⚠️ PartialOnly 1 accepted
response_formatstring⚠️ PartialOnly b64_json supported
background❌ Ignored
input_fidelity❌ Ignored
mask❌ Ignored
moderation❌ Ignored
output_compression❌ Ignored
partial_images❌ Ignored
stream❌ Ignored
user❌ Ignored

Response

{
"created": 1773764659,
"data": [
{
"b64_json": "<BASE64_ENCODED_IMAGE_DATA>"
}
],
"usage": {
"total_tokens": 0,
"input_tokens": 0,
"output_tokens": 36864000,
"input_tokens_details": {
"text_tokens": 0,
"image_tokens": 0
}
},
"output_format": "png",
"quality": "low",
"size": "1280x720"
}

Prompt Enhancement

Use model qwen-image-edit-pe to automatically refine your prompt via Qwen3.5-397B-A17B before editing. Prompt enhancement override your prompt with more details and elements that fit perfectly with model's expectations to generate a better image.

info

Prompt enhancement tokens are charged under the Qwen3.5-397B-A17B model.

Unsupported Open AI endpoints

warning

POST/v1/images/variations endpoint is not supported by IG1 AI API.