Skip to main content
Wan2.6

Wan 2.6 — Generate or edit an image

Async Wan 2.6 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.6-image", "input": { "messages": [ { "role": "user", "content": [ { "text": "Generate a tomato and egg stir-fry based on the style of image 1 and the background of image 2" }, { "image": "https://cdn.wanx.aliyuncs.com/tmp/pressure/umbrella1.png" }, { "image": "https://img.alicdn.com/imgextra/i3/O1CN01SfG4J41UYn9WNt4X1_!!6000000002530-49-tps-1696-960.webp" } ] } ] }, "parameters": { "prompt_extend": true, "watermark": false, "n": 1, "enable_interleave": false, "size": "1K" } }'
{ "output": { "task_status": "PENDING", "task_id": "0385dc79-5ff8-4d82-bcb6-xxxxxx" }, "request_id": "4909100c-7b5a-9f92-bfe5-xxxxxx" }
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

Model name. Set to wan2.6-image.

wan2.6-image
wan2.6-image
object
required

Input data containing the messages array.

object

Image processing parameters.

Response

200-application/json
string
default"4909100c-7b5a-9f92-bfe5-xxxxxx"

Unique request identifier for troubleshooting.

object