Wan - Image to Video
Copy success!
Overview
The all-new Wan2.2 First and Last Frame to video model is here. We’ve optimized motion stability and success rates, enhanced prompt adherence, and enabled seamless transitions between two images.
Input
ImageText
Output
Video
Features
Prefix Completion
Enable Partial Mode when calling the Qwen API to make the model continue strictly from your provided prefix text.View docsFunction Calling
Use function calling to connect large language models with external tools and systems.View docsCache
Context Cache stores shared prefixes for long-context requests to reduce repeated computation, improve latency, and lower cost.View docsStructured Outputs
Structured Outputs help ensure the model returns a JSON string in the expected format.View docsPricing
- Video Generation(480P)$0.015Per second
- Video Generation(720P)$0.036Per second
- Video Generation(1080P)$0.07Per second
Rate Limits
- Concurrency2concurrent
- Async Queue Limit500tasks
- RPMRequests Per Minute120
API Reference
Call APICopy success!
12345678910111213141516171819202122232425262728293031
import os
from http import HTTPStatus
from dashscope import VideoSynthesis
import dashscope
dashscope.base_http_api_url = 'https://ap-southeast-1.maas.qwencloudapi.com/api/v1'
# --- Preparation: Make sure API key is set ---
api_key = os.getenv("DASHSCOPE_API_KEY")
first_frame_url = "https://wanx.alicdn.com/material/20250318/first_frame.png"
last_frame_url = "https://wanx.alicdn.com/material/20250318/last_frame.png"
def sample_sync_call_kf2v():
rsp = VideoSynthesis.call(api_key=api_key,
model="wan2.2-kf2v-flash",
prompt="Realistic style, a small black cat curiously looks up at the sky, and the camera starts at eye level and gradually rises, ending with a top-down shot of the cat's curious gaze.",
first_frame_url=first_frame_url,
last_frame_url=last_frame_url,
resolution="720P",
prompt_extend=True)
print(rsp)
if rsp.status_code == HTTPStatus.OK:
print(rsp.output.video_url)
else:
print('Failed, status_code: %s, code: %s, message: %s' %
(rsp.status_code, rsp.code, rsp.message))
if __name__ == '__main__':
sample_sync_call_kf2v()