Wan - Image to Video

Copy success!
Add to Compare

Overview

The upgraded Wan 2.2 Plus image to video model, delivers higher quality results with optimized stability, more powerful prompt following, improved consistency for text, portraits, and products, and precise shot control.

Input

TextImage

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.02Per second
  • Video Generation(1080P)
    $0.1Per second

Rate Limits

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

API Reference

Call API
Copy success!
123456789101112131415161718192021222324252627282930313233343536373839404142434445
import os
from http import HTTPStatus
from dashscope import VideoSynthesis
import dashscope

dashscope.base_http_api_url = 'https://dashscope-intl.aliyuncs.com/api/v1'

# Get DashScope API Key from environment variable (Model Studio API key)
api_key = os.getenv("DASHSCOPE_API_KEY")

img_url = "https://cdn.translate.alibaba.com/r/wanx-demo-1.png"

def sample_async_call_i2v():
    # call async api, will return the task information
    # you can get task status with the returned task id.
    rsp = VideoSynthesis.async_call(model='wan2.2-i2v-plus',
                                    prompt='A cat running on the grass',
                                    img_url=img_url)
    print(rsp)
    if rsp.status_code == HTTPStatus.OK:
        print("task_id: %s" % rsp.output.task_id)
    else:
        print('Failed, status_code: %s, code: %s, message: %s' %
              (rsp.status_code, rsp.code, rsp.message))
   
    # get the task information include the task status.
    status = VideoSynthesis.fetch(rsp)
    if status.status_code == HTTPStatus.OK:
        print(status.output.task_status)  # check the task status
    else:
        print('Failed, status_code: %s, code: %s, message: %s' %
              (status.status_code, status.code, status.message))

    # wait the task complete, will call fetch interval, and check it's in finished status.
    rsp = VideoSynthesis.wait(rsp)
    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_async_call_i2v()