万相-参考生视频模型支持多模态输入,可将人或物体作为主角,生成单角色表演或多角色互动视频。
相关文档:使用指南
适用范围
为确保调用成功,请务必保证模型、Endpoint URL 和 API Key 均属于同一地域。跨地域调用将会失败。
选择模型:确认模型所属的地域。
选择 URL:选择对应的地域 Endpoint URL,支持HTTP URL。
配置 API Key:选择地域并获取API Key,再配置API Key到环境变量。
本文的示例代码适用于北京地域。
HTTP调用
此接口为新版协议,支持wan2.7模型。
由于视频生成任务耗时较长(通常为1-5分钟),API采用异步调用。整个流程包含 “创建任务 -> 轮询获取” 两个核心步骤,具体如下:
步骤1:创建任务获取任务ID
北京
POST https://dashscope.aliyuncs.com/api/v1/services/aigc/video-generation/video-synthesis
新加坡
POST https://dashscope-intl.aliyuncs.com/api/v1/services/aigc/video-generation/video-synthesis
创建成功后,使用接口返回的
task_id查询结果,task_id 有效期为 24 小时。请勿重复创建任务,轮询获取即可。新手指引请参见Postman。
请求参数 | 多主体参考(图像+视频+音色)传入多张参考素材(图像+视频),并指定音色生成视频。 单图参考(多宫格图像)传入一张九宫格参考图,可以控制故事走向、机位构图与角色设定,生成视频。 |
请求头(Headers) | |
Content-Type 请求内容类型。此参数必须设置为 | |
Authorization 请求身份认证。接口使用阿里云百炼API-Key进行身份认证。示例值:Bearer sk-xxxx。 | |
X-DashScope-Async 异步处理配置参数。HTTP请求只支持异步,必须设置为 重要 缺少此请求头将报错:“current user api does not support synchronous calls”。 | |
请求体(Request Body) | |
model 模型名称。模型列表与价格详见模型价格。 示例值:wan2.7-r2v。 | |
input 输入的基本信息,如提示词等。 | |
parameters 视频处理参数,如设置视频分辨率。 |
响应参数 | 成功响应请保存 task_id,用于查询任务状态与结果。 异常响应创建任务失败,请参见错误信息进行解决。 |
output 任务输出信息。 | |
request_id 请求唯一标识。可用于请求明细溯源和问题排查。 | |
code 请求失败的错误码。请求成功时不会返回此参数,详情请参见错误信息。 | |
message 请求失败的详细信息。请求成功时不会返回此参数,详情请参见错误信息。 |
步骤2:根据任务ID查询结果
北京
GET https://dashscope.aliyuncs.com/api/v1/tasks/{task_id}
新加坡
GET https://dashscope-intl.aliyuncs.com/api/v1/tasks/{task_id}
请求参数 | 查询任务结果将 |
请求头(Headers) | |
Authorization 请求身份认证。接口使用阿里云百炼API-Key进行身份认证。示例值:Bearer sk-xxxx。 | |
URL路径参数(Path parameters) | |
task_id 任务ID。 |
响应参数 | 任务执行成功视频URL仅保留24小时,超时后会被自动清除,请及时保存生成的视频。 任务执行失败若任务执行失败,task_status将置为 FAILED,并提供错误码和信息。请参见错误信息进行解决。 任务查询过期task_id查询有效期为 24 小时,超时后将无法查询,返回以下报错信息。 |
output 任务输出信息。 | |
usage 输出信息统计。只对成功的结果计数。 | |
request_id 请求唯一标识。可用于请求明细溯源和问题排查。 |
DashScope SDK调用
SDK 的参数命名与HTTP接口基本一致,参数结构根据语言特性进行封装。
由于参考生视频任务耗时较长(通常为1-5分钟),SDK 在底层封装了 HTTP 异步调用流程,支持同步、异步两种调用方式。
具体耗时受限于排队任务数和服务执行情况,请在获取结果时耐心等待。
Python SDK调用
请确保 DashScope Python SDK 版本不低于 1.25.16,再运行以下代码。
若版本过低,可能会触发 "url error, please check url!" 等错误。请参考安装SDK进行更新。
根据模型所在地域设置 base_http_api_url:
北京
dashscope.base_http_api_url = 'https://dashscope.aliyuncs.com/api/v1'
新加坡
dashscope.base_http_api_url = 'https://dashscope-intl.aliyuncs.com/api/v1'
同步调用
同步调用会阻塞等待,直到视频生成完成并返回结果。
请求示例
from http import HTTPStatus
from dashscope import VideoSynthesis
import dashscope
import os
# 以下为北京地域URL,各地域的URL不同
dashscope.base_http_api_url = 'https://dashscope.aliyuncs.com/api/v1'
# 若没有配置环境变量,请用百炼API Key将下行替换为:api_key="sk-xxx"
# 各地域的API Key不同。获取API Key:https://help.aliyun.com/zh/model-studio/get-api-key
api_key = os.getenv("DASHSCOPE_API_KEY")
def sample_sync_call_r2v():
# 同步调用,直接返回结果
print('please wait...')
rsp = VideoSynthesis.call(
api_key=api_key,
model='wan2.7-r2v',
prompt='视频1抱着图3,在图4的椅子上弹奏一支舒缓的乡村民谣,并说道:“今天的阳光真好。”图1手中拿着图2,路过视频1,把手中的图2放到视频1旁边的桌子上,并说道:“真好听,能不能再唱一遍”。 ',
media=[
{
"type": "reference_image",
"url": "https://help-static-aliyun-doc.aliyuncs.com/file-manage-files/zh-CN/20260408/sjuytr/wan-r2v-object-girl.jpg",
"reference_voice": "https://help-static-aliyun-doc.aliyuncs.com/file-manage-files/zh-CN/20260408/gbqewz/wan-r2v-girl-voice.mp3"
},
{
"type": "reference_video",
"url": "https://help-static-aliyun-doc.aliyuncs.com/file-manage-files/zh-CN/20260129/qigswt/wan-r2v-role2.mp4",
"reference_voice": "https://help-static-aliyun-doc.aliyuncs.com/file-manage-files/zh-CN/20260408/isllrq/wan-r2v-boy-voice.mp3"
},
{
"type": "reference_image",
"url": "https://help-static-aliyun-doc.aliyuncs.com/file-manage-files/zh-CN/20260129/rtjeqf/wan-r2v-object3.png"
},
{
"type": "reference_image",
"url": "https://help-static-aliyun-doc.aliyuncs.com/file-manage-files/zh-CN/20260129/qpzxps/wan-r2v-object4.png"
},
{
"type": "reference_image",
"url": "https://help-static-aliyun-doc.aliyuncs.com/file-manage-files/zh-CN/20260129/wfjikw/wan-r2v-backgroud5.png"
}
],
resolution='720P',
ratio='16:9',
duration=10,
prompt_extend=False,
watermark=True)
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_sync_call_r2v()响应示例
video_url 有效期24小时,请及时下载视频。
{
"status_code": 200,
"request_id": "b040d446-f9b6-977f-b9ad-xxxxxx",
"code": null,
"message": "",
"output": {
"task_id": "5dab3291-393e-424d-929b-xxxxxx",
"task_status": "SUCCEEDED",
"video_url": "https://dashscope-a717.oss-accelerate.aliyuncs.com/xxx.mp4?Expires=xxx",
"submit_time": "2026-04-17 17:12:49.076",
"scheduled_time": "2026-04-17 17:13:00.384",
"end_time": "2026-04-17 17:29:43.386",
"orig_prompt": "视频1抱着图3,在图4的椅子上弹奏一支舒缓的乡村民谣,并说道:“今天的阳光真好。”图1手中拿着图2,路过视频1,把手中的图2放到视频1旁边的桌子上,并说道:“真好听,能不能再唱一遍”。 "
},
"usage": {
"video_count": 1,
"video_duration": 0,
"video_ratio": "",
"duration": 15,
"input_video_duration": 5,
"output_video_duration": 10,
"SR": 720,
"ratio": "16:9"
}
}异步调用
异步调用会立即返回任务ID,需要自行轮询或等待任务完成。
请求示例
import os
from http import HTTPStatus
from dashscope import VideoSynthesis
import dashscope
# 以下为北京地域URL,各地域的URL不同
dashscope.base_http_api_url = 'https://dashscope.aliyuncs.com/api/v1'
# 若没有配置环境变量,请用百炼API Key将下行替换为:api_key="sk-xxx"
# 各地域的API Key不同。获取API Key:https://help.aliyun.com/zh/model-studio/get-api-key
api_key = os.getenv("DASHSCOPE_API_KEY")
def sample_async_call_r2v():
# 异步调用,返回一个task_id
rsp = VideoSynthesis.async_call(
api_key=api_key,
model='wan2.7-r2v',
prompt='视频1抱着图3,在图4的椅子上弹奏一支舒缓的乡村民谣,并说道:“今天的阳光真好。”图1手中拿着图2,路过视频1,把手中的图2放到视频1旁边的桌子上,并说道:“真好听,能不能再唱一遍”。 ',
media=[
{
"type": "reference_image",
"url": "https://help-static-aliyun-doc.aliyuncs.com/file-manage-files/zh-CN/20260408/sjuytr/wan-r2v-object-girl.jpg",
"reference_voice": "https://help-static-aliyun-doc.aliyuncs.com/file-manage-files/zh-CN/20260408/gbqewz/wan-r2v-girl-voice.mp3"
},
{
"type": "reference_video",
"url": "https://help-static-aliyun-doc.aliyuncs.com/file-manage-files/zh-CN/20260129/qigswt/wan-r2v-role2.mp4",
"reference_voice": "https://help-static-aliyun-doc.aliyuncs.com/file-manage-files/zh-CN/20260408/isllrq/wan-r2v-boy-voice.mp3"
},
{
"type": "reference_image",
"url": "https://help-static-aliyun-doc.aliyuncs.com/file-manage-files/zh-CN/20260129/rtjeqf/wan-r2v-object3.png"
},
{
"type": "reference_image",
"url": "https://help-static-aliyun-doc.aliyuncs.com/file-manage-files/zh-CN/20260129/qpzxps/wan-r2v-object4.png"
},
{
"type": "reference_image",
"url": "https://help-static-aliyun-doc.aliyuncs.com/file-manage-files/zh-CN/20260129/wfjikw/wan-r2v-backgroud5.png"
}
],
resolution='720P',
ratio='16:9',
duration=10,
prompt_extend=False,
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_r2v()响应示例
1、创建任务的响应示例
{
"status_code": 200,
"request_id": "6dc3bf6c-be18-9268-9c27-xxxxxx",
"code": "",
"message": "",
"output": {
"task_id": "686391d9-7ecf-4290-a8e9-xxxxxx",
"task_status": "PENDING",
"video_url": ""
},
"usage": null
}2、查询任务结果的响应示例
video_url 有效期24小时,请及时下载视频。
{
"status_code": 200,
"request_id": "b040d446-f9b6-977f-b9ad-xxxxxx",
"code": null,
"message": "",
"output": {
"task_id": "5dab3291-393e-424d-929b-xxxxxx",
"task_status": "SUCCEEDED",
"video_url": "https://dashscope-a717.oss-accelerate.aliyuncs.com/xxx.mp4?Expires=xxx",
"submit_time": "2026-04-17 17:12:49.076",
"scheduled_time": "2026-04-17 17:13:00.384",
"end_time": "2026-04-17 17:29:43.386",
"orig_prompt": "视频1抱着图3,在图4的椅子上弹奏一支舒缓的乡村民谣,并说道:“今天的阳光真好。”图1手中拿着图2,路过视频1,把手中的图2放到视频1旁边的桌子上,并说道:“真好听,能不能再唱一遍”。 "
},
"usage": {
"video_count": 1,
"video_duration": 0,
"video_ratio": "",
"duration": 15,
"input_video_duration": 5,
"output_video_duration": 10,
"SR": 720,
"ratio": "16:9"
}
}Java SDK调用
请确保 DashScope Java SDK 版本不低于 2.22.14,再运行以下代码。
若版本过低,可能会触发 "url error, please check url!" 等错误。请参考安装SDK进行更新。
根据模型所在地域设置 baseHttpApiUrl:
北京
Constants.baseHttpApiUrl = "https://dashscope.aliyuncs.com/api/v1";
新加坡
Constants.baseHttpApiUrl = "https://dashscope-intl.aliyuncs.com/api/v1";
同步调用
同步调用会阻塞等待,直到视频生成完成并返回结果。
请求示例
// Copyright (c) Alibaba, Inc. and its affiliates.
import com.alibaba.dashscope.aigc.videosynthesis.VideoSynthesis;
import com.alibaba.dashscope.aigc.videosynthesis.VideoSynthesisParam;
import com.alibaba.dashscope.aigc.videosynthesis.VideoSynthesisResult;
import com.alibaba.dashscope.exception.ApiException;
import com.alibaba.dashscope.exception.InputRequiredException;
import com.alibaba.dashscope.exception.NoApiKeyException;
import com.alibaba.dashscope.utils.JsonUtils;
import com.alibaba.dashscope.utils.Constants;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
public class Ref2Video {
static {
// 以下为北京地域url,各地域的url不同
Constants.baseHttpApiUrl = "https://dashscope.aliyuncs.com/api/v1";
}
// 若没有配置环境变量,请用百炼API Key将下行替换为:apiKey="sk-xxx"
// 各地域的API Key不同。获取API Key:https://help.aliyun.com/zh/model-studio/get-api-key
public static String apiKey = System.getenv("DASHSCOPE_API_KEY");
public static void ref2video() throws ApiException, NoApiKeyException, InputRequiredException {
VideoSynthesis vs = new VideoSynthesis();
List<VideoSynthesisParam.Media> media = new ArrayList<VideoSynthesisParam.Media>(){{
add(VideoSynthesisParam.Media.builder()
.url("https://help-static-aliyun-doc.aliyuncs.com/file-manage-files/zh-CN/20260408/sjuytr/wan-r2v-object-girl.jpg")
.type("reference_image")
.referenceVoice("https://help-static-aliyun-doc.aliyuncs.com/file-manage-files/zh-CN/20260408/gbqewz/wan-r2v-girl-voice.mp3")
.build());
add(VideoSynthesisParam.Media.builder()
.url("https://help-static-aliyun-doc.aliyuncs.com/file-manage-files/zh-CN/20260129/qigswt/wan-r2v-role2.mp4")
.type("reference_video")
.referenceVoice("https://help-static-aliyun-doc.aliyuncs.com/file-manage-files/zh-CN/20260408/isllrq/wan-r2v-boy-voice.mp3")
.build());
add(VideoSynthesisParam.Media.builder()
.url("https://help-static-aliyun-doc.aliyuncs.com/file-manage-files/zh-CN/20260129/rtjeqf/wan-r2v-object3.png")
.type("reference_image")
.build());
add(VideoSynthesisParam.Media.builder()
.url("https://help-static-aliyun-doc.aliyuncs.com/file-manage-files/zh-CN/20260129/qpzxps/wan-r2v-object4.png")
.type("reference_image")
.build());
add(VideoSynthesisParam.Media.builder()
.url("https://help-static-aliyun-doc.aliyuncs.com/file-manage-files/zh-CN/20260129/wfjikw/wan-r2v-backgroud5.png")
.type("reference_image")
.build());
}};
Map<String, Object> parameters = new HashMap<>();
parameters.put("resolution", "720P");
parameters.put("ratio", "16:9");
parameters.put("prompt_extend", false);
parameters.put("watermark", true);
VideoSynthesisParam param =
VideoSynthesisParam.builder()
.apiKey(apiKey)
.model("wan2.7-r2v")
.prompt("视频1抱着图3,在图4的椅子上弹奏一支舒缓的乡村民谣,并说道:“今天的阳光真好。”图1手中拿着图2,路过视频1,把手中的图2放到视频1旁边的桌子上,并说道:“真好听,能不能再唱一遍”。 ")
.media(media)
.duration(10)
.parameters(parameters)
.build();
System.out.println("please wait...");
VideoSynthesisResult result = vs.call(param);
System.out.println(JsonUtils.toJson(result));
}
public static void main(String[] args) {
try {
ref2video();
} catch (ApiException | NoApiKeyException | InputRequiredException e) {
System.out.println(e.getMessage());
}
System.exit(0);
}
}响应示例
video_url 有效期24小时,请及时下载视频。
{
"request_id": "f6365287-336f-9f2b-ab59-xxxxxx",
"output": {
"task_id": "cb7f1da5-a987-41de-b0a4-xxxxxx",
"task_status": "SUCCEEDED",
"video_url": "https://dashscope-a717.oss-accelerate.aliyuncs.com/xxx.mp4?Expires=xxxx",
"orig_prompt": "视频1抱着图3,在图4的椅子上弹奏一支舒缓的乡村民谣,并说道:“今天的阳光真好。”图1手中拿着图2,路过视频1,把手中的图2放到视频1旁边的桌子上,并说道:“真好听,能不能再唱一遍”。 ",
"submit_time": "2026-04-17 17:15:11.536",
"scheduled_time": "2026-04-17 17:15:20.316",
"end_time": "2026-04-17 17:29:44.277"
},
"usage": {
"video_count": 1,
"duration": 15.0,
"input_video_duration": 5.0,
"output_video_duration": 10.0,
"SR": "720"
},
"status_code": 200,
"code": "",
"message": ""
}异步调用
异步调用会立即返回任务ID,需要自行轮询或等待任务完成。
请求示例
// Copyright (c) Alibaba, Inc. and its affiliates.
import com.alibaba.dashscope.aigc.videosynthesis.VideoSynthesis;
import com.alibaba.dashscope.aigc.videosynthesis.VideoSynthesisListResult;
import com.alibaba.dashscope.aigc.videosynthesis.VideoSynthesisParam;
import com.alibaba.dashscope.aigc.videosynthesis.VideoSynthesisResult;
import com.alibaba.dashscope.exception.ApiException;
import com.alibaba.dashscope.exception.InputRequiredException;
import com.alibaba.dashscope.exception.NoApiKeyException;
import com.alibaba.dashscope.task.AsyncTaskListParam;
import com.alibaba.dashscope.utils.JsonUtils;
import com.alibaba.dashscope.utils.Constants;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
public class Ref2VideoAsync {
static {
// 以下为北京地域url,各地域的url不同
Constants.baseHttpApiUrl = "https://dashscope.aliyuncs.com/api/v1";
}
// 若没有配置环境变量,请用百炼API Key将下行替换为:apiKey="sk-xxx"
// 各地域的API Key不同。获取API Key:https://help.aliyun.com/zh/model-studio/get-api-key
public static String apiKey = System.getenv("DASHSCOPE_API_KEY");
public static void asyncRef2video() throws ApiException, NoApiKeyException, InputRequiredException, InterruptedException {
VideoSynthesis vs = new VideoSynthesis();
List<VideoSynthesisParam.Media> media = new ArrayList<VideoSynthesisParam.Media>(){{
add(VideoSynthesisParam.Media.builder()
.url("https://help-static-aliyun-doc.aliyuncs.com/file-manage-files/zh-CN/20260408/sjuytr/wan-r2v-object-girl.jpg")
.type("reference_image")
.referenceVoice("https://help-static-aliyun-doc.aliyuncs.com/file-manage-files/zh-CN/20260408/gbqewz/wan-r2v-girl-voice.mp3")
.build());
add(VideoSynthesisParam.Media.builder()
.url("https://help-static-aliyun-doc.aliyuncs.com/file-manage-files/zh-CN/20260129/qigswt/wan-r2v-role2.mp4")
.type("reference_video")
.referenceVoice("https://help-static-aliyun-doc.aliyuncs.com/file-manage-files/zh-CN/20260408/isllrq/wan-r2v-boy-voice.mp3")
.build());
add(VideoSynthesisParam.Media.builder()
.url("https://help-static-aliyun-doc.aliyuncs.com/file-manage-files/zh-CN/20260129/rtjeqf/wan-r2v-object3.png")
.type("reference_image")
.build());
add(VideoSynthesisParam.Media.builder()
.url("https://help-static-aliyun-doc.aliyuncs.com/file-manage-files/zh-CN/20260129/qpzxps/wan-r2v-object4.png")
.type("reference_image")
.build());
add(VideoSynthesisParam.Media.builder()
.url("https://help-static-aliyun-doc.aliyuncs.com/file-manage-files/zh-CN/20260129/wfjikw/wan-r2v-backgroud5.png")
.type("reference_image")
.build());
}};
Map<String, Object> parameters = new HashMap<>();
parameters.put("resolution", "720P");
parameters.put("ratio", "16:9");
parameters.put("prompt_extend", false);
parameters.put("watermark", true);
VideoSynthesisParam param =
VideoSynthesisParam.builder()
.apiKey(apiKey)
.model("wan2.7-r2v")
.prompt("视频1抱着图3,在图4的椅子上弹奏一支舒缓的乡村民谣,并说道:“今天的阳光真好。”图1手中拿着图2,路过视频1,把手中的图2放到视频1旁边的桌子上,并说道:“真好听,能不能再唱一遍”。 ")
.media(media)
.duration(10)
.parameters(parameters)
.build();
// 提交异步任务
VideoSynthesisResult result = vs.asyncCall(param);
System.out.println("task_id: " + result.getOutput().getTaskId());
System.out.println(JsonUtils.toJson(result));
// 等待任务完成
result = vs.wait(result, null);
System.out.println(JsonUtils.toJson(result));
}
public static void main(String[] args) {
try {
asyncRef2video();
} catch (ApiException | NoApiKeyException | InputRequiredException | InterruptedException e) {
System.out.println(e.getMessage());
}
System.exit(0);
}
}响应示例
1、创建任务的响应示例
{
"request_id": "5dbf9dc5-4f4c-9605-85ea-xxxxxxxx",
"output": {
"task_id": "7277e20e-aa01-4709-xxxxxxxx",
"task_status": "PENDING"
}
}2、查询任务结果的响应示例
video_url 有效期24小时,请及时下载视频。
{
"request_id": "f6365287-336f-9f2b-ab59-xxxxxx",
"output": {
"task_id": "cb7f1da5-a987-41de-b0a4-xxxxxx",
"task_status": "SUCCEEDED",
"video_url": "https://dashscope-a717.oss-accelerate.aliyuncs.com/xxx.mp4?Expires=xxxx",
"orig_prompt": "视频1抱着图3,在图4的椅子上弹奏一支舒缓的乡村民谣,并说道:“今天的阳光真好。”图1手中拿着图2,路过视频1,把手中的图2放到视频1旁边的桌子上,并说道:“真好听,能不能再唱一遍”。 ",
"submit_time": "2026-04-17 17:15:11.536",
"scheduled_time": "2026-04-17 17:15:20.316",
"end_time": "2026-04-17 17:29:44.277"
},
"usage": {
"video_count": 1,
"duration": 15.0,
"input_video_duration": 5.0,
"output_video_duration": 10.0,
"SR": "720"
},
"status_code": 200,
"code": "",
"message": ""
}错误码
如果模型调用失败并返回报错信息,请参见错误信息进行解决。
常见问题
从 wan2.6 升级到 wan2.7,代码需要改哪些地方?
主要区别如下:
提示词的参考引用写法不同
wan2.7 不再使用
character1、character2这类标识,需要改为按类型分别指代:图像用“图n”(如图1、图2),视频用“视频n”(如视频1、视频2)。英文提示词则写为“Image 1”、"Video 1”这类标识。提示词说明详见prompt参数。多镜头控制方式不同
wan2.7:不支持
shot_type参数,通过在prompt中描述分镜脚本来实现多镜头效果。wan2.6:通过设置
shot_type为multi来生成多镜头视频。
请求参数结构不同
参考素材传入方式:wan2.7 使用
media(对象数组,每个元素含type和url),替代 wan2.6 的reference_urls(字符串数组)。分辨率参数:wan2.7 使用
resolution(如720P),替代 wan2.6 的size(如1280*720)。audio 参数:wan2.7 默认生成有声视频,无需设置。wan2.6 需要显式设置
audio为true或false。
如何为主体配音(音色参考)?
仅 wan2.7 支持。在 media 中通过 reference_voice 传入音频 URL,可为参考图像或参考视频指定参考音色。
{
"media": [
{
"type": "reference_image",
"url": "<参考图像URL>",
"reference_voice": "<音频URL>"
},
{
"type": "reference_video",
"url": "<参考视频URL>",
"reference_voice": "<音频URL>"
}
]
}