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-3.0-pro",
"input": {
"messages": [
{
"role": "user",
"content": [
{
"text": "A vertical outdoor portrait photograph carrying the warm atmosphere of a late-afternoon street scene from top to bottom. The upper left and top of the frame are largely covered by dark green vines and small orange flowers cascading naturally from the building cornice; sunlit leaves catch yellow-green highlights while shaded ones deepen to dark green, forming a dense yet soft background layering. Across the upper-left to upper-centre area is a dark blue horizontal sign, its surface dim with a slightly matte texture, bearing the large white blackletter words Il Messaggero. The text sits slightly above centre on the left, partly veiled by the foreground foliage, set in a high-contrast typeface with decorative sharp terminals and pronounced stroke variation. Beneath the sign is the glass display window of a newsstand, its black metal framing dividing the case into multiple rectangular sections filled with newspapers, magazines and book covers, most of them illegible from the shallow depth of field and light reflections, creating a background texture of pale paper interlaced with dark frames. The upper right is a zone of strong backlight, sunlight pouring in from the end of the street, background buildings blurred into soft beige-grey planes with a pronounced shallow depth of field. Right of centre stands a young adult woman shown from above the knee up, glancing back at the camera with a smile, body turned slightly right, shoulders and back toward the viewer, her posture natural and relaxed. Her long, thick black wavy hair is traced with a golden rim light from the backlight, the ends fanning outward on the right, light and airy. Her skin is fair, her face a soft oval, brows finely shaped, eyes bright with sheer eye makeup and distinct lashes, natural highlights across her face, lips a soft coral red, smiling to show her teeth, expression warm and open. She wears small earrings and a black spaghetti-strap backless dress in deep black with a clean silhouette, the thin straps extending from shoulder to back, the line of her back clearly defined. From the lower left to the centre of the frame she holds a large bouquet of roses in both arms, mostly orange, apricot, pink and pale peach, petals curling in layers with sunlit edges, green leaves and long stems trailing from beneath, a vivid colour contrast against the black dress. The right background is a sunlit city street, its ground in warm grey and golden tones; distant buildings, street fixtures and a blurred red circular traffic sign sit in the lower-right distance, reduced by the out-of-focus falloff to colour blocks and outlines. The whole photograph carries a warm filmic treatment with fine grain, soft contrast and pronounced backlit edge light; the subject is the visual focus, while the newsstand, flowering vines, street and sunlight together create a romantic, bright, urban-stroll atmosphere."
}
]
}
]
},
"parameters": {
"negative_prompt": "",
"prompt_extend": true,
"watermark": false,
"size": "2048*2048"
}
}'{
"output": {
"choices": [
{
"finish_reason": "stop",
"message": {
"content": [
{
"image": "https://dashscope-result-sh.oss-cn-shanghai.aliyuncs.com/xxx.png?Expires=xxx"
}
],
"role": "assistant"
}
}
]
},
"usage": {
"output_height": 2048,
"output_width": 2048,
"input_image_count": 0,
"input_image_type": "qima_input_2k",
"output_image_count": 1,
"output_image_type": "qima_output_2k"
},
"request_id": "d0250a3d-b07f-49e1-bdc8-6793f4929xxx"
}Authorizations
DashScope API Key. Create one in the QwenCloud console.
Body
application/jsonModel name.
Input data containing the messages array.
Show child attributes
Show child attributes
Single-turn only. Exactly one message with role user.
Show child attributes
Show child attributes
Must be user.
Message content array. Must contain exactly one text object.
Show child attributes
Show child attributes
Positive prompt describing the desired content, style, and composition. The qwen-image-2.0 series accept up to 1,300 tokens. Other models accept up to 800 tokens. The system truncates excess tokens.
Image generation parameters.
Show child attributes
Show child attributes
Describes content you do NOT want in the image. Max 500 characters. Excess is auto-truncated.
Output resolution as width*height.
- qwen-image-3.0 series: total pixels between 512*512 and 2048*2048, aspect ratio between 1:8 and 8:1; when omitted, the model auto-recommends a resolution based on the prompt.
- qwen-image-2.0 series: total pixels between 512*512 and 2048*2048, default
2048*2048. - qwen-image-max: supports custom resolution (total pixels between 512*512 and 2048*2048) and fixed sizes.
- qwen-image-plus/image: fixed sizes only.
Fixed sizes for qwen-image-max/plus/image: 1664*928 (16:9, default), 1472*1104 (4:3), 1328*1328 (1:1), 1104*1472 (3:4), 928*1664 (9:16).
Number of images to generate. Default: 1.
- qwen-image-3.0 / qwen-image-2.0 series: 1-6.
- qwen-image-max/plus series: fixed at 1.
Enable prompt rewriting. true (default): the model rewrites the prompt before generating; for the qwen-image-3.0 series the rewriting follows the mode set by prompt_extend_mode. false: use your prompt as-is.
Prompt rewriting mode. Supported by the qwen-image-3.0 series only.
direct(default): direct prompt enhancement (DPE). Suitable for most scenarios.agent: agent prompt enhancement (APE). Finer-grained rewriting; text-to-image only.
Add a "Qwen-Image" watermark to the bottom-right corner. Default: false.
Random number seed. Range: [0, 2147483647]. Same seed produces more consistent (but not identical) results. If omitted, a random seed is used.
Response
Show child attributes
Show child attributes
List of generated results. Contains one element per generated image.
Usage statistics (successful results only). Fields vary by model series: the qwen-image-3.0 series returns the output_* / input_* fields; other series return image_count / width / height.
Show child attributes
Show child attributes
Width of the final output image, in pixels. Returned by the qwen-image-3.0 series only.
Height of the final output image, in pixels. Returned by the qwen-image-3.0 series only.
Number of input images in the request. 0 for text-to-image; the actual input count for image editing. Returned by the qwen-image-3.0 series only.
Input image billing tier, determined by the output resolution pixel area: qima_input_1k when the area is 2,250,000 or less, qima_input_2k when greater. Returned by the qwen-image-3.0 series only.
Number of output images actually returned. Returned by the qwen-image-3.0 series only.
Output image billing tier, determined by the output resolution pixel area: qima_output_1k when the area is 2,250,000 or less, qima_output_2k when greater. Returned by the qwen-image-3.0 series only.
Number of images generated. Not returned by the qwen-image-3.0 series, which uses output_image_count instead.
Width of the generated image, in pixels. Not returned by the qwen-image-3.0 series, which uses output_width instead.
Height of the generated image, in pixels. Not returned by the qwen-image-3.0 series, which uses output_height instead.
Unique request identifier for tracing and troubleshooting.