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 秒,具体取决于复杂程度。
最佳实践
- 详细提示词:描述越详细,生成结果越好
- 宽高比:生成前,请根据目标使用场景选择匹配的比例
- 图像编辑质量:进行编辑时,请使用高分辨率、光线充足的源图像