Skip to content

Wan3(首尾帧生视频)

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

说明

异步任务接口,用于提交 Wan3 首尾帧生视频任务。请求需传入首帧图片,可选传入尾帧图片;两张图片按请求中的出现顺序分别作为首帧和尾帧。

请求地址

http
POST /open/v1/ai_creation/task/submit
http
access_token: {{access_token}}
Content-Type: application/json

请求参数 Body

json
{
  "start_frame": "https://res.chanjing.cc/chanjing/res/aigc_creation/photo/start.jpg",
  "end_frame": "https://res.chanjing.cc/chanjing/res/aigc_creation/photo/end.jpg",
  "ref_prompt": "镜头从首帧自然过渡到尾帧,主体动作连贯,光影变化平滑",
  "creation_type": 4,
  "aspect_ratio": "auto",
  "clarity": 720,
  "resolution_mode": "native",
  "video_duration": 5,
  "number_of_images": 1,
  "model_code": "wan3.0-first-last-to-video"
}

参数说明

字段类型是否必传示例说明
start_framestring条件必传https://.../start.jpg首帧图片 URL;与 ref_img_urlref_resources 至少传一种
end_framestringhttps://.../end.jpg尾帧图片 URL;传入后参考图片总数仍不能超过 2 张
ref_img_urlarray<string>条件必传["https://.../start.jpg", "https://.../end.jpg"]兼容参考图 URL 列表,可替代 start_frameend_frame
ref_resourcesarray<object>条件必传[{"url":"https://.../start.jpg","file_type":"image"}]参考图片列表,可替代 start_frameend_frame
ref_resources.urlstringhttps://.../start.jpg可公开访问且能通过服务端校验的参考图片 URL
ref_resources.file_typestringimage该模式固定传 image
ref_promptstring镜头从首帧自然过渡到尾帧视频生成提示词,最多 20000 个字符
creation_typeint4创作类型,固定为 4
aspect_ratiostringauto输出视频宽高比,支持 auto16:94:31:13:49:16;按参考图片智能匹配请传 auto
clarityint720输出清晰度,支持 4807201080
resolution_modestringnative分辨率模式:native 为标准版,fast 为加速版;不传时按 native 处理
video_durationint5输出视频时长(秒),支持 2-30 的整数
number_of_imagesint1OpenAPI 单次生成数量,固定为 1
model_codestringwan3.0-first-last-to-video模型编码,固定为 wan3.0-first-last-to-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

start_frameend_frameref_img_urlref_resources 中的图片会按 URL 合并去重,合计必须为 1-2 张。只传一张时作为首帧,传两张时依次作为首帧和尾帧。图片支持 JPEG、PNG、WebP、BMP、TIFF、GIF,单张不超过 30 MB。

响应示例

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 '{
  "start_frame": "https://res.chanjing.cc/chanjing/res/aigc_creation/photo/start.jpg",
  "end_frame": "https://res.chanjing.cc/chanjing/res/aigc_creation/photo/end.jpg",
  "ref_prompt": "镜头从首帧自然过渡到尾帧,主体动作连贯,光影变化平滑",
  "creation_type": 4,
  "aspect_ratio": "auto",
  "clarity": 720,
  "resolution_mode": "native",
  "video_duration": 5,
  "number_of_images": 1,
  "model_code": "wan3.0-first-last-to-video"
}'
go
payload := strings.NewReader(`{
  "start_frame": "https://res.chanjing.cc/chanjing/res/aigc_creation/photo/start.jpg",
  "end_frame": "https://res.chanjing.cc/chanjing/res/aigc_creation/photo/end.jpg",
  "ref_prompt": "镜头从首帧自然过渡到尾帧,主体动作连贯,光影变化平滑",
  "creation_type": 4,
  "aspect_ratio": "auto",
  "clarity": 720,
  "resolution_mode": "native",
  "video_duration": 5,
  "number_of_images": 1,
  "model_code": "wan3.0-first-last-to-video"
}`)
java
RequestBody body = RequestBody.create(mediaType, "{\n  \"start_frame\": \"https://res.chanjing.cc/chanjing/res/aigc_creation/photo/start.jpg\",\n  \"end_frame\": \"https://res.chanjing.cc/chanjing/res/aigc_creation/photo/end.jpg\",\n  \"ref_prompt\": \"镜头从首帧自然过渡到尾帧,主体动作连贯,光影变化平滑\",\n  \"creation_type\": 4,\n  \"aspect_ratio\": \"auto\",\n  \"clarity\": 720,\n  \"resolution_mode\": \"native\",\n  \"video_duration\": 5,\n  \"number_of_images\": 1,\n  \"model_code\": \"wan3.0-first-last-to-video\"\n}");
py
payload = json.dumps({
  "start_frame": "https://res.chanjing.cc/chanjing/res/aigc_creation/photo/start.jpg",
  "end_frame": "https://res.chanjing.cc/chanjing/res/aigc_creation/photo/end.jpg",
  "ref_prompt": "镜头从首帧自然过渡到尾帧,主体动作连贯,光影变化平滑",
  "creation_type": 4,
  "aspect_ratio": "auto",
  "clarity": 720,
  "resolution_mode": "native",
  "video_duration": 5,
  "number_of_images": 1,
  "model_code": "wan3.0-first-last-to-video"
})