ByteDance Seedance 2.0 视频生成模型的完整 API 参考文档。
模型版本
此 API 支持六种模型:
快速对比
支持的宽高比
21:9, 16:9, 9:16, 1:1, 4:3, 3:4
分辨率选项
Seedance 2.0 文生视频
接口地址
POST /api/v1/video/task
请求参数
必填
选填
请求示例
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: '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 参考生视频
请求参数
必填
参考素材
提交 1-9 张图片。仅在提供至少一段参考视频时,才可以不提供图片。
@(AT)引用占位符
@(AT)引用功能通过带编号的 <<<...>>> 占位符将参考素材关联到提示词。每种素材类型分别从 1 开始编号,顺序与对应数组一致:
例如,若第一张图片为角色参考,第二张图片为场景参考,则在 prompt 中使用 <<<image_1>>> 引用角色,使用 <<<image_2>>> 引用场景。每个占位符必须指向对应数组中实际存在的项目。
选填
请求示例
{
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)参考生视频请求示例
{
model_name: 'seedance-v2.0-reference-to-video',
prompt: 'Place the explorer from <<<image_1>>> in the environment from <<<image_2>>>, following the camera movement in <<<video_1>>> and speaking with the reference voice from <<<audio_1>>>',
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 请求示例
{
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 参考生视频请求示例
{
model_name: 'seedance-v2.0-fast-reference-to-video',
prompt: 'Have the dancer from <<<image_1>>> perform the movement from <<<video_1>>> on the stage in <<<image_2>>>, using the rhythm from <<<audio_1>>>',
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 参考生视频参数
必填
参考素材
上述从 1 开始编号的占位符规则同样适用于 Fast 参考生视频模型。
选填
素材限制
这些限制适用于本页模型的首帧图片、尾帧图片和参考素材。
参考音频和参考视频各自的总时长上限为 15 秒。各类素材数量独立计算:最多 9 张图片、3 段视频和 3 段音频。添加视频不会减少可上传的图片数量。
所有模型默认使用 720p,但仍必须提供 resolution。声音开关默认为 true;此开关和参考音频均不影响价格。参考生视频需要至少一张图片或一段视频,不支持仅音频请求。上传参考视频会使生成费用翻倍,与视频数量或时长无关。
响应格式
初始响应
所有模型均返回用于轮询的 task_id:
{
"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} 以检查状态:
{
"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 秒轮询一次以检查状态。
最佳实践
- 选择合适的版本:迭代时使用 Fast 模型,最终输出使用标准模型
- 清晰描述运动:在提示词中加入具体的运动描述
- 分辨率选择:所有标准 Seedance 2.0 模型支持
480p、720p、1080p 和 4k;所有 Fast 模型仅支持 480p 和 720p
- 参考素材顺序:按预期顺序排列
images、videos 和 audios,并在提示词中保持引用一致
- 仅视频请求:仅在提供至少一段参考视频时,才使用空的
images 数组
- 素材时长:每段参考音频和视频均保持在 2 至 15 秒之间
- 音频增强:省略
sound 以使用默认值 true,或设为 false 以禁用生成声音