Wan-I2V

复制成功!
加入对比
视频生成

概述

视频生成

全新升级的万相2.2图生视频,生成速度更快。优化视频生成稳定性与成功率,更强大的指令遵循能力,稳定保持图片文字、人像和商品一致性,精准运镜控制。

输入

图像

输出

视频

功能

前缀补全

您可在调用通义千问 API 时启用 Partial Mode,确保模型严格基于您的起始文本进行生成。查看文档

函数调用

您可以使用 函数调用 功能,通过引入外部工具,使得大模型可以与外部世界进行交互。查看文档

缓存

Context Cache 技术会缓存长上下文请求的公共前缀,减少推理时的重复计算,提升响应速度同时降低您的使用成本。查看文档

结构化输出

开启结构化输出功能可以确保大模型输出标准格式的 JSON 字符串。查看文档

批量任务

联网搜索

启用联网检索功能后,模型将基于实时检索数据进行回复。查看文档

微调

定价

  • 视频生成(480P)
    ¥0.1每秒
  • 视频生成(720P)
    ¥0.2每秒
  • 视频生成(1080P)
    ¥0.48每秒

速率限制

  • RPM每分钟请求数
    120
  • 并发
    2并发
  • 异步队列上限
    500个任务

API 参考

获取 API Key
复制成功!
123456789101112131415161718192021222324252627282930313233343536373839404142434445
import os
from http import HTTPStatus
from dashscope import VideoSynthesis
import dashscope

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

# 从环境变量中获取 DashScope API Key(即阿里云百炼平台 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-flash',
                                    prompt='一只猫在草地上奔跑',
                                    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()