Skip to main content
Wan2.7

Wan 2.7 — Generate or edit an image

Async Wan 2.7 image generation and editing

POST
/services/aigc/image-generation/generation
curl --location 'https://dashscope-intl.aliyuncs.com/api/v1/services/aigc/image-generation/generation' \
--header 'Content-Type: application/json' \
--header "Authorization: Bearer $DASHSCOPE_API_KEY" \
--header 'X-DashScope-Async: enable' \
--data '{
  "model": "wan2.7-image-pro",
  "input": {
    "messages": [
      {
        "role": "user",
        "content": [
          {
            "text": "A flower shop with exquisite windows, a beautiful wooden door, and flowers on display"
          }
        ]
      }
    ]
  },
  "parameters": {
    "n": 1,
    "size": "2K",
    "watermark": false,
    "thinking_mode": true
  }
}'
{
  "request_id": "ccf4b2f4-bf30-9e13-9461-3a28c6a7bxxx",
  "output": {
    "task_id": "8811b4a4-00ac-4aa2-a2fd-017d3b90cxxx",
    "task_status": "PENDING"
  }
}
Image generation tasks take 1 to 2 minutes. Use the async API to avoid request timeouts by splitting the process into two steps:
  1. Create a task (this endpoint) and receive a task_id.
  2. Query the result by polling with the task_id.
The request body uses the same messages format and parameters as the synchronous endpoint, but requires the X-DashScope-Async: enable header.

Authorizations

string
header
required

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

Header Parameters

enum<string>
required

Asynchronous processing configuration. Must be set to enable.

enable

Body

application/json
enum<string>
required

The model name. Valid values: wan2.7-image-pro, wan2.7-image.

wan2.7-image-pro,wan2.7-image
wan2.7-image-pro
object
required

Input data containing the messages array.

object

Image processing parameters.

Response

200-application/json
string
default"ccf4b2f4-bf30-9e13-9461-3a28c6a7bxxx"

Unique request identifier.

ccf4b2f4-bf30-9e13-9461-3a28c6a7bxxx
object