# Seedance 2.0 API ByteDance Seedance 2.0 视频生成模型的完整 API 参考文档。 ## 模型版本 此 API 支持六种模型: | 模型 | ID | 说明 | |-------|-----|-------------| | **Seedance 2.0 Text to Video** | `seedance-v2.0-text-to-video` | 高质量文生视频 | | **Seedance 2.0 Image to Video** | `seedance-v2.0-image-to-video` | 支持运动控制的图片动画生成 | | **Seedance 2.0 Reference to Video** | `seedance-v2.0-reference-to-video` | 通过参考视频引导生成视频 | | **Seedance 2.0 Fast Text to Video** | `seedance-v2.0-fast-text-to-video` | 更快的文生视频 | | **Seedance 2.0 Fast Image to Video** | `seedance-v2.0-fast-image-to-video` | 更快的图生视频 | | **Seedance 2.0 Fast Reference to Video** | `seedance-v2.0-fast-reference-to-video` | 更快的参考素材引导视频生成 | ## 快速对比 | 功能 | 标准模型 | Fast 模型 | |---------|-----------------|-------------| | 质量 | 更高质量 | 针对速度优化 | | 处理时间 | 3-8 分钟 | 1-4 分钟 | | 时长范围 | 4-15 秒 | 4-15 秒 | | 分辨率选项 | 480p, 720p, 1080p, 4k | 480p, 720p | | 参考素材 | Reference-to-Video 支持图片、视频和音频 | Fast Reference-to-Video 支持图片、视频和音频 | ### 支持的宽高比 `21:9`, `16:9`, `9:16`, `1:1`, `4:3`, `3:4` ### 分辨率选项 | 分辨率 | 说明 | |------------|-------------| | `480p` | 标清,处理更快 | | `720p` | 高清,兼顾质量与速度 | | `1080p` | 全高清,适用于所有标准 Seedance 2.0 模型 | | `4k` | 超高清,适用于所有标准 Seedance 2.0 模型 | ## Seedance 2.0 文生视频 ### 接口地址 ``` POST /api/v1/video/task ``` ### 请求参数 #### 必填 | 参数 | 类型 | 说明 | |-----------|------|-------------| | `model_name` | string | 必须为 `"seedance-v2.0-text-to-video"` | | `prompt` | string | 视频生成提示词 | | `duration` | integer | 视频时长为整数秒(4-15),步长为 1 | | `resolution` | string | 输出分辨率:`"480p"`、`"720p"`、`"1080p"` 或 `"4k"` | | `aspect_ratio` | string | 视频宽高比:`"21:9"`、`"16:9"`、`"9:16"`、`"1:1"`、`"4:3"` 或 `"3:4"` | #### 选填 | 参数 | 类型 | 说明 | |-----------|------|-------------| | `sound` | boolean | 是否生成声音。默认为 `true`;不影响价格 | ### 请求示例 ```javascript const response = await fetch('https://api.flaq.ai/api/v1/video/task', { method: 'POST', headers: { 'Authorization': 'Bearer YOUR_API_KEY', 'Content-Type': 'application/json' }, body: JSON.stringify({ model_name: 'seedance-v2.0-text-to-video', prompt: 'A golden retriever running through a sunlit meadow', duration: 6, resolution: '720p', aspect_ratio: '16:9' }) }); const { data } = await response.json(); const taskId = data.task_id; ``` ## Seedance 2.0 图生视频 ### 请求参数 #### 必填 | 参数 | 类型 | 说明 | |-----------|------|-------------| | `model_name` | string | 必须为 `"seedance-v2.0-image-to-video"` | | `prompt` | string | 视频生成提示词 | | `duration` | integer | 视频时长为整数秒(4-15),步长为 1 | | `resolution` | string | 输出分辨率:`"480p"`、`"720p"`、`"1080p"` 或 `"4k"` | | `aspect_ratio` | string | 视频宽高比:`"21:9"`、`"16:9"`、`"9:16"`、`"1:1"`、`"4:3"` 或 `"3:4"` | | `image_url` | string | 视频首帧 | #### 选填 | 参数 | 类型 | 说明 | |-----------|------|-------------| | `image_end_url` | string | 可选的尾帧图片 URL | | `sound` | boolean | 是否生成声音。默认为 `true`;不影响价格 | ### 请求示例 ```javascript { model_name: 'seedance-v2.0-image-to-video', image_url: 'https://example.com/image.jpg', image_end_url: 'https://example.com/end-frame.jpg', prompt: 'Camera slowly pulls back to reveal the full landscape', duration: 6, resolution: '720p', aspect_ratio: '16:9' } ``` ## Seedance 2.0 参考生视频 ### 请求参数 #### 必填 | 参数 | 类型 | 说明 | |-----------|------|-------------| | `model_name` | string | 必须为 `"seedance-v2.0-reference-to-video"` | | `prompt` | string | 视频生成提示词。可以编写不含占位符的普通提示词,也可以使用 @(AT)引用功能,通过 `<<>>`、`<<>>` 和 `<<>>` 明确引用对应素材数组中的项目 | | `duration` | integer | 视频时长为整数秒(4-15),步长为 1 | | `resolution` | string | 输出分辨率:`"480p"`、`"720p"`、`"1080p"` 或 `"4k"` | | `aspect_ratio` | string | 视频宽高比:`"21:9"`、`"16:9"`、`"9:16"`、`"1:1"`、`"4:3"` 或 `"3:4"` | #### 参考素材 提交 1-9 张图片。仅在提供至少一段参考视频时,才可以不提供图片。 | 参数 | 类型 | 说明 | |-----------|------|-------------| | `images` | string[] | 1-9 个参考图片 URL;当 `videos` 非空时,也可以为空数组 | | `videos` | string[] | 最多 3 个参考视频 URL;每段视频须为 2-15 秒,总时长不超过 15 秒 | | `audios` | string[] | 最多 3 个参考音频 URL;每段音频须为 2-15 秒,总时长不超过 15 秒;WAV 或 MP3,每段不超过 15 MB;需要至少一张图片或一段视频 | #### @(AT)引用占位符 @(AT)引用功能通过带编号的 `<<<...>>>` 占位符将参考素材关联到提示词。每种素材类型分别从 `1` 开始编号,顺序与对应数组一致: | 占位符 | 引用值 | |-------------|------------------| | `<<>>` | `images[0]` | | `<<>>` | `images[1]` | | `<<>>` | `videos[0]` | | `<<>>` | `audios[0]` | 例如,若第一张图片为角色参考,第二张图片为场景参考,则在 `prompt` 中使用 `<<>>` 引用角色,使用 `<<>>` 引用场景。每个占位符必须指向对应数组中实际存在的项目。 #### 选填 | 参数 | 类型 | 说明 | |-----------|------|-------------| | `sound` | boolean | 是否生成同步声音。默认为 `true` | ### 请求示例 ```javascript { model_name: 'seedance-v2.0-reference-to-video', prompt: 'Use image one for the subject, video one for the movement, and audio one for the atmosphere', duration: 8, resolution: '1080p', aspect_ratio: '16:9', sound: true, images: ['https://example.com/subject-reference.jpg'], videos: ['https://example.com/motion-reference.mp4'], audios: ['https://example.com/atmosphere-reference.mp3'] } ``` ### @(AT)参考生视频请求示例 ```javascript { model_name: 'seedance-v2.0-reference-to-video', prompt: 'Place the explorer from <<>> in the environment from <<>>, following the camera movement in <<>> and speaking with the reference voice from <<>>', duration: 8, resolution: '1080p', aspect_ratio: '16:9', sound: true, images: [ 'https://example.com/explorer-reference.jpg', 'https://example.com/environment-reference.jpg' ], videos: ['https://example.com/camera-movement-reference.mp4'], audios: ['https://example.com/voice-reference.mp3'] } ``` ## Fast 版本 Fast 版本优先考虑处理速度。所有 Fast 模型仅支持 `"480p"` 和 `"720p"` 输出。Fast 文生视频和 Fast 图生视频的其他请求结构与对应标准模型一致,Fast 参考生视频的参考素材限制也与标准参考模型一致。 ### Fast 请求示例 ```javascript { model_name: 'seedance-v2.0-fast-reference-to-video', prompt: 'Use image one for the subject, follow the movement from video one, and use audio one for the atmosphere', duration: 8, resolution: '720p', aspect_ratio: '9:16', sound: true, images: ['https://example.com/subject-reference.jpg'], videos: ['https://example.com/motion-reference.mp4'], audios: ['https://example.com/atmosphere-reference.mp3'] } ``` ### @(AT)Fast 参考生视频请求示例 ```javascript { model_name: 'seedance-v2.0-fast-reference-to-video', prompt: 'Have the dancer from <<>> perform the movement from <<>> on the stage in <<>>, using the rhythm from <<>>', duration: 8, resolution: '720p', aspect_ratio: '9:16', sound: true, images: [ 'https://example.com/dancer-reference.jpg', 'https://example.com/stage-reference.jpg' ], videos: ['https://example.com/dance-movement-reference.mp4'], audios: ['https://example.com/rhythm-reference.mp3'] } ``` ### Seedance 2.0 Fast 参考生视频参数 #### 必填 | 参数 | 类型 | 说明 | |-----------|------|-------------| | `model_name` | string | 必须为 `"seedance-v2.0-fast-reference-to-video"` | | `prompt` | string | 视频生成提示词。可以编写不含占位符的普通提示词,也可以使用 @(AT)引用功能,通过 `<<>>`、`<<>>` 和 `<<>>` 明确引用对应素材数组中的项目 | | `duration` | integer | 视频时长为整数秒(4-15),步长为 1 | | `resolution` | string | 输出分辨率:`"480p"` 或 `"720p"` | | `aspect_ratio` | string | 视频宽高比:`"21:9"`、`"16:9"`、`"9:16"`、`"1:1"`、`"4:3"` 或 `"3:4"` | #### 参考素材 | 参数 | 类型 | 说明 | |-----------|------|-------------| | `images` | string[] | 1-9 个参考图片 URL;当 `videos` 非空时,也可以为空数组 | | `videos` | string[] | 最多 3 个参考视频 URL;每段视频须为 2-15 秒,总时长不超过 15 秒 | | `audios` | string[] | 最多 3 个参考音频 URL;每段音频须为 2-15 秒,总时长不超过 15 秒;WAV 或 MP3,每段不超过 15 MB;需要至少一张图片或一段视频 | 上述从 1 开始编号的占位符规则同样适用于 Fast 参考生视频模型。 #### 选填 | 参数 | 类型 | 说明 | |-----------|------|-------------| | `sound` | boolean | 是否生成同步声音。默认为 `true` | ## 素材限制 这些限制适用于本页模型的首帧图片、尾帧图片和参考素材。 | 素材 | 格式 | 限制 | |-------|---------|--------| | 图片 | JPEG, PNG, WEBP, BMP, TIFF, GIF, HEIC, HEIF | 每张图片必须小于 30 MB;宽和高均须为 300-6000 px;宽高比须为 0.4-2.5 | | 视频 | MP4, MOV | 每段不超过 200 MB;宽和高均须为 300-6000 px;宽高比须为 0.4-2.5;帧率须为 24-60 FPS | | 音频 | WAV, MP3 | 每段不超过 15 MB | | 请求体 | — | 不超过 64 MB | 参考音频和参考视频各自的总时长上限为 15 秒。各类素材数量独立计算:最多 9 张图片、3 段视频和 3 段音频。添加视频不会减少可上传的图片数量。 所有模型默认使用 `720p`,但仍必须提供 `resolution`。声音开关默认为 `true`;此开关和参考音频均不影响价格。参考生视频需要至少一张图片或一段视频,不支持仅音频请求。上传参考视频会使生成费用翻倍,与视频数量或时长无关。 ## 响应格式 ### 初始响应 所有模型均返回用于轮询的 `task_id`: ```json { "code": 0, "message": "success", "data": { "task_id": "{task_id}", "response_url": "https://api.flaq.ai/api/v1/video/{task_id}", "task_status": "submitted" } } ``` ### 轮询响应 轮询 `GET /api/v1/video/{taskId}` 以检查状态: ```json { "code": 0, "message": "success", "data": { "task_id": "{task_id}", "response_url": "https://api.flaq.ai/api/v1/video/{task_id}", "task_status": "succeed", "task_status_msg": null, "task_result": { "credit": 0.2, "videos": [ { "url": "https://example.com/generated-video.mp4" } ] } } } ``` ### 状态值 - `submitted`:任务已接受,等待处理 - `processing`:正在生成视频 - `succeed`:视频生成完成 - `failed`:视频生成失败 ## 处理时间 **标准模型**:3-8 分钟,取决于时长和分辨率。 **Fast 模型**:大多数配置需要 1-4 分钟。 每 5-10 秒轮询一次以检查状态。 ## 最佳实践 1. **选择合适的版本**:迭代时使用 Fast 模型,最终输出使用标准模型 2. **清晰描述运动**:在提示词中加入具体的运动描述 3. **分辨率选择**:所有标准 Seedance 2.0 模型支持 `480p`、`720p`、`1080p` 和 `4k`;所有 Fast 模型仅支持 `480p` 和 `720p` 4. **参考素材顺序**:按预期顺序排列 `images`、`videos` 和 `audios`,并在提示词中保持引用一致 5. **仅视频请求**:仅在提供至少一段参考视频时,才使用空的 `images` 数组 6. **素材时长**:每段参考音频和视频均保持在 2 至 15 秒之间 7. **音频增强**:省略 `sound` 以使用默认值 `true`,或设为 `false` 以禁用生成声音