Seedance 2.5 API
字节跳动 Seedance 2.5 视频生成模型的完整 API 参考。
模型变体
此 API 支持三种模型变体:
快速比较
支持的宽高比
文生视频和参考生成视频支持:
21:9, 16:9, 9:16, 1:1, 4:3, 3:4
图生视频不支持 aspect_ratio 参数。
分辨率选项
Seedance 2.5 文生视频
端点
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.5-text-to-video',
prompt: 'A golden retriever running through a sunlit meadow',
resolution: '720p',
duration: 8,
aspect_ratio: '16:9',
sound: true
})
});
const { data } = await response.json();
const taskId = data.task_id;
Seedance 2.5 图生视频
请求参数
必填
可选
请勿在图生视频请求中包含 aspect_ratio。此模型不支持该参数。
请求示例
{
model_name: 'seedance-v2.5-image-to-video',
image_url: 'https://example.com/first-frame.jpg',
image_end_url: 'https://example.com/last-frame.jpg',
prompt: 'Camera slowly pulls back to reveal the full landscape',
resolution: '720p',
duration: 8,
sound: true
}
Seedance 2.5 参考生成视频
请求参数
必填
参考媒体
@ (AT) 引用占位符
@ (AT) 引用功能通过带编号的 <<<...>>> 占位符,将参考媒体关联到提示词。每种媒体类型均从 1 开始独立编号,并遵循对应数组中的顺序:
例如,如果第一张图像是角色参考,第二张图像是场景参考,请在 prompt 中使用 <<<image_1>>> 表示角色,使用 <<<image_2>>> 表示场景。每个占位符必须指向对应数组中实际存在的项目。
可选
请求示例
{
model_name: 'seedance-v2.5-reference-to-video',
prompt: 'Use image one for the subject, video one for the movement, and audio one for the atmosphere',
resolution: '720p',
duration: 8,
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.5-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>>>',
resolution: '720p',
duration: 10,
aspect_ratio: '16:9',
sound: true,
images: [
'https://example.com/explorer-reference.jpg',
'https://example.com/environment-reference.png'
],
videos: ['https://example.com/camera-movement-reference.mp4'],
audios: ['https://example.com/voice-reference.mp3']
}
响应格式
初始响应
所有模型都会返回用于轮询的 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:视频生成失败
处理时间
处理时间会因时长、分辨率和当前队列状况而异。
每隔 5-10 秒轮询一次以检查状态。
最佳实践
- 必填参数:始终提供
resolution 和 duration,并为文生视频和参考生成视频提供 aspect_ratio
- 图生视频宽高比:图生视频请求中请勿发送
aspect_ratio
- 参考视频:参考生成视频至少需要一个视频;每个视频以及视频总时长都必须符合文档所述限制
- 参考图像:提供参考视频时,图像为可选项;使用图像时,请提交 1-30 个受支持的图像 URL
- 参考音频:每个音频片段须为 2-30 秒且不超过 15 MB,总时长不得超过 30 秒
- 引用顺序:按预期顺序排列
images、videos 和 audios,并在提示词中保持一致的引用
- 声音:省略
sound 可使用其默认值 true,或将其设为 false 以禁用生成的声音