Asynchronous Image Generation Call
/api/v1/image/generationHeader Parameters
Use Bearer Token authentication. Format: Authorization: Bearer sk-xxxxxx
Configuration parameters for asynchronous processing. HTTP requests only support asynchronous mode and must be set to enable. Currently, only the qwen-image-plus and qwen-image models support asynchronous API calls.
Request Body
application/json
Model name, fixed value: qwen-image-plus
"qwen-image-plus"Basic input information, such as prompts.
Positive prompt, used to describe the desired elements and visual characteristics to be included in the generated image. Supports both Chinese and English, with a maximum length of 800 characters. Each Chinese character, letter, number, or symbol counts as one character, and any excess will be automatically truncated. Example value: A sitting orange cat with a cheerful expression, lively and cute, realistic and accurate.
Negative prompt, used to describe unwanted content in the image and restrict the visual output. Supports both Chinese and English, with a maximum length of 500 characters; any excess will be automatically truncated. Example values: low resolution, low quality, deformed limbs, deformed fingers, oversaturated image, waxy appearance, lack of facial details, overly smooth, AI-generated look. Messy composition. Blurred and distorted text.
Image processing parameters.
qwen-image fixed resolution: 1664x928; qwen-image-max and qwen-image-plus series models: default resolution is 1664928. Available resolutions and their corresponding image aspect ratios are: 1664928 (default): 16:9; 14721104: 4:3; 13281328: 1:1; 11041472: 3:4; 9281664: 9:16.
The number of output images, with a default value of 1. For the qwen-image-max and qwen-image-plus series models, this parameter is fixed at 1, and setting it to any other value will result in an error.
Whether to enable the intelligent Prompt rewriting feature. When enabled, the model will optimize and refine the positive prompts. This feature does not modify negative prompts. true: Default value, enables intelligent rewriting. Enable this option if you want more diverse image content and allow the model to add details. false: Disables intelligent rewriting. Disable this option if you prefer greater control over image details.
Whether to add a "Qwen-Image" watermark to the bottom-right corner of the image. The default value is false.
Random seed, value range [0, 2147483647]. Using the same seed parameter value keeps the generated content relatively stable. If not provided, the algorithm will automatically use a random seed. Note: The model generation process is probabilistic; even with the same seed, identical results cannot be guaranteed across generations.
Response Body
application/json
Success
TypeScript Definitions
Use the response body type in TypeScript.
Status Code
Data Object
Result Set
Consumption Information
Number of Images
Video Seconds
Input Tokens
Total Tokens
Output Token Count
Validity Period
Task ID
Task Status
Status Information
Request ID
curl -X POST "https://api.ygw.ai/api/v1/image/generation" \ -H "Content-Type: application/json" \ -d '{ "model": "qwen-image-plus", "input": { "prompt": "string", "negative_prompt": "string" } }'{
"code": 0,
"data": {
"urls": [
"string"
],
"usage": {
"images": 0,
"seconds": 0,
"input_tokens": 0,
"total_tokens": 0,
"output_tokens": 0
},
"expired": "string",
"task_id": "string",
"task_status": "string"
},
"message": "string",
"request_id": "string"
}