Seedance 1.5 Pro API
Seedance 1.5 Pro 影片生成模型的完整 API 參考文件。
模型變體
此 API 支援兩種模型變體:
快速對比
支援的長寬比
21:9, 16:9, 9:16, 1:1, 4:3, 3:4
解析度選項
Seedance 1.5 Pro Text to Video
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-v1.5-pro-text-to-video',
prompt: 'A golden retriever running through a sunlit meadow',
duration: 6,
resolution: '1080p',
aspect_ratio: '16:9'
})
});
const { data } = await response.json();
const taskId = data.task_id;
僅含請求体的可選參數示例:
{
model_name: 'seedance-v1.5-pro-text-to-video',
prompt: 'A golden retriever running through a sunlit meadow',
duration: 6,
resolution: '1080p',
aspect_ratio: '16:9',
sound: true,
camera_fixed: false,
seed: 42
}
Seedance 1.5 Pro 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-v1.5-pro-image-to-video',
image_url: 'https://example.com/image.jpg',
prompt: 'Camera slowly pulls back to reveal the full landscape',
duration: 6,
resolution: '1080p',
aspect_ratio: '16:9'
})
});
const { data } = await response.json();
const taskId = data.task_id;
僅含請求体的示例:
{
model_name: 'seedance-v1.5-pro-image-to-video',
image_url: 'https://example.com/image.jpg',
prompt: 'Camera slowly pulls back to reveal the full landscape',
duration: 6,
resolution: '1080p',
aspect_ratio: '16:9',
sound: 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": {
"videos": [
{
"url": "https://example.com/generated-video.mp4"
}
]
}
}
}
狀態值
submitted:任務已接受,等待處理
processing:影片生成中
succeed:影片生成完成
failed:影片生成失敗
處理時間
典型處理時間:根據時長和解析度,约需 2-5 分鐘。
1080p 的较長影片最多可能需要 8 分鐘。建議每 5-10 秒輪詢一次以檢查狀態。
最佳實踐
- 清晰說明運動:在提示詞中加入具體的动作說明,以獲得更可预期的結果
- 解析度選擇:快速迭代時使用
480p 或 720p,最終輸出使用 1080p
- 攝影機控制:当希望主體成為焦点且不需要攝影機漂移時,设置
camera_fixed: true
- 長寬比:根據目标平台匹配長寬比(例如移动端使用
9:16,桌面端使用 16:9)
- 可重現性:使用
seed 參數重現或迭代特定的生成結果
- 圖像品質:圖像轉影片時,使用高解析度、光线充足的輸入圖像以獲得最佳效果