跳到主要内容
AI
MarkdownLLMs.txt

创建视频任务(新)

1. 公共模型

  • seedance2.0-480p
  • seedance2.0-720p
  • seedance2.0-1080p
  • seedance2.0-4k
  • seedance2.0-fast-480p
  • seedance2.0-fast-720p
  • seedance2.0-mini-480p
  • seedance2.0-mini-720p

当前对外统一接口:

  • POST /v1/videos/generations
  • GET /v1/videos/{task_id}

2. 设计原则

2.1 主推火山原生风格

如果你已经使用火山原生风格的 content[],平台会优先按 content[] 处理。

这意味着:

  • content[] 是主协议
  • type / role 是主语义
  • 如果传了 content[],平台会忽略自封装 extra_body.operation

2.2 旧字段只做兼容

以下旧字段继续兼容:

  • prompt
  • image
  • images
  • video
  • videos
  • audios
  • last_image

但这些旧字段只是兼容层,不再是主推方案。

2.3 extra_body.operation 只保留给兼容层

只有在你没有传 content[]、而是走旧字段兼容写法时,才建议或要求使用:

  • reference_to_video
  • edit_video
  • extend_video
  • first_last_frame

如果你已经传了 content[]

  • 即使你再传 extra_body.operation
  • 平台也会忽略它

3. 模型与允许值

模型类型固定分辨率允许 duration允许 aspect_ratio
seedance2.0-480p标准版480p415 的整数auto / 21:9 / 16:9 / 4:3 / 1:1 / 3:4 / 9:16
seedance2.0-720p标准版720p415 的整数auto / 21:9 / 16:9 / 4:3 / 1:1 / 3:4 / 9:16
seedance2.0-1080p标准版1080p415 的整数auto / 21:9 / 16:9 / 4:3 / 1:1 / 3:4 / 9:16
seedance2.0-fast-480pFast 版480p415 的整数auto / 21:9 / 16:9 / 4:3 / 1:1 / 3:4 / 9:16
seedance2.0-fast-720pFast 版720p415 的整数auto / 21:9 / 16:9 / 4:3 / 1:1 / 3:4 / 9:16

补充说明:

  • 分辨率由模型锁定。
  • 不允许通过 size480p 模型改成 720p
  • 如果你要传 size
    • seedance2.0-480p / seedance2.0-fast-480p 只能传 480p
    • seedance2.0-720p / seedance2.0-fast-720p 只能传 720p
    • seedance2.0-1080p / 只能传 1080p

4. 顶层参数说明

4.1 必填参数

参数类型是否必填允许值说明
modelstring4 个公共模型之一公共模型名
durationinteger415 的整数视频秒数

4.2 主推参数

参数类型是否必填允许值说明
contentarray推荐必填见下文火山原生风格输入
aspect_ratiostringauto / 21:9 / 16:9 / 4:3 / 1:1 / 3:4 / 9:16宽高比
promptstring任意非空字符串如果你通过 new-api 网关,建议同时传

4.3 兼容参数

参数类型是否必填允许值说明
imagestring / object单张图片 URL旧字段兼容
imagesarray19 张图片 URL旧字段兼容
videostring单条视频 URL旧字段兼容
videosarray13 条视频 URL旧字段兼容
audiosarray13 条音频 URL旧字段兼容
last_imagestring / object单张图片 URL旧字段兼容

4.4 extra_body 参数

参数类型是否必填允许值说明
extra_body.generate_audiobooleantrue / false是否生成音频
extra_body.seedinteger任意整数随机种子
extra_body.watermarkbooleantrue / false是否加水印
extra_body.camera_fixedbooleantrue / false是否固定镜头
extra_body.service_tierstring当前平台不枚举固定值透传给上游
extra_body.execution_expires_afterinteger正整数透传给上游
extra_body.draftbooleantrue / false草稿模式
extra_body.return_last_framebooleantrue / false是否返回最后一帧
extra_body.framesinteger正整数帧数
extra_body.operationstring仅兼容层使用reference_to_video / edit_video / extend_video / first_last_frame只有旧字段模式才使用;content[] 模式下会被忽略

5. content[] 结构

5.1 文本项

{
"type": "text",
"text": "未来城市,交通发达"
}

规则:

  • type 必须是 text
  • text 必须是非空字符串
  • 整个请求至少要有 1 条文本项

5.2 图片项

{
"type": "image_url",
"url": "https://example.com/ref.png",
"role": "reference_image"
}

图片 role 允许值:

  • image
  • reference_image
  • first_frame
  • last_frame

5.3 视频项

{
"type": "video_url",
"url": "https://example.com/ref.mp4",
"role": "reference_video"
}

视频 role 允许值:

  • reference_video
  • source_video

5.4 音频项

{
"type": "audio_url",
"url": "https://example.com/ref.mp3",
"role": "reference_audio"
}

音频 role 允许值:

  • reference_audio

6. content[] 模式下各种能力怎么表达

这一节是重点:

  • 用户传了 content[]
  • 平台就按 content[]type + role 理解能力
  • 不要求再额外传 extra_body.operation
  • 即使传了,也会被忽略

6.1 文生视频

{
"model": "seedance2.0-720p",
"content": [
{
"type": "text",
"text": "夜晚的未来城市高架桥,车流穿梭,镜头缓慢推进"
}
],
"duration": 5,
"aspect_ratio": "16:9"
}

6.2 单图生视频

{
"model": "seedance2.0-fast-720p",
"content": [
{
"type": "text",
"text": "让产品缓慢旋转,镜头轻推,保持白底电商风格"
},
{
"type": "image_url",
"url": "https://example.com/product.png",
"role": "image"
}
],
"duration": 5,
"aspect_ratio": "16:9",
"extra_body": {
"generate_audio": false,
"watermark": false
}
}

6.3 首尾帧

{
"model": "seedance2.0-720p",
"content": [
{
"type": "text",
"text": "从起始图平滑过渡到结束图,保持主体一致"
},
{
"type": "image_url",
"url": "https://example.com/start.png",
"role": "first_frame"
},
{
"type": "image_url",
"url": "https://example.com/end.png",
"role": "last_frame"
}
],
"duration": 6,
"aspect_ratio": "16:9"
}

6.4 图片参考模式

{
"model": "seedance2.0-720p",
"content": [
{
"type": "text",
"text": "保持人物外观一致,生成一段站在白色背景前的展示视频"
},
{
"type": "image_url",
"url": "https://example.com/ref-1.png",
"role": "reference_image"
},
{
"type": "image_url",
"url": "https://example.com/ref-2.png",
"role": "reference_image"
}
],
"duration": 8,
"aspect_ratio": "9:16"
}

6.5 全能参考模式

{
"model": "seedance2.0-720p",
"content": [
{
"type": "text",
"text": "保持产品外观一致,参考动作和音频节奏,生成一段电商演示视频"
},
{
"type": "image_url",
"url": "https://example.com/product.png",
"role": "reference_image"
},
{
"type": "video_url",
"url": "https://example.com/motion-guide.mp4",
"role": "reference_video"
},
{
"type": "audio_url",
"url": "https://example.com/music-guide.mp3",
"role": "reference_audio"
}
],
"duration": 10,
"aspect_ratio": "16:9",
"extra_body": {
"generate_audio": true,
"seed": 88,
"watermark": false
}
}

6.6 视频编辑

{
"model": "seedance2.0-720p",
"content": [
{
"type": "text",
"text": "把这段视频改成简洁明亮的电商展示风格"
},
{
"type": "video_url",
"url": "https://example.com/source.mp4",
"role": "source_video"
}
],
"duration": 5,
"aspect_ratio": "16:9",
"extra_body": {
"watermark": false
}
}

6.7 视频延长

{
"model": "seedance2.0-720p",
"content": [
{
"type": "text",
"text": "延续当前镜头运动和场景风格,保持主体一致"
},
{
"type": "video_url",
"url": "https://example.com/source.mp4",
"role": "source_video"
}
],
"duration": 5,
"aspect_ratio": "16:9",
"extra_body": {
"watermark": false
}
}

7. 旧字段兼容写法

这部分只给旧客户端或旧网关兼容使用。

7.1 单图兼容写法

{
"model": "seedance2.0-fast-480p",
"prompt": "让产品轻微旋转",
"image": "https://example.com/product.png",
"duration": 5,
"aspect_ratio": "16:9"
}

7.2 首尾帧兼容写法

{
"model": "seedance2.0-720p",
"prompt": "从起始图平滑过渡到结束图",
"image": "https://example.com/start.png",
"last_image": "https://example.com/end.png",
"duration": 6,
"aspect_ratio": "16:9",
"extra_body": {
"operation": "first_last_frame"
}
}

7.3 多模态参考兼容写法

{
"model": "seedance2.0-720p",
"prompt": "生成一段带参考动作和音频节奏的视频",
"images": [
"https://example.com/ref-1.png"
],
"videos": [
"https://example.com/ref.mp4"
],
"audios": [
"https://example.com/ref.mp3"
],
"duration": 8,
"aspect_ratio": "16:9",
"extra_body": {
"operation": "reference_to_video"
}
}

7.4 旧字段视频编辑 / 延长兼容写法

{
"model": "seedance2.0-720p",
"prompt": "把这段视频改成简洁明亮的电商展示风格",
"video": "https://example.com/source.mp4",
"duration": 5,
"aspect_ratio": "16:9",
"extra_body": {
"operation": "edit_video"
}
}

8. 本站通过new-api调用时

强烈建议同时传顶层 promptcontent[0].text

原因:

  • 因采用openai风格,所以 prompt 字段必传,否则请求不能到达火山引擎服务

推荐兼容写法:

{
"model": "seedance2.0-fast-480p",
"prompt": "未来城市,交通发达",
"content": [
{
"type": "text",
"text": "未来城市,交通发达"
}
],
"duration": 5,
"aspect_ratio": "16:9",
"extra_body": {
"generate_audio": false,
"watermark": false
}
}

9. 常见错误

错误 1:通过 new-api 只传 content[],不传顶层 prompt

现象:

  • 前置层直接报 prompt is required

解决:

  • 顶层 promptcontent[0].text 同时传

错误 2:content[]role 不合法

图片 role 只允许:

  • image
  • reference_image
  • first_frame
  • last_frame

视频 role 只允许:

  • reference_video
  • source_video

音频 role 只允许:

  • reference_audio

错误 3:旧字段兼容模式没传 operation

说明:

  • 旧字段本身表达力不足
  • 平台需要你显式补语义

例如:

  • video 兼容模式下要配 edit_videoextend_video
  • videos / audios 兼容模式下要配 reference_to_video

错误 4:尝试覆盖分辨率

说明:

  • 模型分辨率由公共模型名锁定

例如:

  • seedance2.0-fast-480p 不能改成 720p
  • seedance2.0-720p 不能改成 480p

10. 响应说明

提交后会返回统一异步任务对象,例如:

{
"id": "task_xxx",
"task_id": "task_xxx",
"object": "video.generation.job",
"model": "seedance2.0-720p",
"status": "queued",
"raw_status": "PENDING",
"progress": 0,
"created_at": 1773980459,
"video_url": null
}

之后轮询:

  • GET /v1/videos/generations/{task_id}

直到状态变成:

  • completed
  • failed

11. 最终建议

一句话总结:

  • 如果你会写 content[],就按火山原生风格写,不用再传 extra_body.operation
  • 如果你还在用旧字段兼容写法,再传 extra_body.operation
  • 如果通过 new-api,建议同时传顶层 promptcontent[0].text

接口参数与示例

Endpoint

POST /v1/video/generations

Header 参数

NameTypeRequiredDescriptionExample
AuthorizationstringNoBearer {your_token}

请求体参数

FieldTypeRequiredTitleDescription
modelstringYes模型名称
promptstringYes提示词只有 prompt -> 文生视频
imagestringYes单张源图图生视频
last_imagestringYes尾帧图首尾帧和image配合使用
imagesstringYes参考图 URL 数组多图参考输入, '全能参考模式', 图片最多9张
audiosstringYes参考音频 URL 数组用于全能参考模式, 最多 3 个,每个 2~15s,总时长 <= 15s
videosstringYes参考视频 URL 数组用于全能参考模式, 最多 3 个,每个 2~15s,总时长 <= 15s
durationstringYes秒数5到15中的任意值
aspect_ratiostringYes比例9:161:116:9
extra_bodyobjectNo扩展

请求示例

示例

{
"model": "string",
"prompt": "string",
"image": "string",
"last_image": "string",
"images": "string",
"audios": "string",
"videos": "string",
"duration": "string",
"aspect_ratio": "string",
"extra_body": {
"generate_audio": true,
"seed": "string",
"watermark": "string",
"camera_fixed": "string",
"service_tier": "string",
"execution_expires_after": "string",
"draft": "string",
"return_last_frame": "string",
"frames": "string",
"operation": "string"
}
}
curl -X POST "{BASE_URL}/v1/video/generations" \
-H "Authorization: Bearer sk-***" \
-H "Content-Type: application/json" \
-d '{
"model": "string",
"prompt": "string",
"image": "string",
"last_image": "string",
"images": "string",
"audios": "string",
"videos": "string",
"duration": "string",
"aspect_ratio": "string",
"extra_body": {
"generate_audio": true,
"seed": "string",
"watermark": "string",
"camera_fixed": "string",
"service_tier": "string",
"execution_expires_after": "string",
"draft": "string",
"return_last_frame": "string",
"frames": "string",
"operation": "string"
}
}'

响应字段

FieldTypeRequiredTitleDescription

响应示例

示例 1

{
"id": "task_xxx",
"error": null,
"model": "seedance2.0-720p",
"object": "video.generation.job",
"result": {
"outputs": [
"https://xxx.aijisu.cn/video/xxxx.mp4"
],
"video_url": "https://xxx.aijisu.cn/video/xxx.mp4"
},
"status": "completed",
"task_id": "task_xxxxx",
"progress": 100,
"video_url": "https://xxx.aijisu.cn/video/xxx.mp4",
"created_at": 1774405050,
"raw_status": "COMPLETED"
}