Authentication
authorization string required
All APIs require authentication via Bearer Token.
Get API Key:
Visit API Key Management Page to get your API Key.
Usage:
Add to request header:
Authorization: Bearer YOUR_API_KEY
Parameters
model string required
Model ID used for the request
Value: qwen_image_edit_plus
input object required
Input parameter object
messages
arrayrequiredRequest content array. Only single-turn conversation is currently supported, so the array must contain exactly one object with
roleandcontentrole
stringrequiredMessage sender role
Value:
usercontent
arrayrequiredMessage content array. It must contain
1-3image items in{"image": "..."}format and exactly one edit instruction in{"text": "..."}formatimage
stringrequiredInput image URL or Base64 encoded data. Supports
1-3input imagesFor multi-image input, image order follows the array order, and output image ratio follows the last image
Supported formats:JPG,JPEG,PNG,BMP,TIFF,WEBP,GIF
Output image format isPNG. For GIF input, only the first frame is processed
Recommended resolution for best quality: both width and height between384and3072pixels. Too low may cause blur, too high may increase processing time
Maximum image size:10MB
Supports public URL input and Base64 image strings
Public URL supportsHTTPandHTTPSprotocols
URL example:https://help-static-aliyun-doc.aliyuncs.com/file-manage-files/zh-CN/20250925/fpakfo/image36.webp
Base64 example:data:image/jpeg;base64,GDU7MtCZz...text
stringrequiredPositive prompt for expected image content, style, and composition
Supports Chinese and English, maximum800characters. Each Chinese character, letter, number, or symbol counts as one character, and overflow is automatically truncated
Example:Make the girl in image 1 wear the black dress in image 2 and sit in the pose of image 3, while keeping outfit details, hairstyle, and expression unchanged, with natural and smooth movement
Only onetextis supported. Missingtextor multipletextentries will return an errorparameters
objectAdditional control parameters for image generation
n
integerNumber of output images
Supports
1-6output imagesDefault:
1negative_prompt
stringNegative prompt for unwanted content constraints
Supports Chinese and English, maximum500characters. Each Chinese character, letter, number, or symbol counts as one character, and overflow is automatically truncated
Example:low resolution, errors, worst quality, low quality, mutilated, extra fingers, bad proportionssize
stringOutput image resolution in
width*heightformat, for example1024*1536. Width and height must both be in range512-2048
Recommended resolutions by common ratio:
1:1:1024*1024,1536*1536
2:3:768*1152,1024*1536
3:2:1152*768,1536*1024
3:4:960*1280,1080*1440
4:3:1280*960,1440*1080
9:16:720*1280,1080*1920
16:9:1280*720,1920*1080
21:9:1344*576,2048*872
Output size rules: ifsizeis provided, the system targets that size, then adjusts actual output dimensions to the nearest multiples of16. Example: if set to1033*1032, actual output becomes1040*1024
Ifsizeis not provided, output keeps a ratio close to the input image, or the last image for multi-image input, with total pixel count close to1024*1024prompt_extend
booleanWhether to enable intelligent prompt rewriting
When enabled, the model optimizes the positive prompt (
text). This is especially useful for simple prompts
Default:truewatermark
booleanWhether to add
Qwen-Imagewatermark at the bottom-right cornerDefault:
falseseed
integerRandom seed
Range:
0-2147483647
Using the sameseedcan keep generated content relatively stable. If omitted, a random seed is used automatically
Generation is probabilistic, so even with the sameseed, results are not guaranteed to be exactly identical
Polling
Since result generation takes time, you need to poll the task status after creating the task.
The initial response only returns information such as the task ID and initial status. The final result must be obtained by polling the task status endpoint using the task ID.
See the examples on the right for polling requests and responses.
Response Format
error object
Error information. Only present when status is failed
code
integerError code
error_message
stringDetailed error message
output array
Generation results. Only present when status is completed
content
arrayGenerated content list
type
stringResource type
Value:
imageurl
stringGenerated image URL
usage object
Usage statistics. Only present when status is completed
metadata object
Metadata information