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
| Parameter | Type | Required | Support | Description |
|---|---|---|---|---|
prompt | string | ✅ | ✅ Full | Edit instruction |
model | string | ✅ | ✅ Full | qwen-image-edit or qwen-image-edit-pe |
images | array | ✅ | ⚠️ Partial | Array of image objects. Only image_url with base64 data URL supported. External URLs not supported |
output_format | string | ✅ Full | png, jpeg, or webp | |
quality | string | ✅ Full | low, medium, standard, high, hd, auto | |
size | string | ✅ Full | Target output size | |
n | integer | ⚠️ Partial | Only 1 accepted | |
response_format | string | ⚠️ Partial | Only 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.