Skip to content

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 URLhttps://open.dieyuyun.com
兼容协议OpenAI Images API

认证

Bearer Token: Authorization: Bearer YOUR_API_KEY

标准请求字段

字段类型必填默认值说明
modelstring模型标识: doubao-seedream-5.0-lite
promptstring图像描述文本,支持中英文,建议不超过300个汉字
sizestring4096x4096图像尺寸(宽高像素值)
ninteger1生成数量,>1 时启用组图模式
response_formatstringurl返回格式: urlb64_json

支持的尺寸

Seedream 5.0 Lite 支持 2K、3K(5.0-lite 独有)、4K(默认)三个分辨率档位。

2K 分辨率

尺寸比例
2048x20481:1
2304x17284:3
1728x23043:4
2848x160016:9
1600x28489:16
2496x16643:2
1664x24962:3
3136x134421:9

3K 分辨率(5.0-lite 独有)

尺寸比例
3072x30721:1
3456x25924:3
2592x34563:4
4096x230416:9
2304x40969:16
3744x24963:2
2496x37442:3
4704x201621:9

4K 分辨率(默认)

尺寸比例
4096x40961:1
4704x35204:3
3520x47043:4
5504x304016:9
3040x55049:16
4992x33283:2
3328x49922:3
6240x265621:9

扩展参数

字段类型必填默认值说明
imagestring/array参考图片 URL 或 Base64 编码,最多14张
watermarkbooleanfalse是否添加 AI 生成水印
sequential_image_generationstringdisabledauto 启用组图模式 / disabled 单图模式
output_formatstringjpeg输出图片格式:jpegpng(4.5/4.0 版本固定为 jpeg)
tools_web_searchbooleanfalse启用联网搜索生图,提升图片时效性(会增加生成时延)

请求示例

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
    }
  }
}
字段类型说明
createdintegerUnix 时间戳
modelstring模型标识
dataarray生成结果数组
data[].urlstring图像 URL
data[].sizestring实际生成的图像尺寸
usageobject用量统计
usage.generated_imagesinteger生成的图像数量
usage.output_tokensinteger输出消耗的 Token 数
usage.total_tokensinteger总消耗 Token 数
usage.tool_usageobject工具使用统计
usage.tool_usage.web_searchinteger联网搜索调用次数(开启 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 > 1sequential_image_generation: "auto" 可生成系列图,适合创作连环画面、故事板或风格一致的素材集。
  • 提示词技巧: 支持中英文混合提示词,建议不超过300个汉字。描述越具体,生成效果越好。
  • 参考图引导: 通过 image 参数上传参考图(最多14张),可引导生成风格一致的图像。

速率限制

详见 速率限制

相关文档