The Wan I2V model supports generating smoothly transitioned videos based on a first frame image, a last frame image, and a text prompt.
- Video specifications: Fixed video duration (5 s), with a specified video resolution (480P/720P/1080P).
- Other capabilities: Also supports intelligent prompt rewriting and adding watermarks.
QuickStart
| Enter a prompt | Enter a first frame image | Enter a last frame image | Output video (silent video) |
| A cute blue little monster with a slightly sad expression stands in the rain. The camera slowly zooms in, freezing on the moment the monster raises its head to gaze up at the sky. | ![]() | ![]() |
- Python SDK
- Java SDK
- curl
The video_url is valid for 24 hours. Download the video promptly.
Scope
- The models supported vary by region, and resources are independent of each other. For the models supported in each region, see the Model Studio console.
- When you make a call, make sure that the model, Endpoint URL, and API Key belong to the same region. Cross-region calls will fail.
Core capabilities
First and last frame video generation
Supported models: All models.
Description: Generates a smoothly transitioned video (silent video) based on the first and last frames.
Parameter settings:
first_frame_url: Required. You must provide the first frame image.last_frame_url: Required. You must provide the last frame image.prompt: Optional but recommended. It controls the changes in the video frames.
| Enter a prompt | Enter a first frame image | Enter a last frame image | Output video (silent video) |
| Realistic style, a curious little black cat looking up at the sky, with the camera gradually rising from eye level and finally capturing its curious gaze from a bird's-eye view. | ![]() | ![]() |
- Python SDK
- Java SDK
- curl
Make sure the DashScope Python SDK version is 2.0.1 or later. For updates, see Install SDK.
How to input images
- Image count: one first frame image and one last frame image.
- Input methods: image URL, local file path.
Method 1: Image URL (HTTP API, SDK) Recommended
Method 1: Image URL (HTTP API, SDK) Recommended
- Public URL: HTTP or HTTPS protocols are supported. Example: https://xxxx/xxx.png.
Method 2: Local file path (SDK only)
Method 2: Local file path (SDK only)
Operating system | File path to pass in | Example (absolute path) | Example (relative path) |
|---|---|---|---|
Linux / macOS | file:/{absolute or relative path of the file} | file:///home/images/test.png | file://./images/test.png |
Windows | file://D:/images/test.png | file://./images/test.png |
Operating system | File path to pass in | Example (absolute path) |
|---|---|---|
Linux / macOS | file:/{absolute path of the file} | file:///home/images/test.png |
Windows | file://{absolute path of the file} | file:///D:/images/test.png |
Sample code: multiple ways to input images
Output videos
- Video count: one.
- Video specifications: Output specifications vary by model. For details, see Video specifications.
- Video URL validity: 24 hours.
-
Video dimensions: determined by the input first frame image and the
resolutionyou set.- The model tries to keep the aspect ratio of the input first frame image unchanged while scaling the total pixel count close to the target value. Due to encoding standards, the width and height of the output video must be divisible by 16, and the model automatically fine-tunes the dimensions.
- For example: an input image of 750×1000 (aspect ratio 3:4 = 0.75) with resolution = "720P" (target total pixels of about 920,000) may produce a final output of 816 × 1104 (aspect ratio ≈ 0.739, total pixels ≈ 900,000), where both the width and height are multiples of 16.
Billing and rate limits
- For the model free quota and billing unit prices, see Model pricing.
- For model rate limits, see Wan series.
-
Billing details:
- Input is not billed; output is billed. Output is billed by the seconds of video successfully generated.
- Failed model calls or processing errors do not incur any charges and do not consume the new user free quota.
- I2V also supports the savings plan.
API reference
I2V based on first and last frames API reference
FAQ
Q: How do I generate a video with a specific aspect ratio (such as 3:4)?
A: Currently, the API does not support directly specifying the video aspect ratio. You can only set the video resolution through the resolution parameter.
The resolution parameter controls the total number of pixels in the video, rather than strictly fixing the aspect ratio. The model prioritizes preserving the original aspect ratio of the first frame image (first_frame_url) and makes minor adjustments on that basis to meet video encoding requirements (that is, both the width and height must be multiples of 16). Therefore, if you want the output to be close to a 3:4 video, we recommend uploading a first frame image with a 3:4 aspect ratio, and the model will maintain that ratio as closely as possible.
For example: with an input image of 750×1000 (aspect ratio 3:4 = 0.75) and resolution set to "720P" (target total pixels of approximately 920,000), the final output may be 816 × 1104 (aspect ratio ≈ 0.739, total pixels ≈ 900,000), with both the width and height being multiples of 16.
Q: Why does the "url error, please check url!" error occur when running SDK code?
A: Please ensure that:
- The DashScope Python SDK version is 2.0.1 or later.
- The DashScope Java SDK version is
2.22.6or later.



