跳到主要内容
AI
MarkdownLLMs.txt

Seedream 图像生成

本文档面向 Seedream 系列图片生成模型,覆盖三个图片模型的接口、参数、限制、响应和示例。

基本信息

鉴权

所有 /v1/* 接口都需要 API Key:

Authorization: Bearer <your_api_key>

支持的模型

Public model能力计费口径
seedream-4.0文生图、图片编辑按输出图片张数
seedream-4.5文生图、图片编辑按输出图片张数
seedream-5.0-lite文生图、图片编辑按输出图片张数

同一个模型名称同时支持文生图和图片编辑:

请求形态操作类型
不传参考图文生图
image / image_url / image_urls / images图片编辑

计费建议:按实际输出图片张数计费。custom_size、横图、竖图、比例本身不改变计费。

推荐入口

场景Endpoint等待结果返回形态
文生图,同步拿图POST /v1/images/generationsdata[].url
图片编辑,同步拿图POST /v1/images/editsdata[].url

参数总表

支持参数

参数类型位置必填说明
modelstringbodyseedream-4.0seedream-4.5seedream-5.0-lite
promptstringbody文生图或编辑提示词
nintegerbody输出图片数,16。OpenAI 兼容字段
custom_sizeobjectbody自定义输出尺寸,例如 {"width": 2048, "height": 2048}
imagestring / arraybody / form编辑必填之一参考图 URL,可传单张或多张
image_urlstring / object / arraybody / form编辑必填之一参考图 URL,兼容 { "url": "..." } 写法
image_urlsarraybody / form编辑必填之一多参考图 URL
imagesarraybody编辑必填之一多参考图 URL,支持字符串或对象
timeout_secondsintegerbody同步接口等待超时时间

n

  • 默认值:1
  • 最小值:1
  • 最大值:6

示例:

{
"num_images": 3
}

或:

{
"n": 3
}

custom_size 尺寸规则

格式:

{
"custom_size": {
"width": 2048,
"height": 2048
}
}

尺寸约束:

模型最小总像素最大总像素最大边长是否要求 16 倍数
seedream-4.0921600167772164096
seedream-4.53686400167772164096
seedream-5.0-lite3686400167772164096

常用安全尺寸:

尺寸比例seedream-4.0seedream-4.5seedream-5.0-lite
960x9601:1可用不可用,低于最小像素不可用,低于最小像素
1280x72016:9可用不可用,低于最小像素不可用,低于最小像素
720x12809:16可用不可用,低于最小像素不可用,低于最小像素
2048x20481:1可用可用可用
2560x144016:9可用可用可用
1440x25609:16可用可用可用
2304x17284:3可用可用可用
1728x23043:4可用可用可用
4096x40961:1可用,最大像素可用,最大像素可用,最大像素

参考图输入

图片编辑模式只支持 URL 参考图。不支持上传本地文件。

可用写法:

{
"image": "https://example.com/a.png"
}
{
"image_url": "https://example.com/a.png"
}
{
"image_url": {
"url": "https://example.com/a.png"
}
}
{
"image_urls": [
"https://example.com/a.png",
"https://example.com/b.png"
]
}
{
"images": [
"https://example.com/a.png",
{
"url": "https://example.com/b.png"
},
{
"image_url": "https://example.com/c.png"
}
]
}

编辑限制:

限制
单次输入参考图最多10
单次输出图最多6
输入图数 + 输出图数最多15

示例:

输入参考图数量最大 num_images
16
56
96
105

同步文生图

最小请求

curl -X POST "$BASE_URL/v1/images/generations" \
-H "Authorization: Bearer $API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "seedream-4.0",
"prompt": "一张干净的高端耳机产品图,白色摄影棚背景,柔和阴影"
}'

响应:

{
"created": 1778688000,
"data": [
{
"url": "https://example.com/generated-1.png"
}
]
}

一次生成 6 张

curl -X POST "$BASE_URL/v1/images/generations" \
-H "Authorization: Bearer $API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "seedream-4.5",
"prompt": "高端护肤品广告图,玻璃瓶,水滴质感,真实商业摄影",
"num_images": 6,
"custom_size": {
"width": 2048,
"height": 2048
}
}'

16:9 横图

seedream-4.5seedream-5.0-lite 的最小像素更高,建议用 2560x1440 起步:

curl -X POST "$BASE_URL/v1/images/generations" \
-H "Authorization: Bearer $API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "seedream-5.0-lite",
"prompt": "16:9 电影感城市夜景,霓虹灯,雨后街道,超写实",
"n": 2,
"custom_size": {
"width": 2560,
"height": 1440
}
}'

9:16 竖图

curl -X POST "$BASE_URL/v1/images/generations" \
-H "Authorization: Bearer $API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "seedream-4.5",
"prompt": "竖版手机壁纸,未来主义跑车,夜晚街景,强烈光影",
"num_images": 1,
"custom_size": {
"width": 1440,
"height": 2560
}
}'

seedream-4.0 小尺寸示例

1280x720 只适合 seedream-4.0,不适合 seedream-4.5seedream-5.0-lite

curl -X POST "$BASE_URL/v1/images/generations" \
-H "Authorization: Bearer $API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "seedream-4.0",
"prompt": "横版社交媒体封面,蓝天草地,清爽插画风",
"custom_size": {
"width": 1280,
"height": 720
}
}'

同步图片编辑

JSON 单参考图

curl -X POST "$BASE_URL/v1/images/edits" \
-H "Authorization: Bearer $API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "seedream-4.0",
"prompt": "把图片改成电影海报风格,增强光影,保留主体人物",
"image": "https://example.com/source.png",
"num_images": 1,
"custom_size": {
"width": 2048,
"height": 2048
}
}'

JSON 多参考图

curl -X POST "$BASE_URL/v1/images/edits" \
-H "Authorization: Bearer $API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "seedream-4.5",
"prompt": "将两张参考图融合成同一套品牌广告视觉,保持产品一致性",
"image_urls": [
"https://example.com/product.png",
"https://example.com/background.png"
],
"n": 3,
"custom_size": {
"width": 2560,
"height": 1440
}
}'

images 数组对象写法

curl -X POST "$BASE_URL/v1/images/edits" \
-H "Authorization: Bearer $API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "seedream-5.0-lite",
"prompt": "参考第一张的人物和第二张的服装,生成一张统一风格的商业大片",
"images": [
{ "url": "https://example.com/person.png" },
{ "image_url": "https://example.com/outfit.png" }
],
"num_images": 2,
"custom_size": {
"width": 2048,
"height": 2048
}
}'