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/generations | 是 | data[].url |
| 图片编辑,同步拿图 | POST /v1/images/edits | 是 | data[].url |
参数总表
支持参数
| 参数 | 类型 | 位置 | 必填 | 说明 |
|---|---|---|---|---|
model | string | body | 是 | seedream-4.0、seedream-4.5、seedream-5.0-lite |
prompt | string | body | 是 | 文生图或编辑提示词 |
n | integer | body | 否 | 输出图片数,1 到 6。OpenAI 兼容字段 |
custom_size | object | body | 否 | 自定义输出尺寸,例如 {"width": 2048, "height": 2048} |
image | string / array | body / form | 编辑必填之一 | 参考图 URL,可传单张或多张 |
image_url | string / object / array | body / form | 编辑必填之一 | 参考图 URL,兼容 { "url": "..." } 写法 |
image_urls | array | body / form | 编辑必填之一 | 多参考图 URL |
images | array | body | 编辑必填之一 | 多参考图 URL,支持字符串或对象 |
timeout_seconds | integer | body | 否 | 同步接口等待超时时间 |
n
- 默认值:
1 - 最小值:
1 - 最大值:
6
示例:
{
"num_images": 3
}
或:
{
"n": 3
}
custom_size 尺寸规则
格式:
{
"custom_size": {
"width": 2048,
"height": 2048
}
}
尺寸约束:
| 模型 | 最小总像素 | 最大总像素 | 最大边长 | 是否要求 16 倍数 |
|---|---|---|---|---|
seedream-4.0 | 921600 | 16777216 | 4096 | 否 |
seedream-4.5 | 3686400 | 16777216 | 4096 | 否 |
seedream-5.0-lite | 3686400 | 16777216 | 4096 | 否 |
常用安全尺寸:
| 尺寸 | 比例 | seedream-4.0 | seedream-4.5 | seedream-5.0-lite |
|---|---|---|---|---|
960x960 | 1:1 | 可用 | 不可用,低于最小像素 | 不可用,低于最小像素 |
1280x720 | 16:9 | 可用 | 不可用,低于最小像素 | 不可用,低于最小像素 |
720x1280 | 9:16 | 可用 | 不可用,低于最小像素 | 不可用,低于最小像素 |
2048x2048 | 1:1 | 可用 | 可用 | 可用 |
2560x1440 | 16:9 | 可用 | 可用 | 可用 |
1440x2560 | 9:16 | 可用 | 可用 | 可用 |
2304x1728 | 4:3 | 可用 | 可用 | 可用 |
1728x2304 | 3:4 | 可用 | 可用 | 可用 |
4096x4096 | 1: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 |
|---|---|
1 | 6 |
5 | 6 |
9 | 6 |
10 | 5 |
同步文生图
最小请求
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.5 和 seedream-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.5 和 seedream-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
}
}'