Wan3(全能参考)
任务进度与结果查询见 使用说明。
说明
异步任务接口,用于提交 Wan3 全能参考视频任务。支持纯文本生成,也支持同时使用图片、视频和音频作为参考素材;音频不能作为唯一参考素材。
请求地址
http
POST /open/v1/ai_creation/task/submitHeader
http
access_token: {{access_token}}
Content-Type: application/json请求参数 Body
json
{
"ref_resources": [
{
"url": "https://res.chanjing.cc/chanjing/res/aigc_creation/photo/ref.jpg",
"file_type": "image"
},
{
"url": "https://res.chanjing.cc/chanjing/res/aigc_creation/video/ref.mp4",
"file_type": "video"
},
{
"url": "https://res.chanjing.cc/chanjing/res/aigc_creation/audio/ref.mp3",
"file_type": "audio"
}
],
"ref_prompt": "保持图1中的主体特征,参考视频1的运动节奏和音频1的声音风格,生成电影感品牌短片",
"creation_type": 4,
"aspect_ratio": "16:9",
"clarity": 720,
"resolution_mode": "fast",
"video_duration": 5,
"number_of_images": 1,
"model_code": "wan3.0-video"
}参数说明
| 字段 | 类型 | 是否必传 | 示例 | 说明 |
|---|---|---|---|---|
| ref_resources | array<object> | 否 | [{"url":"https://.../ref.mp4","file_type":"video"}] | 参考素材列表;不传时为纯文本生成,最多传 20 个素材 |
| ref_resources.url | string | 是 | https://.../ref.mp4 | 可公开访问且能通过服务端校验的参考素材 URL |
| ref_resources.file_type | string | 是 | video | 参考素材类型,支持 image、video、audio |
| ref_img_url | array<string> | 否 | ["https://.../ref.jpg"] | 兼容旧版参考图字段;新接入建议使用 ref_resources |
| ref_prompt | string | 是 | 保持图1中的主体特征 | 视频生成提示词,最多 20000 个字符 |
| creation_type | int | 是 | 4 | 创作类型,固定为 4 |
| aspect_ratio | string | 是 | 16:9 | 输出视频宽高比,支持 16:9、4:3、1:1、3:4、9:16 |
| clarity | int | 是 | 720 | 输出清晰度,支持 480、720、1080 |
| resolution_mode | string | 否 | fast | 分辨率模式:native 为标准版,fast 为加速版;不传时按 native 处理 |
| video_duration | int | 是 | 5 | 输出视频时长(秒),支持 2-30 的整数 |
| number_of_images | int | 是 | 1 | OpenAPI 单次生成数量,固定为 1 |
| model_code | string | 是 | wan3.0-video | 模型编码,固定为 wan3.0-video |
支持的分辨率组合与价格:
| 输出规格 | clarity | resolution_mode | 活动价(蝉豆/秒) | 原价(蝉豆/秒) | 活动价(魔力/秒) | 原价(魔力/秒) |
|---|---|---|---|---|---|---|
| 480P 标准版 | 480 | native,可省略 | 7 | 15 | 1 | 2 |
| 480P 加速版 | 480 | fast | 10 | 20 | 2 | 3 |
| 720P 标准版 | 720 | native,可省略 | 11 | 20 | 2 | 3 |
| 720P 加速版 | 720 | fast | 23 | 45 | 3 | 6 |
| 1080P 标准版 | 1080 | native,可省略 | 21 | 40 | 3 | 6 |
| 1080P 加速版 | 1080 | fast | 43 | 85 | 6 | 12 |
Wan3 当前为限时 5 折活动,实际扣费以表格中的活动价为准,原价保持不变。活动价格以计费配置为准,不根据原价实时换算。
OpenAPI 始终传真实分辨率
480、720或1080,并通过resolution_mode区分标准版和加速版。48001、72001、108001是社区端内部选项值,不能作为 OpenAPI 的clarity。价格按生成时长计费,任务价格为对应单价乘以video_duration。
参考素材限制:
| 素材类型 | 支持格式 | 单文件大小 | 数量上限 | 累计时长 |
|---|---|---|---|---|
| 图片 | JPEG、PNG、WebP、BMP、TIFF、GIF | 30 MB | 10 张 | - |
| 视频 | MP4、MOV | 50 MB | 5 个 | 不超过 15 秒 |
| 音频 | MP3、WAV | 15 MB | 5 个 | 不超过 15 秒 |
参考素材总数不能超过 20 个。纯音频请求会被拒绝;使用音频时必须同时上传至少一张图片或一个视频。相同 URL 会合并去重,不重复计数。
提示词中的素材按 图N、视频N、音频N 引用,N 从 1 开始,并按 ref_resources 中同类型素材的出现顺序编号。
响应示例
json
{
"trace_id": "96afa792520b0e6a86d72e89435bc0a7",
"code": 0,
"msg": "success",
"data": "a60747d7-dc05-4afc-b2ef-ee4370ed53c6"
}响应字段说明
| 字段 | 说明 |
|---|---|
| code | 响应状态码 |
| msg | 响应信息 |
| trace_id | 请求链路追踪 ID |
| data | 创作任务唯一 ID(unique_id) |
响应状态码说明
| code | 说明 |
|---|---|
| 0 | 响应成功 |
| 400 | 传入参数格式错误 |
| 10400 | AccessToken 验证失败 |
| 40000 | 参数错误 |
| 40001 | 超出 QPS 限制 |
| 50000 | 系统内部错误 |
示例代码
shell
curl --location --request POST 'https://open-api.chanjing.cc/open/v1/ai_creation/task/submit' \
--header 'access_token: {{access_token}}' \
--header 'Content-Type: application/json' \
--data-raw '{
"ref_resources": [
{"url": "https://res.chanjing.cc/chanjing/res/aigc_creation/photo/ref.jpg", "file_type": "image"},
{"url": "https://res.chanjing.cc/chanjing/res/aigc_creation/video/ref.mp4", "file_type": "video"}
],
"ref_prompt": "保持图1中的主体特征,参考视频1的运动节奏,生成电影感品牌短片",
"creation_type": 4,
"aspect_ratio": "16:9",
"clarity": 720,
"resolution_mode": "fast",
"video_duration": 5,
"number_of_images": 1,
"model_code": "wan3.0-video"
}'go
payload := strings.NewReader(`{
"ref_resources": [
{"url":"https://res.chanjing.cc/chanjing/res/aigc_creation/photo/ref.jpg","file_type":"image"},
{"url":"https://res.chanjing.cc/chanjing/res/aigc_creation/video/ref.mp4","file_type":"video"}
],
"ref_prompt": "保持图1中的主体特征,参考视频1的运动节奏,生成电影感品牌短片",
"creation_type": 4,
"aspect_ratio": "16:9",
"clarity": 720,
"resolution_mode": "fast",
"video_duration": 5,
"number_of_images": 1,
"model_code": "wan3.0-video"
}`)java
RequestBody body = RequestBody.create(mediaType, "{\n \"ref_resources\": [{\"url\":\"https://res.chanjing.cc/chanjing/res/aigc_creation/photo/ref.jpg\",\"file_type\":\"image\"},{\"url\":\"https://res.chanjing.cc/chanjing/res/aigc_creation/video/ref.mp4\",\"file_type\":\"video\"}],\n \"ref_prompt\": \"保持图1中的主体特征,参考视频1的运动节奏,生成电影感品牌短片\",\n \"creation_type\": 4,\n \"aspect_ratio\": \"16:9\",\n \"clarity\": 720,\n \"resolution_mode\": \"fast\",\n \"video_duration\": 5,\n \"number_of_images\": 1,\n \"model_code\": \"wan3.0-video\"\n}");py
payload = json.dumps({
"ref_resources": [
{"url": "https://res.chanjing.cc/chanjing/res/aigc_creation/photo/ref.jpg", "file_type": "image"},
{"url": "https://res.chanjing.cc/chanjing/res/aigc_creation/video/ref.mp4", "file_type": "video"}
],
"ref_prompt": "保持图1中的主体特征,参考视频1的运动节奏,生成电影感品牌短片",
"creation_type": 4,
"aspect_ratio": "16:9",
"clarity": 720,
"resolution_mode": "fast",
"video_duration": 5,
"number_of_images": 1,
"model_code": "wan3.0-video"
})