Operation
Edit Image
Edit a hosted image with Cannon Studio's image edit stack and task lifecycle.
Operation: image.edit
Submit via POST /api/v1/requests
Credits: dynamic
Seedream 5.0 LiteNano BananaNano Banana 2Wan 2.7 ImageWan 2.7 Image ProFlux 2Flux 2 ProGPT Image 2
Request fields
promptimage_urlmodelaspect_ratioresolution
Example request
{
"operation": "image.edit",
"input": {
"prompt": "Turn this into a rain-soaked night version while preserving composition.",
"image_url": "https://example.com/source.png",
"model": "gptimage2",
"aspect_ratio": "16:9",
"resolution": "4K"
}
}curl -X POST https://www.cannonstudio.app/api/v1/requests \
-H "Content-Type: application/json" \
-H "x-api-key: $CANNON_API_KEY" \
-H "x-idempotency-key: image-edit-001" \
-d @- <<'JSON'
{
"operation": "image.edit",
"input": {
"prompt": "Turn this into a rain-soaked night version while preserving composition.",
"image_url": "https://example.com/source.png",
"model": "gptimage2",
"aspect_ratio": "16:9",
"resolution": "4K"
}
}
JSONNotes
- Edits a hosted source image through the same image edit stack used in the app.
- The request object resolves when the edited image is available from the downstream image task.
- Supported models are Seedream 5.0 Lite, Nano Banana, Nano Banana 2, Flux 2, Flux 2 Pro, and GPT Image 2.
- GPT Image 2 edit requests accept `resolution` values of `1K`, `2K`, or `4K`; the default is the largest legal resolution for the requested aspect ratio.
Success output
{
"task_id": "imgedit_123",
"asset_type": "image",
"status": "succeeded",
"image_url": "https://storage.googleapis.com/.../edited.png",
"provider": "kie",
"model": "seedream/5-lite-image-to-image"
}