Image-to-Video - First Frame 2.1-2.6
/api/v1/video/generationHeader Parameters
Format: Authorization: Bearer sk-xxxxxx
Configuration parameters for asynchronous processing. HTTP requests only support asynchronous mode and must be set to enable.
Request Body
application/json
Model name, fixed value: wan2.6-i2v wan2.5-i2v-preview wan2.6-i2v-flash
"wan2.6-i2v" | "wan2.5-i2v-preview" | "wan2.6-i2v-flash"Basic input information, such as prompts.
Text prompt. Used to describe the desired elements and visual characteristics in the generated image. Supports both Chinese and English, where each Chinese character or letter counts as one character, and any excess is automatically truncated. The length limit varies by model version: for the wan2.6 and wan2.5 series models, the length must not exceed 1500 characters. When using video effect parameters (i.e., when template is not empty), the prompt parameter is invalid and does not need to be filled in.
Negative prompts are used to describe unwanted content in the video, allowing you to impose restrictions on the video output. Both Chinese and English are supported, with a maximum length of 500 characters; any excess will be automatically truncated. Example values: low resolution, errors, worst quality, low quality, deformities, extra fingers, bad proportions, etc.
URL or Base64-encoded data of the first frame image. Image limitations: Image formats: JPEG, JPG, PNG (alpha channel not supported), BMP, WEBP. Image resolution: Image width and height range from 240 to 8000 pixels. File size: wan2.6 and wan2.5 series models: up to 20MB.
The URL of the audio file, which the model will use to generate the video. Audio limitations: Format: wav, mp3. Duration: 3-30s. File size: up to 15MB. Over-limit handling: If the audio length exceeds the duration value (5s or 10s), the first 5s or 10s are automatically extracted and the rest is discarded. If the audio length is shorter than the video duration, the portion exceeding the audio length will be silent. For example, if the audio is 3s and the video duration is 5s, the first 3s of the output video will have sound, and the last 2s will be silent.
The name of the video effect template. If left blank, no video effect is applied. Example value: flying, indicating the use of the Magic Levitation effect.
Video processing parameters, such as setting video resolution, setting video duration, enabling intelligent prompt rewriting, adding watermarks, etc.
Specifies the resolution tier for the generated video to adjust its clarity (total pixels). The model automatically scales to a similar total pixel count based on the selected resolution tier, and the video aspect ratio will be kept as consistent as possible with the aspect ratio of the input image img_url. The default value and available enum values for this parameter depend on the model parameter, with the following rules: wan2.6-i2v-flash: Available values: 720P, 1080P. Default value: 1080P. wan2.6-i2v: Available values: 720P, 1080P. Default value: 1080P. wan2.5-i2v-preview: Available values: 480P, 720P, 1080P. Default value: 1080P.
The duration of the generated video, in seconds. The value of this parameter depends on the model parameter: wan2.6-i2v-flash: an integer in the range [2, 15]. The default value is 5. wan2.6-i2v: an integer in the range [2, 15]. The default value is 5. wan2.5-i2v-preview: valid values are 5 and 10. The default value is 5.
Whether to enable intelligent prompt rewriting. When enabled, a large model is used to intelligently rewrite the input prompt. This significantly improves generation quality for shorter prompts, but increases latency. true: Default value, enables intelligent rewriting. false: Disables intelligent rewriting.
Specifies the shot type for the generated video, indicating whether the video consists of a single continuous shot or multiple switching shots. Effective condition: Takes effect only when "prompt_extend": true. Parameter priority: shot_type > prompt. For example, if shot_type is set to "single", even if the prompt contains "generate a multi-shot video", the model will still output a single-shot video. Available values: single: Default value, outputs a single-shot video; multi: Outputs a multi-shot video.
Specifies whether to add a watermark. The watermark is located in the bottom right corner of the video with the fixed text "AI-generated". false: Default value, no watermark is added. true: Add a watermark.
Random seed, with a value range of [0, 2147483647].
Response Body
application/json
Success
TypeScript Definitions
Use the response body type in TypeScript.
Status Code
Data Object
Result Set
Usage Information
Image Count
Video Duration in 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/video/generation" \ -H "Authorization: string" \ -H "X-DashScope-Async: string" \ -H "Content-Type: application/json" \ -d '{ "model": "wan2.6-i2v", "input": { "img_url": "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"
}