Seedream 5.0 Pro API
ByteDance Seedream 5.0 Pro 模型的完整 API 參考。
模型變體
此 API 支援兩種模型變體:
快速比較
支援的長寬比
16:9、4:3、3:2、1:1、2:3、3:4、9:16、21:9
Seedream 5.0 Pro(文字轉圖像)
端點
POST /api/v1/image/task
請求參數
必填參數
注意: 長寬比必須為以下值之一:16:9、4:3、3:2、1:1、2:3、3:4、9:16、21:9
請求範例
const response = await fetch('https://api.flaq.ai/api/v1/image/task', {
method: 'POST',
headers: {
'Authorization': 'Bearer YOUR_API_KEY',
'Content-Type': 'application/json'
},
body: JSON.stringify({
model_name: 'seedream-v5.0-pro',
prompt: 'Editorial fashion portrait, soft window light, muted palette',
resolution: '1k',
width: 16,
height: 9
})
});
const { data } = await response.json();
const taskId = data.task_id;
const pollResponse = await fetch(
`https://api.flaq.ai/api/v1/image/${taskId}`,
{
headers: { 'Authorization': 'Bearer YOUR_API_KEY' }
}
);
const result = await pollResponse.json();
console.log(result.data.task_result.images[0].url);
Seedream 5.0 Pro Edit(圖片編輯)
端點
POST /api/v1/image/task
請求參數
必填參數
注意: 長寬比必須為以下值之一:16:9、4:3、3:2、1:1、2:3、3:4、9:16、21:9
計費說明: 從第二張參考圖像開始,每增加一張圖像都會依設定的固定單圖費率計費。
請求範例
const response = await fetch('https://api.flaq.ai/api/v1/image/task', {
method: 'POST',
headers: {
'Authorization': 'Bearer YOUR_API_KEY',
'Content-Type': 'application/json'
},
body: JSON.stringify({
model_name: 'seedream-v5.0-pro-edit',
prompt: 'Change the hairstyle',
image_url_list: [
'https://img.bestimage.ai/test/2026/7/1/ad8e011a-3e9b-49f0-9397-282bf51e2e45_162640331.jpeg'
],
resolution: '1k',
width: 16,
height: 9
})
});
const { data } = await response.json();
const taskId = data.task_id;
const pollResponse = await fetch(
`https://api.flaq.ai/api/v1/image/${taskId}`,
{
headers: { 'Authorization': 'Bearer YOUR_API_KEY' }
}
);
const result = await pollResponse.json();
console.log(result.data.task_result.images[0].url);
單圖編輯範例
{
model_name: 'seedream-v5.0-pro-edit',
image_url_list: ['https://img.bestimage.ai/test/2026/7/1/ad8e011a-3e9b-49f0-9397-282bf51e2e45_162640331.jpeg'],
prompt: 'Change the hairstyle',
resolution: '1k',
width: 16,
height: 9
}
多圖編輯範例
{
model_name: 'seedream-v5.0-pro-edit',
image_url_list: [
'https://example.com/image1.jpg',
'https://example.com/image2.jpg'
],
prompt: 'Blend these images into a cohesive composition',
resolution: '1k',
width: 16,
height: 9
}
回應格式
初始回應
{
"code": 0,
"message": "success",
"data": {
"task_id": "0ca5f379-327b-4d49-ba19-e38782ceb2f0",
"response_url": "https://api.flaq.ai/api/v1/image/0ca5f379-327b-4d49-ba19-e38782ceb2f0",
"task_status": "submitted"
}
}
輪詢回應
輪詢 GET /api/v1/image/{task_id} 以檢查狀態:
{
"code": 0,
"data": {
"task_id": "{task_id}",
"task_status": "succeed",
"task_status_msg": null,
"response_url": "https://api.flaq.ai/api/v1/image/{task_id}",
"task_result": {
"credit": 0.09,
"images": [
{
"url": "https://example.com/generated-image.jpeg"
}
]
}
},
"message": "success"
}
錯誤回應
{
"code": 1201,
"message": "[width, height] Invalid parameter (e.g. wrong key or value)",
"data": null
}
狀態值
submitted:任務已接受
processing:圖像生成進行中
succeed:圖像生成已完成
failed:圖像生成失敗
處理時間
典型處理時間:15–60 秒,具體取決於複雜程度。
最佳實務
- 詳細提示詞:說明越詳細,生成結果越好
- 長寬比:生成前,請依目標使用情境選擇符合的比例
- 圖片編輯品質:進行編輯時,請使用高解析度、光線充足的來源圖像