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 以停用聲音生成