Wan - Image to Video

Copy success!
Add to Compare

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 docs

Function Calling

Use function calling to connect large language models with external tools and systems.View docs

Cache

Context Cache stores shared prefixes for long-context requests to reduce repeated computation, improve latency, and lower cost.View docs

Structured Outputs

Structured Outputs help ensure the model returns a JSON string in the expected format.View docs

Batches

Asynchronously process requests in batches to reduce costs.View docs

Web Search

Enable web search so the model can answer with real-time retrieved data.View docs

Fine-tuning

Train models on sample data to better adapt them to specific tasks.View docs

Pricing

  • Video Generation(480P)
    $0.015Per second
  • Video Generation(720P)
    $0.036Per second
  • Video Generation(1080P)
    $0.07Per second

Rate Limits

  • Concurrency
    2concurrent
  • Async Queue Limit
    500tasks
  • RPMRequests Per Minute
    120

API Reference

Call API
Copy 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()