Asynchronous Image Generation Call 2.6
/api/v1/image/generationHeader Parameters
Use Bearer Token authentication. Format: Authorization: Bearer sk-xxxxxx
Configuration parameter for asynchronous processing. Add this parameter and set it to enable when making asynchronous calls to wan2.6-t2i.
Request Body
application/json
Model name, fixed value: wan2.6-t2i
"wan2.6-t2i"Basic input information.
Request content array. Currently, only single-turn conversations are supported, i.e., passing a single set of role and content parameters; multi-turn conversations are not supported.
The role of the message. This parameter must be set to user.
Positive prompt, used to describe the desired content, style, and composition of the generated image. Supports both Chinese and English, with a maximum length of 2100 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. Note: Only one text parameter is supported; passing none or multiple will result in an error.
Image processing parameters.
Negative prompt, used to describe content you do not want to appear in the image, restricting 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, chaotic composition, blurry and distorted text.
The resolution of the output image, in the format of widthheight. The default value is 12801280. The total pixel count is within [12801280, 14401440] and the aspect ratio is within the range of [1:4, 4:1]. For example, 7682700 meets the requirements. Example value: 12801280. Recommended resolutions for common aspect ratios: 1:1: 12801280; 3:4: 11041472; 4:3: 14721104; 9:16: 9601696; 16:9: 1696*960.
The number of images to generate. Valid values range from 1 to 4, with a default of 4. Note: Billing is per image; it is recommended to set this to 1 for testing.
Whether to enable intelligent prompt rewriting. When enabled, a large model will be used to optimize positive prompts, significantly improving shorter prompts but adding 3-4 seconds of latency. true: Default value, enables intelligent rewriting. false: Disables intelligent rewriting.
Whether to add a watermark. The watermark is located in the bottom right corner of the image, with the fixed text "AI-generated". false: Default value, no watermark added. true: Add watermark.
Random seed, value range [0, 2147483647]. Using the same seed parameter value helps maintain relatively stable generated content. If not provided, the algorithm will automatically use a random seed. Note: The model generation process is probabilistic, so 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
Usage Information
Number of Images
Video Duration in Seconds
Input Token Count
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": "wan2.6-t2i", "input": { "messages": [ { "role": "string", "text": "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"
}