Seedance 2.5 Flash API
字节跳动 Seedance 2.5 Flash 视频生成模型的完整 API 参考文档。
模型版本
此 API 支持以下三个模型版本:
快速对比
支持的宽高比
文生视频和参考素材生成视频支持以下宽高比:
21:9, 16:9, 9:16, 1:1, 4:3, 3:4
图生视频不支持 aspect_ratio 参数。
分辨率选项
Seedance 2.5 Flash Text to Video
接口地址
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-flash-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 Flash Image to Video
请求参数
必填参数
可选参数
图生视频模型不支持 aspect_ratio,请勿在请求中传入该参数。
请求示例
{
model_name: 'seedance-v2.5-flash-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 Flash Reference to Video
请求参数
必填参数
参考素材
所有参考素材均为可选项。可以只提供图像、只提供视频、只提供音频,也可以不提供任何参考素材。无需参考素材时,建议使用文生视频模型。
@ (AT) 引用占位符
@ (AT) 引用功能通过带编号的 <<<...>>> 占位符在提示词中指定参考素材。每类素材单独从 1 开始编号,顺序与对应数组一致:
例如,第一张图像用作角色参考、第二张用作场景参考时,可在 prompt 中使用 <<<image_1>>> 指定角色,使用 <<<image_2>>> 指定场景。每个占位符都必须指向对应数组中实际存在的条目。
可选参数
请求示例
{
model_name: 'seedance-v2.5-flash-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-flash-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']
}
素材限制
以下限制适用于本页模型使用的首帧图像、尾帧图像及参考素材。
参考音频与参考视频的总时长分别计算,每类最多 30 秒。各类素材的数量也独立计算:最多可提供 10 张图像、5 段视频和 5 段音频。
所有模型都必须指定 resolution 和 duration,这两个参数均无默认值。文生视频和参考素材生成视频在省略 aspect_ratio 时均使用 16:9。声音开关默认为 true,设为 false 即可生成无声视频。
响应格式
初始响应
所有模型都会返回 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:视频生成失败
处理时间
处理时间取决于视频时长、分辨率和当前排队情况。
每隔 5–10 秒轮询一次,查询任务状态。
最佳实践
- 必填参数:始终提供
prompt、resolution 和 duration。对于文生视频和参考素材生成视频,aspect_ratio 为可选参数,默认为 16:9
- 图生视频宽高比:图生视频请求中请勿传入
aspect_ratio
- 参考视频:视频为可选项,每段视频的时长和视频总时长均须符合本文规定的限制
- 参考图像:图像为可选项,可独立于视频和音频提供。最多可提交 10 个受支持格式的图像 URL
- 参考音频:每段音频须为 2–30 秒,大小不得超过 15 MB,总时长不得超过 30 秒
- 参考素材顺序:按预期的引用顺序排列
images、videos 和 audios 中的条目,并在提示词中按相同顺序引用
- 声音:省略
sound 即可使用默认值 true,设为 false 可关闭声音生成