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 文字生成影片
API 位址
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 以獲得更具沉浸感的影片體驗