Doubao Seedream 5.0 Lite 图像生成
字节跳动最新 Seedream 5.0 Lite 模型,首次支持联网搜索生图,支持 2K/3K/4K 多分辨率和组图模式,在图像质量和时效性上全面领先。
在线体验
快速开始
python
from openai import OpenAI
client = OpenAI(
base_url="https://open.dieyuyun.com/v1",
api_key="YOUR_API_KEY"
)
response = client.images.generate(
model="doubao-seedream-5.0-lite",
prompt="一只橘猫坐在窗台上看雨,水彩风格,温暖色调",
size="4096x4096",
n=1
)
print(response.data[0].url)请求端点
| 项目 | 值 |
|---|---|
| 方法 | POST |
| 路径 | /v1/images/generations |
| Base URL | https://open.dieyuyun.com |
| 兼容协议 | OpenAI Images API |
认证
Bearer Token: Authorization: Bearer YOUR_API_KEY
标准请求字段
| 字段 | 类型 | 必填 | 默认值 | 说明 |
|---|---|---|---|---|
| model | string | 是 | — | 模型标识: doubao-seedream-5.0-lite |
| prompt | string | 是 | — | 图像描述文本,支持中英文,建议不超过300个汉字 |
| size | string | 否 | 4096x4096 | 图像尺寸(宽高像素值) |
| n | integer | 否 | 1 | 生成数量,>1 时启用组图模式 |
| response_format | string | 否 | url | 返回格式: url 或 b64_json |
支持的尺寸
Seedream 5.0 Lite 支持 2K、3K(5.0-lite 独有)、4K(默认)三个分辨率档位。
2K 分辨率
| 尺寸 | 比例 |
|---|---|
2048x2048 | 1:1 |
2304x1728 | 4:3 |
1728x2304 | 3:4 |
2848x1600 | 16:9 |
1600x2848 | 9:16 |
2496x1664 | 3:2 |
1664x2496 | 2:3 |
3136x1344 | 21:9 |
3K 分辨率(5.0-lite 独有)
| 尺寸 | 比例 |
|---|---|
3072x3072 | 1:1 |
3456x2592 | 4:3 |
2592x3456 | 3:4 |
4096x2304 | 16:9 |
2304x4096 | 9:16 |
3744x2496 | 3:2 |
2496x3744 | 2:3 |
4704x2016 | 21:9 |
4K 分辨率(默认)
| 尺寸 | 比例 |
|---|---|
4096x4096 | 1:1 |
4704x3520 | 4:3 |
3520x4704 | 3:4 |
5504x3040 | 16:9 |
3040x5504 | 9:16 |
4992x3328 | 3:2 |
3328x4992 | 2:3 |
6240x2656 | 21:9 |
扩展参数
| 字段 | 类型 | 必填 | 默认值 | 说明 |
|---|---|---|---|---|
| image | string/array | 否 | — | 参考图片 URL 或 Base64 编码,最多14张 |
| watermark | boolean | 否 | false | 是否添加 AI 生成水印 |
| sequential_image_generation | string | 否 | disabled | auto 启用组图模式 / disabled 单图模式 |
| output_format | string | 否 | jpeg | 输出图片格式:jpeg 或 png(4.5/4.0 版本固定为 jpeg) |
| tools_web_search | boolean | 否 | false | 启用联网搜索生图,提升图片时效性(会增加生成时延) |
请求示例
bash
curl https://open.dieyuyun.com/v1/images/generations \
-H "Authorization: Bearer $API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "doubao-seedream-5.0-lite",
"prompt": "一只橘猫坐在窗台上看雨,水彩风格,温暖色调",
"size": "4096x4096",
"n": 1
}'python
from openai import OpenAI
client = OpenAI(
base_url="https://open.dieyuyun.com/v1",
api_key="YOUR_API_KEY"
)
response = client.images.generate(
model="doubao-seedream-5.0-lite",
prompt="一只橘猫坐在窗台上看雨,水彩风格,温暖色调",
size="4096x4096",
n=1
)
print(response.data[0].url)javascript
import OpenAI from 'openai'
const client = new OpenAI({
baseURL: 'https://open.dieyuyun.com/v1',
apiKey: 'YOUR_API_KEY',
})
const response = await client.images.generate({
model: 'doubao-seedream-5.0-lite',
prompt: '一只橘猫坐在窗台上看雨,水彩风格,温暖色调',
size: '4096x4096',
n: 1,
})
console.log(response.data[0].url)响应格式
成功响应
json
{
"created": 1717000000,
"model": "doubao-seedream-5.0-lite",
"data": [
{
"url": "https://...",
"size": "2048x2048"
}
],
"usage": {
"generated_images": 1,
"output_tokens": 16384,
"total_tokens": 16384,
"tool_usage": {
"web_search": 0
}
}
}| 字段 | 类型 | 说明 |
|---|---|---|
| created | integer | Unix 时间戳 |
| model | string | 模型标识 |
| data | array | 生成结果数组 |
| data[].url | string | 图像 URL |
| data[].size | string | 实际生成的图像尺寸 |
| usage | object | 用量统计 |
| usage.generated_images | integer | 生成的图像数量 |
| usage.output_tokens | integer | 输出消耗的 Token 数 |
| usage.total_tokens | integer | 总消耗 Token 数 |
| usage.tool_usage | object | 工具使用统计 |
| usage.tool_usage.web_search | integer | 联网搜索调用次数(开启 tools_web_search 时) |
错误响应
详见 错误码。
5.0-lite 特有能力
联网搜索生图
Seedream 5.0 Lite 首次支持联网搜索生图。开启 tools_web_search 后,模型可搜索互联网内容作为生图参考,显著提升图片的时效性和准确性。
python
response = client.images.generate(
model="doubao-seedream-5.0-lite",
prompt="2025年最新款运动鞋",
size="4096x4096",
tools_web_search=True
)3K 分辨率
独有的 3K 分辨率档位,在图像质量和生成速度之间取得最佳平衡,适合日常使用场景。
python
response = client.images.generate(
model="doubao-seedream-5.0-lite",
prompt="城市天际线,日落时分",
size="3072x3072"
)PNG 输出
支持 output_format 设为 png,满足需要无损格式的场景(如印刷品、透明背景需求等)。4.5/4.0 版本固定输出 jpeg。
python
response = client.images.generate(
model="doubao-seedream-5.0-lite",
prompt="Logo 设计,简洁现代",
size="4096x4096",
output_format="png"
)最佳实践
- 联网搜索: 适合需要时效性的场景,如热点事件、最新商品、时事相关的图像生成。注意开启后会增加生成时延。
- 3K 分辨率: 适合日常使用,在图像质量和生成速度之间取得最佳平衡。对画质有极致要求时可切换到 4K。
- 组图模式: 设置
n > 1或sequential_image_generation: "auto"可生成系列图,适合创作连环画面、故事板或风格一致的素材集。 - 提示词技巧: 支持中英文混合提示词,建议不超过300个汉字。描述越具体,生成效果越好。
- 参考图引导: 通过
image参数上传参考图(最多14张),可引导生成风格一致的图像。
速率限制
详见 速率限制。
相关文档
- Doubao Seedream 4.5 - 使用 Seedream 4.5 版本
- Doubao Seedream 4.0 - 使用 Seedream 4.0 版本
- 模型列表与定价 - 浏览可用模型和定价信息