Use Reference Image 1 only for the proud pigeon with the aviator scarf. Use Reference Image 2 only for the oversized croissant. Use Reference Image 3 only for the subway grab handle. In one continuous five-second shot, the Image 1 pigeon holds the Image 2 croissant in its beak and stands on the Image 3 subway handle, swaying with the train. Camera: waist-height handheld sway matching the subway motion. No cuts. Synchronized audio: subway rumble, a proud coo, a faint pastry flake crunch. No readable text, letters, numbers, captions, labels, logos, brands, watermarks, advertisements, posters, UI screens, or product packaging.
Wan 3.0 Reference-to-Video API
alibaba/wan-3.0/reference-to-videoWan 3.0(Reference-to-Video)将文本提示词与图像、视频、音频、文档或网页等多模态参考资产转化为动态视频,支持多达 20 项组合素材输入与 2–30 秒单次连续生成。它能够跨镜头稳定继承主体身份、艺术风格与叙事逻辑,同时结合输入资产合成原生音画同步的连贯影像。
输入
拖拽文件、粘贴剪贴板素材,或输入 URL。
3/10 个素材
拖拽文件、粘贴剪贴板素材,或输入 URL。
拖拽文件、粘贴剪贴板素材,或输入 URL。
输出
已就绪继续使用
示例
REST API 规格
快速开始
组合多模态参考素材与文本提示词提交任务,并轮询状态接口获取高清一致性视频结果。
第一步:配置 API 鉴权
在控制台申请 API Key,并在每个 HTTP 请求头中携带 Authorization: Bearer <API_KEY> 进行身份验证。
- 任务提交端点
- POST
https://api.vidgo.ai/api/generate/submit - 鉴权请求头
- Authorization: Bearer VIDGO_API_KEY
第二步:提交参考生视频任务
向 /api/generate/submit 端点发起 POST 请求,指定 model 为 alibaba/wan-3.0/reference-to-video,在 input 中填入 prompt 与参考素材数组。 可仅使用音频作为参考,仍须提供提示词。
REQUEST_BODY=$(cat <<'JSON'
{
"model": "alibaba/wan-3.0/reference-to-video",
"input": {
"prompt": "Use Reference Image 1 only for the proud pigeon with the aviator scarf. Use Reference Image 2 only for the oversized croissant. Use Reference Image 3 only for the subway grab handle. In one continuous five-second shot, the Image 1 pigeon holds the Image 2 croissant in its beak and stands on the Image 3 subway handle, swaying with the train. Camera: waist-height handheld sway matching the subway motion. No cuts. Synchronized audio: subway rumble, a proud coo, a faint pastry flake crunch. No readable text, letters, numbers, captions, labels, logos, brands, watermarks, advertisements, posters, UI screens, or product packaging.",
"duration": 5,
"resolution": "720p",
"aspect_ratio": "adaptive",
"audio": true,
"enable_safety_checker": true,
"reference_image_urls": [
"https://cdn.vidgo.ai/apis/models/alibaba/wan-3.0/reference-to-video/v1/01/input-01.jpg",
"https://cdn.vidgo.ai/apis/models/alibaba/wan-3.0/reference-to-video/v1/01/input-02.jpg",
"https://cdn.vidgo.ai/apis/models/alibaba/wan-3.0/reference-to-video/v1/01/input-03.jpg"
]
}
}
JSON
)
RESPONSE=$(curl --silent --show-error --fail-with-body \
--request POST \
--url "https://api.vidgo.ai/api/generate/submit" \
--header "Authorization: Bearer $VIDGO_API_KEY" \
--header "Content-Type: application/json" \
--data "$REQUEST_BODY")
CODE=$(printf '%s' "$RESPONSE" | jq -r '.code // empty')
if [ "$CODE" != "0" ] && [ "$CODE" != "200" ]; then
printf 'API error: %s
' "$RESPONSE" >&2
exit 1
fi
printf '%s
' "$RESPONSE"第三步:轮询任务执行结果
使用 task_id 查询进度;not_started 或 running 时继续轮询,finished 或 failed 时停止。成功后读取 data.files[].file_url,失败时读取 data.error_message。
状态查询端点
GET https://api.vidgo.ai/api/generate/status/{task_id}使用 task_id 查询进度;not_started 或 running 时继续轮询,finished 或 failed 时停止。成功后读取 data.files[].file_url,失败时读取 data.error_message。
not_startedrunningfinishedfailed{
"code": 200,
"data": {
"task_id": "task-wan30-r2v-774129",
"status": "running",
"created_time": "2026-09-16T08:40:00Z"
}
}{
"code": 200,
"data": {
"task_id": "task-unified-...",
"status": "finished",
"files": [
{
"file_url": "https://storage.vidgo.ai/generated/video.mp4",
"file_type": "video"
}
],
"created_time": "2026-08-22T10:00:00Z",
"progress": 100,
"error_message": null
}
}端到端完整脚本示例
展开查看在生产环境中具备轮询重试、异常保护和超时处理的完整自动化脚本。
set -euo pipefail
: "${VIDGO_API_KEY:?Set VIDGO_API_KEY in your environment}"
REQUEST_BODY=$(cat <<'JSON'
{
"model": "alibaba/wan-3.0/reference-to-video",
"input": {
"prompt": "Use Reference Image 1 only for the proud pigeon with the aviator scarf. Use Reference Image 2 only for the oversized croissant. Use Reference Image 3 only for the subway grab handle. In one continuous five-second shot, the Image 1 pigeon holds the Image 2 croissant in its beak and stands on the Image 3 subway handle, swaying with the train. Camera: waist-height handheld sway matching the subway motion. No cuts. Synchronized audio: subway rumble, a proud coo, a faint pastry flake crunch. No readable text, letters, numbers, captions, labels, logos, brands, watermarks, advertisements, posters, UI screens, or product packaging.",
"duration": 5,
"resolution": "720p",
"aspect_ratio": "adaptive",
"audio": true,
"enable_safety_checker": true,
"reference_image_urls": [
"https://cdn.vidgo.ai/apis/models/alibaba/wan-3.0/reference-to-video/v1/01/input-01.jpg",
"https://cdn.vidgo.ai/apis/models/alibaba/wan-3.0/reference-to-video/v1/01/input-02.jpg",
"https://cdn.vidgo.ai/apis/models/alibaba/wan-3.0/reference-to-video/v1/01/input-03.jpg"
]
}
}
JSON
)
SUBMIT_RESPONSE=$(curl --silent --show-error --fail-with-body \
--request POST \
--url "https://api.vidgo.ai/api/generate/submit" \
--header "Authorization: Bearer $VIDGO_API_KEY" \
--header "Content-Type: application/json" \
--data "$REQUEST_BODY")
TASK_ID=$(printf '%s' "$SUBMIT_RESPONSE" | jq -r '.data.task_id // .task_id // empty')
BUSINESS_CODE=$(printf '%s' "$SUBMIT_RESPONSE" | jq -r '.code // empty')
if [ "$BUSINESS_CODE" != "0" ] && [ "$BUSINESS_CODE" != "200" ]; then
printf 'Submit failed:
%s
' "$SUBMIT_RESPONSE" >&2
exit 1
fi
if [ -z "$TASK_ID" ]; then
printf 'Submit response did not include task_id:
%s
' "$SUBMIT_RESPONSE" >&2
exit 1
fi
START_TIME=$(date +%s)
POLL_DELAY=2
while true; do
if [ $(( $(date +%s) - START_TIME )) -ge 600 ]; then
printf 'Timed out after 600 seconds
' >&2
exit 1
fi
STATUS_RESPONSE=$(curl --silent --show-error --fail-with-body \
--url "https://api.vidgo.ai/api/generate/status/$TASK_ID" \
--header "Authorization: Bearer $VIDGO_API_KEY")
STATUS=$(printf '%s' "$STATUS_RESPONSE" | jq -r '.data.status // .status // empty')
BUSINESS_CODE=$(printf '%s' "$STATUS_RESPONSE" | jq -r '.code // empty')
if [ "$BUSINESS_CODE" != "0" ] && [ "$BUSINESS_CODE" != "200" ]; then
printf 'Status request failed:
%s
' "$STATUS_RESPONSE" >&2
exit 1
fi
case "$STATUS" in
finished)
printf '%s' "$STATUS_RESPONSE" | jq -r '(.data.files // .files // [])[]?.file_url'
break
;;
failed)
printf '%s' "$STATUS_RESPONSE" | jq -r '.data.error_message // .error_message // "Generation failed"' >&2
exit 1
;;
not_started|running)
sleep "$POLL_DELAY"
if [ "$POLL_DELAY" -lt 10 ]; then POLL_DELAY=$((POLL_DELAY + 1)); fi
;;
*)
printf 'Unexpected task status: %s
' "$STATUS" >&2
exit 1
;;
esac
done请求参数(input 对象)
向 /api/generate/submit 提交 POST 请求时,input 内部所支持的参考生视频参数:
| 字段 | 类型 | 必填 | 默认值 | 描述 |
|---|---|---|---|---|
| prompt | string | 是 | - | 描述生成场景、动作时序、镜头语言并指定参考资产角色的提示词,支持 1–20,000 字符。 |
| reference_image_urls | array[string] | 否 | [] | 参考图片 URL 数组(最多 10 张,单张 ≤30MB,支持 JPEG/PNG/WebP)。 |
| reference_video_urls | array[string] | 否 | [] | 最多 5 个公开 HTTP(S) 参考视频 URL,用于引导动作、运镜或节奏。 |
| reference_audio_urls | array[string] | 否 | [] | 参考音频 URL 数组(最多 5 个,单个 ≤50MB,支持 MP3/WAV)。 可作为唯一参考类型。 |
| reference_file_urls | array[string] | 否 | [] | 最多 1 个公开 HTTP(S) 文档 URL,与 reference_link_urls 互斥。 |
| reference_link_urls | array[string] | 否 | [] | 最多 1 个公开免登录网页 URL;与 reference_file_urls 互斥。 |
| duration | integer | 否 | 5 | 生成视频时长,支持 2–30 之间的整数秒。 |
| resolution | string | 否 | 720p | 分辨率枚举值,可选 480p、720p 或 1080p。 |
| aspect_ratio | string | 否 | adaptive | 画面比例,可选 adaptive(自适应参考)、16:9、4:3、1:1、3:4 或 9:16。 |
| audio | boolean | 否 | true | 是否伴随视频生成原生同步音轨,开启与关闭同价。 |
| seed | integer | 否 | - | 随机种子值(0–2,147,483,647),固定种子有助于重现类似走势。 |
| enable_safety_checker | boolean | 否 | true | 是否开启安全审查过滤。 |
响应字段(查询结果)
通过 GET /api/generate/status/{task_id} 轮询获取的任务详情:
| 字段 | 类型 | 描述 |
|---|---|---|
| code | integer | 业务响应状态码,200 表示成功。 |
| data.task_id | string | 异步任务全局唯一流水号。 |
| data.status | string | 任务执行阶段:not_started(排队中)、running(生成中)、finished(已完成)、failed(失败)。 |
| data.files | array | 生成成功时包含的成片文件列表,每项含 file_url 与 file_type。 |
| data.error_message | string | null | 任务执行异常时的具体错误描述。 |
任务生命周期
客户端应根据 status 字段判断任务进度,达到 finished 或 failed 终态时立即终止轮询:
not_started任务已提交,系统正在并行下载并解析输入的图片、视频、音频或文档资产。
running计算节点正在执行全模态跨素材特征对齐、扩散去噪计算与音轨渲染。
finished视频已生成并上传持久化存储,可从 data.files[0].file_url 获取播放及下载地址。
failed任务因素材下载失败、参数互斥校验不通过或安全审核终止,读取 data.error_message 获知原因。
轮询与异常处理
- 轮询频次推荐由于多模态素材下载与预解析耗时,建议提交后等待 3 秒开始首次轮询,后续每 3–5 秒查询一次。
- 参数互斥保护若同时传入了 reference_file_urls 和 reference_link_urls,接口将返回 400 校验错误并中止执行。
- 异步 Webhook 回调支持在提交请求体根层级传递 callback_url,在任务终态时系统将通过 POST 自动推送完整任务结果。
接口规格
| 规格项 | 取值 | 说明 |
|---|---|---|
| 模型标识 | alibaba/wan-3.0/reference-to-video | 请求体 model 字段传递的 API 调用路由标识。 |
| 输入模式 | 多模态参考资产(合计 ≤ 20 项) | 图片 ≤10,视频 ≤5,音频 ≤5,文档或网页 ≤1(互斥二选一),并配合文本提示词。 |
| 输出规格 | 30 fps / MP4 (H.264) | 标准 MP4 视频容器,内嵌 AAC 编码原生同步音轨。 |
| 单次时长 | 2–30 秒 | 支持在 2 到 30 秒闭区间内按整秒自由设置生成时长。 |
| 原生分辨率 | 480p / 720p / 1080p | 可选标清、高清与全高清三档原生输出分辨率,默认 720p。 |
相关模型
Wan 3.0 Reference-to-Video API — 常见问题
Wan 3.0 Reference-to-Video API 是什么?
Wan 3.0 Reference-to-Video 是阿里通义实验室研发的全模态参考生成视频模型。它支持组合文本提示词与图片、视频、音频、结构化文档或公开网页链接(总计多达 20 项参考资产),生成最长 30 秒、最高 1080p 的原生音画同步视频。基于多模态对齐与 Diffusion Transformer 架构,它能够跨镜头精准继承角色的面容外观、动作姿态或文档核心内容,实现高一致性的全新场景创作。你可以通过 API 进行程序化调用,也可以在上方体验区直接在线试用。
Wan 3.0 参考生视频能直接上传 PPT 或 PDF 出片吗?
可以。在 reference_file_urls 中传入一份结构化文档链接(支持 PPT、PPTX、PDF、DOCX、TXT、MD 等格式),模型能自动解析文档的图文结构与排版逻辑,并结合提示词转化为包含解说声场与动态运镜的专业讲解视频。
Wan 3.0 参考生视频能同时使用文档与网页链接吗?
不能。结构化文档(reference_file_urls)与网页链接(reference_link_urls)存在互斥约束,单次任务中只能二选一传入其一(最多 1 个)。如需补充更多视觉或声音参考,可搭配使用参考图片、视频或音频素材。
Wan 3.0 参考生视频最多支持传入几份参考资产?
单次调用总共支持传入最多 20 项素材组合,具体包括:最多 10 张参考图片、最多 5 个参考视频、最多 5 段参考音频,以及最多 1 个文档或网页链接。多素材组合极大丰富了复杂故事的创作灵活性。
如何在提示词中对 Wan 3.0 参考生视频的多主体进行点名?
建议使用分工指代语法,例如在提示词中写清“使用参考图 1 确定主角面容与风衣,使用参考图 2 确定手持道具,使用参考视频 1 引导行走步伐”。精准的点名指代能让模型将不同素材的特征分别绑定到对应实体。
传入参考音频后 Wan 3.0 参考生视频如何处理声音?
当传入 reference_audio_urls 时,模型会提取参考音频的音色、语调或旋律节奏,并将其与视频画面的主体动作、口型动态及环境底噪有机融合,生成音画节奏自然契合的视听成片。
如何提供文档参考?
在 reference_file_urls 中提供一个公开可访问的 HTTP(S) 文档 URL,不要同时提供 reference_link_urls。















