Qwen Text to Image
Calls Ali qwen-image-2.0-pro to perform text-to-image generation.
The public calling convention keeps top-level model, input, response_format, and exposes n, size, negative_prompt, prompt_extend, watermark, seed as top-level fields. The prompt is placed in input.messages[0].content[0].text. The request body does not accept a top-level parameters field.
Authorizations
Pass Authorization: Bearer <token> in the request header.
Body
Model name. Example: qwen-image-2.0-pro.
qwen-image-2.0-pro Response format. url returns an image download link; b64_json returns Base64-encoded image data. Default is url.
url, b64_json Number of output images. Default is 1. For the qwen-image-2.0 series, you can generate 1-6 images.
1 <= x <= 6Output image resolution in width*height format. For the qwen-image-2.0 series, total output pixels must be between 512*512 and 2048*2048, and the default resolution is 2048*2048. Recommended resolutions: 2688*1536 (16:9), 1536*2688 (9:16), 2048*2048 (1:1, default), 2368*1728 (4:3), and 1728*2368 (3:4).
Negative prompt used to describe content that should not appear in the image and to constrain the image. Chinese and English are supported. Maximum length is 500 characters; extra content is automatically truncated. Example: low resolution, low quality, malformed limbs, malformed fingers, oversaturated image, wax figure appearance, no facial details, overly smooth, AI-like image, chaotic composition, blurry or distorted text.
Whether to enable smart prompt rewriting. When enabled, the model optimizes and polishes the positive prompt. This feature does not modify the negative prompt. true (default): enabled, recommended for more diverse content. false: disabled, recommended for more controllable details.
Whether to add a "Qwen-Image" watermark in the lower-right corner of the image. Default is false.
Random seed. Range [0, 2147483647]. Using the same seed value can make generated content relatively stable. If omitted, the algorithm automatically uses a random seed. Note: generation is probabilistic, so the same seed cannot guarantee identical results every time.
x >= 0