Asynchronous Image Generation Call 2.5
/api/v1/image/generationHeader Parameters
Use Bearer Token authentication. Format: Authorization: Bearer sk-xxxxxx
Configuration parameters for asynchronous processing. HTTP requests only support asynchronous processing and must be set to enable.
Request Body
application/json
Model name, fixed value: wan2.5-t2i-preview
"wan2.5-t2i-preview"Basic input information.
Positive prompt, used to describe the desired elements and visual characteristics to be included in the generated image. Supports Chinese and English. Each Chinese character, letter, or punctuation mark counts as one character, and any excess will be automatically truncated. The length must not exceed 2000 characters. Example value: A sitting orange cat with a cheerful expression, lively and adorable, realistic and accurate.
Negative prompt, used to describe unwanted elements in the image to restrict the generated content. Supports both Chinese and English with a maximum length of 500 characters; any excess will be automatically truncated. Example values: low resolution, errors, worst quality, low quality, deformed, extra fingers, bad proportions, etc.
Image processing parameters.
The resolution of the output image, in the format of widthheight. The default value is 12801280. The total pixels must be within [12801280, 14401440] and the aspect ratio must be in the range of [1:4, 4:1]. For example, 7682700 meets the requirements. Example value: 12801280. The following resolutions are applicable to wan2.5-t2i-preview: 1:1: 12801280 3:4: 11041472 4:3: 14721104 9:16: 9601696 16:9: 1696960 1:1: 12801280 3:4: 11041472 4:3: 14721104 9:16: 9601696 16:9: 1696960.
The number of images to generate. The value ranges from 1 to 4, with a default of 4. Note: Billed 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, which significantly enhances the output for shorter prompts but adds 3-4 seconds of latency. true: Default value, enables intelligent rewriting. false: Disables intelligent rewriting.
Specifies 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 is added. true: Add a watermark.
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, and even with the same seed, completely identical generation results cannot be guaranteed every time.
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 Token Count
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.5-t2i-preview", "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"
}