Skip to main content

Qwen Image Editing

POST /v1/images/generations
Use the qwen-image-edit-2509 model for intelligent image editing, compatible with the OpenAI Images API format.

Request Parameters

ParameterTypeRequiredDescription
modelstringYesFixed as qwen-image-edit-2509
promptstringYesEdit description
imagestringYesOriginal image URL
nintegerNoNumber of images, default 1
sizestringNoOutput size

Request Examples

curl -X POST https://crazyrouter.com/v1/images/generations \
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -d '{
    "model": "qwen-image-edit-2509",
    "prompt": "Replace the sky in the image with a starry night",
    "image": "https://example.com/landscape.jpg",
    "n": 1
  }'

Response Example

{
  "created": 1709123456,
  "data": [
    {
      "url": "https://crazyrouter.com/files/qwen_edit_abc123.png"
    }
  ]
}

Use Cases

  • Replace image backgrounds
  • Modify specific elements in an image
  • Add or remove objects
  • Style transfer

Example: Remove Object

{
  "model": "qwen-image-edit-2509",
  "prompt": "Remove the watermark from the image",
  "image": "https://example.com/photo_with_watermark.jpg"
}

Example: Style Transfer

{
  "model": "qwen-image-edit-2509",
  "prompt": "Convert the photo to cartoon style",
  "image": "https://example.com/photo.jpg"
}
The Qwen image editing model has excellent understanding of Chinese instructions. Using Chinese descriptions for editing requests is recommended.