enable_interleave (image generation mode) parameter, the required parameters/rules to be followed vary:enable_interleave: true)image array: 0~1 (images can be omitted)n (number of generated images): fixed at 1max_images: effective, value range 1~5 (default 5)model, input.messages (must contain the text field)negative_prompt, watermark, seed, sizeenable_interleave: false, default)image array: 1~3 (at least 1 image must be provided)n (number of generated images): 1~4 (default 4)prompt_extend: effective, intelligent prompt rewriting is enabled by defaultmodel, input.messages (must contain both text and image fields)negative_prompt, prompt_extend, watermark, size, seed| Parameter Name | Length Limit | Handling of Exceeding Limits |
|---|---|---|
input.messages.content.text | 2000 characters (Chinese and English) | Automatically truncated |
parameters.negative_prompt | 500 characters (Chinese and English) | Automatically truncated |
Note: Each character (Chinese character/letter/number/symbol) counts as 1 character; only one textfield is supported. Passing multiple or none will result in an error.
| Limit Type | Specific Rules |
|---|---|
| Format | JPEG, JPG, PNG (without transparent channel), BMP, WEBP |
| Resolution | Width/height range [384, 5000] pixels |
| File Size | No more than 10MB |
| Input Format | 1. Publicly accessible URL (HTTP/HTTPS) 2. Base64 encoded string (format: data:{MIME_type};base64,{base64_data}) |
n to 1 to reduce verification costsenable_interleave=true, max_images is the upper limit of the number of generated images, and the actual number may be less than the set valueseed value range is [0, 2147483647]. The same seed can improve generation stability (not completely consistent)prompt_extend will increase processing time by 3-4 seconds and only takes effect in image editing mode{
"model": "wan2.6-image",
"input": {
"messages": [
{
"role": "user",
"content": [
{
"text": "Replace the floral dress with a vintage-style lace long dress, featuring exquisite embroidery details on the neckline and cuffs.。"
},
{
"image": "https://help-static-aliyun-doc.aliyuncs.com/assets/img/zh-CN/3943878571/p1011665.webp"
}
]
}
]
},
"parameters": {
"negative_prompt": "",
"prompt_extend": true,
"watermark": false,
"n": 2,
"size": "1280*1280"
}
}curl --location --request POST 'https://api.302.ai/aliyun/api/v1/services/aigc/image-generation/generation' \
--header 'Authorization: Bearer ' \
--header 'Content-Type: application/json' \
--data-raw '{
"model": "wan2.6-image",
"input": {
"messages": [
{
"role": "user",
"content": [
{
"text": "Replace the floral dress with a vintage-style lace long dress, featuring exquisite embroidery details on the neckline and cuffs.。"
},
{
"image": "https://help-static-aliyun-doc.aliyuncs.com/assets/img/zh-CN/3943878571/p1011665.webp"
}
]
}
]
},
"parameters": {
"negative_prompt": "",
"prompt_extend": true,
"watermark": false,
"n": 2,
"size": "1280*1280"
}
}'{
"request_id": "24d5a019-e4ed-47de-a8c3-0badbd17a084",
"output": {
"task_id": "2132eabd-ad49-4ef5-be52-34b1a690fcc5",
"task_status": "PENDING"
}
}