Skip to main content
Image editing

Qwen

Edit images via text

POST
/services/aigc/multimodal-generation/generation
curl --location 'https://dashscope-intl.aliyuncs.com/api/v1/services/aigc/multimodal-generation/generation' \
--header 'Content-Type: application/json' \
--header "Authorization: Bearer $DASHSCOPE_API_KEY" \
--data '{
  "model": "qwen-image-2.0-pro",
  "input": {
    "messages": [
      {
        "role": "user",
        "content": [
          {
            "image": "https://help-static-aliyun-doc.aliyuncs.com/file-manage-files/zh-CN/20250925/fpakfo/image36.webp"
          },
          {
            "text": "Generate an image that matches the depth map, following this description: A dilapidated red bicycle is parked on a muddy path with a dense primeval forest in the background."
          }
        ]
      }
    ]
  },
  "parameters": {
    "n": 2,
    "negative_prompt": " ",
    "prompt_extend": true,
    "watermark": false,
    "size": "1536*1024"
  }
}'
{
  "output": {
    "choices": [
      {
        "finish_reason": "stop",
        "message": {
          "content": [
            {
              "image": "https://dashscope-result-sz.oss-cn-shenzhen.aliyuncs.com/xxx.png?Expires=xxx"
            },
            {
              "image": "https://dashscope-result-sz.oss-cn-shenzhen.aliyuncs.com/xxx.png?Expires=xxx"
            }
          ],
          "role": "assistant"
        }
      }
    ]
  },
  "usage": {
    "width": 1536,
    "image_count": 2,
    "height": 1024
  },
  "request_id": "bf37ca26-0abe-98e4-8065-xxxxxx"
}

Authorizations

string
header
required

DashScope API Key. Create one in the Qwen Cloud console.

Body

application/json
enum<string>
required

Model name.

qwen-image-2.0-pro,qwen-image-2.0-pro-2026-03-03,qwen-image-2.0,qwen-image-2.0-2026-03-03,qwen-image-edit-max,qwen-image-edit-max-2026-01-16,qwen-image-edit-plus,qwen-image-edit-plus-2025-12-15,qwen-image-edit-plus-2025-10-30,qwen-image-edit
qwen-image-2.0-pro
object
required

Input data containing the messages array.

object

Image editing parameters.

Response

200-application/json
object
object

Usage statistics (successful results only).

string
default"bf37ca26-0abe-98e4-8065-xxxxxx"

Unique request identifier for tracing and troubleshooting.

bf37ca26-0abe-98e4-8065-xxxxxx