Vidu Q2-Pro 视频生成

查看 Markdown 原文

概述

Vidu Q2-Pro 高质量版,支持文生视频(t2v)、图生视频(i2v)、首尾帧生视频(se2v),视频时长 1-10 秒。

Base URL: https://api.apiverse.ai


认证方式

Authorization: Bearer {YOUR_AUTH_TOKEN}

快速开始

创建文生视频任务

curl -X POST "https://api.apiverse.ai/api/v2/open/aigc/vidu-q2-pro" \
  -H "Authorization: Bearer your_auth_token_here" \
  -H "Content-Type: application/json" \
  -d '{
    "prompt": "无人机航拍,城市日落,金色光芒洒满高楼",
    "genType": "t2v",
    "resolution": "1080P",
    "aspectRatio": "16:9",
    "duration": 5
  }'

创建首尾帧生视频任务

curl -X POST "https://api.apiverse.ai/api/v2/open/aigc/vidu-q2-pro" \
  -H "Authorization: Bearer your_auth_token_here" \
  -H "Content-Type: application/json" \
  -d '{
    "prompt": "人物从站立到坐下的过渡动画",
    "genType": "se2v",
    "imageUrls": ["https://example.com/start_frame.jpg", "https://example.com/end_frame.jpg"],
    "resolution": "1080P",
    "duration": 5
  }'

查询任务状态

curl -X GET "https://api.apiverse.ai/api/v2/open/aigc/task_abc123" \
  -H "Authorization: Bearer your_auth_token_here"

创建任务

POST /api/v2/open/aigc/vidu-q2-pro

Content-Type: application/json

请求参数

参数类型必填说明
promptstring提示词,最多1500字符
genTypestring生成类型,默认 t2v
imageUrlsstring[]条件参考图片URL(i2v: 1张, se2v: 2张)
base64FilestringBase64编码的图片(替代imageUrls)
base64FileListstring[]Base64编码的多张图片
resolutionstring分辨率:720P / 1080P(默认) / 2K / 4K
aspectRatiostring宽高比:16:9(默认) / 9:16 / 1:1 / 4:3 / 3:4
durationint视频时长(秒),默认5,范围 1-10
callbackUrlstring任务完成后的回调通知URL

支持的 genType

genType说明imageUrls 要求
t2v文生视频不需要
i2v图生视频1张图片
se2v首尾帧生视频2张图片(首帧+尾帧)

请求示例

文生视频:

{
  "prompt": "无人机航拍,城市日落,金色光芒洒满高楼",
  "genType": "t2v",
  "resolution": "1080P",
  "aspectRatio": "16:9",
  "duration": 8
}

图生视频:

{
  "prompt": "让图片中的花朵随风摇曳",
  "genType": "i2v",
  "imageUrls": ["https://example.com/flower.jpg"],
  "resolution": "1080P",
  "duration": 5
}

首尾帧生视频:

{
  "prompt": "人物从站立到坐下的自然过渡",
  "genType": "se2v",
  "imageUrls": [
    "https://example.com/start_frame.jpg",
    "https://example.com/end_frame.jpg"
  ],
  "resolution": "1080P",
  "duration": 5
}

响应参数

参数类型说明
codeint状态码,0 表示成功
msgstring状态信息
data.taskIdstring任务 ID
data.statusstring固定为 processing
data.createdAtstring创建时间

响应示例

{
  "code": 0,
  "msg": "success",
  "data": {
    "taskId": "task_20260507103000_abc12345",
    "status": "processing",
    "createdAt": "2026-05-07 10:30:00"
  }
}

查询任务状态

GET /api/v2/open/aigc/{taskId}

响应参数

参数类型说明
codeint状态码,0 表示成功
msgstring状态信息
data.taskIdstring任务 ID
data.statusstringprocessing / success / failed
data.resultstring[]生成的视频 URL 列表(成功时返回)
data.errorMsgstring错误信息(失败时返回)
data.createdAtstring创建时间
data.updatedAtstring更新时间

响应示例

{
  "code": 0,
  "msg": "success",
  "data": {
    "taskId": "task_20260507103000_abc12345",
    "status": "success",
    "result": [
      "https://fc-gw-sh.oss-accelerate.aliyuncs.com/videos/2026/05/07/output_001.mp4"
    ],
    "createdAt": "2026-05-07 10:30:00",
    "updatedAt": "2026-05-07 10:32:30"
  }
}

批量查询任务状态

POST /api/v2/open/aigc/batch

{
  "taskIds": ["task_20260507103000_abc12345", "task_20260507103200_def67890"]
}

回调通知

当任务完成时,如果提供了 callbackUrl,系统会发送 POST 请求:

{
  "event": "task.completed",
  "taskId": "task_20260507103000_abc12345",
  "status": "success",
  "result": ["https://fc-gw-sh.oss-accelerate.aliyuncs.com/videos/output_001.mp4"],
  "errorMsg": "",
  "timestamp": "2026-05-07T10:32:30+08:00"
}

错误码

code说明
0成功
10002参数缺失或格式错误
10005API Key 无效或缺失
30003任务不存在
90003服务器内部错误