Seedance 2.0 API
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']
}
快速变体
快速变体优先考虑处理速度。所有快速模型仅支持 "480p" 和 "720p" 输出。快速文本生成视频和快速图像生成视频在其他方面遵循对应标准模型的请求结构,而快速参考视频生成视频使用与标准参考模型相同的参考媒体限制。
快速变体请求示例
{
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) 快速参考视频生成请求示例
{
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 快速参考视频生成视频参数
必填参数
参考媒体
上述从 1 开始编号的占位符约定同样适用于快速参考视频生成视频模型。
可选参数
响应格式
初始响应
所有模型均返回用于轮询的 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": {
"videos": [
{
"url": "https://example.com/generated-video.mp4"
}
]
}
}
}
状态值说明
submitted:任务已提交,等待处理
processing:视频生成中
succeed:视频生成完成
failed:视频生成失败
处理时间
标准模型:根据时长和分辨率,处理时间为 3-8 分钟。
快速模型:大多数配置下处理时间为 1-4 分钟。
建议每 5-10 秒轮询一次以查询状态。
最佳实践
- 选择合适的变体:迭代调试时使用快速模型,最终输出时使用标准模型
- 清晰描述运动:在提示词中包含具体的运动描述
- 分辨率选择:使用
480p 加快处理速度,使用 720p 获得当前最高可用质量
- 摄像机控制:需要固定镜头角度时,将
camera_fixed: true
- 参考视频:参考视频生成视频时,请使用清晰、高质量的参考视频
- 可复现性:使用
seed 参数复现特定的生成结果
- 音频增强:启用
sound 以获得更具沉浸感的视频体验