Skip to content

Wan3(全能参考)

任务进度与结果查询见 使用说明

说明

异步任务接口,用于提交 Wan3 全能参考视频任务。支持纯文本生成,也支持同时使用图片、视频和音频作为参考素材;音频不能作为唯一参考素材。

请求地址

http
POST /open/v1/ai_creation/task/submit
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_resourcesarray<object>[{"url":"https://.../ref.mp4","file_type":"video"}]参考素材列表;不传时为纯文本生成,最多传 20 个素材
ref_resources.urlstringhttps://.../ref.mp4可公开访问且能通过服务端校验的参考素材 URL
ref_resources.file_typestringvideo参考素材类型,支持 imagevideoaudio
ref_img_urlarray<string>["https://.../ref.jpg"]兼容旧版参考图字段;新接入建议使用 ref_resources
ref_promptstring保持图1中的主体特征视频生成提示词,最多 20000 个字符
creation_typeint4创作类型,固定为 4
aspect_ratiostring16:9输出视频宽高比,支持 16:94:31:13:49:16
clarityint720输出清晰度,支持 4807201080
resolution_modestringfast分辨率模式:native 为标准版,fast 为加速版;不传时按 native 处理
video_durationint5输出视频时长(秒),支持 2-30 的整数
number_of_imagesint1OpenAPI 单次生成数量,固定为 1
model_codestringwan3.0-video模型编码,固定为 wan3.0-video

支持的分辨率组合与价格:

输出规格clarityresolution_mode活动价(蝉豆/秒)原价(蝉豆/秒)活动价(魔力/秒)原价(魔力/秒)
480P 标准版480native,可省略71512
480P 加速版480fast102023
720P 标准版720native,可省略112023
720P 加速版720fast234536
1080P 标准版1080native,可省略214036
1080P 加速版1080fast4385612

Wan3 当前为限时 5 折活动,实际扣费以表格中的活动价为准,原价保持不变。活动价格以计费配置为准,不根据原价实时换算。

OpenAPI 始终传真实分辨率 4807201080,并通过 resolution_mode 区分标准版和加速版。4800172001108001 是社区端内部选项值,不能作为 OpenAPI 的 clarity。价格按生成时长计费,任务价格为对应单价乘以 video_duration

参考素材限制:

素材类型支持格式单文件大小数量上限累计时长
图片JPEG、PNG、WebP、BMP、TIFF、GIF30 MB10 张-
视频MP4、MOV50 MB5 个不超过 15 秒
音频MP3、WAV15 MB5 个不超过 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传入参数格式错误
10400AccessToken 验证失败
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"
})