Seedance 2.0 Mini API
ByteDance Seedance 2.0 Mini 视频生成模型的完整 API 参考。
模型变体
该 API 支持三个模型变体:
快速对比
支持的宽高比
21:9, 16:9, 9:16, 1:1, 4:3, 3:4
分辨率选项
Seedance 2.0 Mini 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.0-mini-text-to-video',
prompt: 'A golden retriever running through a sunlit meadow',
duration: 6,
resolution: '720p',
aspect_ratio: '16:9',
sound: true
})
});
const { data } = await response.json();
const taskId = data.task_id;
Seedance 2.0 Mini Image to Video
请求参数
必填
可选
示例请求
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-mini-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',
sound: true
})
});
const { data } = await response.json();
const taskId = data.task_id;
Seedance 2.0 Mini Reference to Video
请求参数
必填
参考媒体
每个请求必须至少包含一张图像或一个视频。使用图像引用时,提交 1-9 张图像。仅当 videos 数组包含至少一个参考视频时,images 数组才可以省略或为空。不支持仅包含音频的请求。
@ (AT) 引用占位符
@ (AT) 引用功能通过带编号的 <<<...>>> 占位符将参考媒体关联到提示词。每种媒体类型的编号均独立从 1 开始,并遵循对应数组的顺序:
每个占位符都必须指向其对应数组中实际存在的项目。
可选
参考视频定价
Seedance V2.0 Mini Reference-to-Video 采用与其他 Seedance 2.0 参考变体相同的按分辨率、按秒计费结构。当 videos 数组包含至少一个参考视频时,生成总费用将乘以 2。无论上传的参考视频数量或时长如何,此倍数仅应用一次。
示例请求
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-mini-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: '720p',
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']
})
});
const { data } = await response.json();
const taskId = data.task_id;
响应格式
初始响应
所有模型都会返回用于轮询的 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: 视频生成失败
处理时间
通常处理时间为 2-6 分钟,具体取决于时长和分辨率。
每 5-10 秒轮询一次以检查状态。
最佳实践
- 清晰描述运动:在提示词中包含具体的运动描述
- 分辨率选择:使用
480p 获得更快处理速度,使用 720p 获得更高质量
- 音频增强:保持启用
sound,获得更沉浸的视频体验
- 图生视频:通过
image_url 提供清晰的首帧;需要控制起始帧和结束帧时使用 image_end_url
- 参考媒体:使用支持的图像、视频和音频引用,并确保至少包含一张图像或一个视频
- 参考视频定价:任何包含至少一个参考视频的 Reference-to-Video 请求均按 2 倍收费,无论上传视频的数量或时长如何
- Seed 参数:请勿发送
seed;Seedance 2.0 Mini 模型不支持该参数