跳转到主要内容
PixVerse

爱诗 PixVerse — 创建任务

提交 PixVerse 视频动作模仿任务

POST
/services/aigc/video-generation/video-synthesis
cURL - 视频动作模仿
curl --location 'https://dashscope.aliyuncs.com/api/v1/services/aigc/video-generation/video-synthesis' \
  -H 'X-DashScope-Async: enable' \
  -H "Authorization: Bearer $DASHSCOPE_API_KEY" \
  -H 'Content-Type: application/json' \
  -d '{
    "model": "pixverse/pixverse-motioncontrol",
    "input": {
        "media": [
            {
                "type": "image_url",
                "url": "https://help-static-aliyun-doc.aliyuncs.com/file-manage-files/zh-CN/20250919/adsyrp/move_input_image.jpeg"
            },
            {
                "type": "video_url",
                "url": "https://help-static-aliyun-doc.aliyuncs.com/file-manage-files/zh-CN/20250919/kaakcn/move_input_video.mp4"
            }
        ]
    },
    "parameters": {
        "resolution": "720P",
        "watermark": true
    }
}'
{
  "request_id": "4909100c-7b5a-9f92-bfe5-xxxxxx",
  "output": {
    "task_id": "0385dc79-5ff8-4d82-bcb6-xxxxxx",
    "task_status": "PENDING"
  }
}
传入角色图片和动作参考视频,将视频中的动作迁移到角色上,生成角色复现相同动作的新视频。适用于动作模仿、编舞复刻、角色动画生成等场景。
  • Python SDK
from http import HTTPStatus
from dashscope import VideoSynthesis
import dashscope
import os

# 若没有配置环境变量,请用千问AI平台API Key将下行替换为:api_key="sk-xxx"
# 获取API Key:https://platform.qianwenai.com/home/api-keys
api_key = os.getenv("DASHSCOPE_API_KEY")

media = [{'type': 'image_url', 'url': 'https://help-static-aliyun-doc.aliyuncs.com/file-manage-files/zh-CN/20250919/adsyrp/move_input_image.jpeg'}, {'type': 'video_url', 'url': 'https://help-static-aliyun-doc.aliyuncs.com/file-manage-files/zh-CN/20250919/kaakcn/move_input_video.mp4'}]

def sample_async_call():
    # 异步提交视频生成任务
    rsp = VideoSynthesis.async_call(api_key=api_key,
                                model='pixverse/pixverse-motioncontrol',
                                media=media,
                                resolution='720P',
                                watermark=True)
    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))

    # 查询任务状态
    status = VideoSynthesis.fetch(task=rsp, api_key=api_key)
    if status.status_code == HTTPStatus.OK:
        print(status.output.task_status)
    else:
        print('Failed, status_code: %s, code: %s, message: %s' %
              (status.status_code, status.code, status.message))

    # 等待任务完成
    rsp = VideoSynthesis.wait(task=rsp, api_key=api_key)
    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()

鉴权

string
header
必填

千问AI平台 API Key。详见获取 API Key

Header 参数

enum<string>
必填

异步处理配置参数。HTTP 请求只支持异步,必须设置为 enable。缺少此请求头将报错:"current user api does not support synchronous calls"。

enable

请求体

application/json
enum<string>
必填

模型名称。固定值:pixverse/pixverse-motioncontrol

pixverse/pixverse-motioncontrol
pixverse/pixverse-motioncontrol
object
必填

输入的基本信息,包括角色图片和动作视频。

object
必填

视频生成参数。如设置输出视频清晰度、是否添加水印等。

响应

200-application/json
string

请求唯一标识。可用于请求明细溯源和问题排查。

4909100c-7b5a-9f92-bfe5-xxxxxx
object

任务输出信息。