最近更新时间:2026-01-19 20:40:03
字段 | 类型 | 是否必填 | 默认值 | 描述 |
model | string | 必填 | 无 | 本次请求使用模型的Model ID或推理接入点。 |
prompt | string/array | 必填 | 无 | 用于生成图像的提示词,支持中英文。建议不超过300个汉字或600个英文单词。字数过多信息容易分散,模型可能因此忽略细节,只关注重点,造成图片缺失部分元素。 |
image | string/array | 选填 | 无 | 输入的图片信息,支持 URL 或 Base64 编码。doubao-seedream-4.5支持单图或多图输入。
|
size | string | 选填 | 2048*2048 | 指定生成图像的尺寸信息,支持以下两种方式,不可混用。
|
sequential_image_generation | string | 选填 | disabled | 控制是否关闭组图功能。
|
sequential_image_generation_options | object | 选填 | 无 | 组图功能的配置。仅当 sequential_image_generation 为 auto 时生效。 |
sequential_image_generation_options
| integer | 选填 | 15 | 指定本次请求,最多可生成的图片数量。
|
stream | boolean | 选填 | false | 控制是否开启流式输出模式。
|
response_format | string | 选填 | url | 指定生成图像的返回格式。 生成的图片为 jpeg 格式,支持以下两种返回方式:
|
watermark | boolean | 选填 | true | 是否在生成的图片中添加水印。
|
curl https://kspmas.ksyun.com/v1/images/generations \
-H "Content-Type: application/json" \
-H "Authorization: Bearer $KSC_API_KEY" \
-d '{
"model": "doubao-seedream-4.5",
"prompt": "充满活力的特写编辑肖像,模特眼神犀利,头戴雕塑感帽子,色彩拼接丰富,眼部焦点锐利,景深较浅,具有Vogue杂志封面的美学风格,采用中画幅拍摄,工作室灯光效果强烈。",
"size": "2K",
"watermark": false
}'基于已有图片,结合文字指令进行图像编辑,包括图像元素增删、风格转化、材质替换、色调迁移、改变背景/视角/尺寸等。
curl https://kspmas.ksyun.com/v1/images/generations \
-H "Content-Type: application/json" \
-H "Authorization: Bearer $KSC_API_KEY" \
-d '{
"model": "doubao-seedream-4.5",
"prompt": "将这张图片改为迪士尼风格,图片内容不要进行变动,只对风格进行变动",
"image": "https://images.unsplash.com/photo-1759979702262-71e15fa210d4?q=80&w=1287&auto=format&fit=crop&ixlib=rb-4.1.0&ixid=M3wxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8fA%3D%3D",
"size": "2K",
"watermark": false
}'根据输入的文本描述和多张参考图片,融合它们的风格、元素等特征来生成新图像。如衣裤鞋帽与模特图融合成穿搭图,人物与风景融合为人物风景图等。
curl https://kspmas.ksyun.com/v1/images/generations \
-H "Content-Type: application/json" \
-H "Authorization: Bearer $KSC_API_KEY" \
-d '{
"model": "doubao-seedream-4.5",
"prompt": "将图1中人物的服装换为图2中的服装",
"image": ["https://allprodad.com/wp-content/uploads/2021/03/05-12-21-happy-people.jpg", "https://www.covenanthouse.org/sites/default/files/styles/805x740/public/2023-08/bipoc-youth.jpg.webp?itok=0gtkoEHM"],
"sequential_image_generation": "disabled",
"size": "2K",
"watermark": false
}'curl https://kspmas.ksyun.com/v1/images/generations \
-H "Content-Type: application/json" \
-H "Authorization: Bearer $KSC_API_KEY" \
-d '{
"model": "doubao-seedream-4.5",
"prompt": "生成一组共4张连贯插画,核心为同一庭院一角的四季变迁,以统一风格展现四季独特色彩、元素与氛围",
"size": "2K",
"sequential_image_generation": "auto",
"sequential_image_generation_options": {
"max_images": 4
},
"stream": false,
"response_format": "url",
"watermark": false
}'curl https://kspmas.ksyun.com/v1/images/generations \
-H "Content-Type: application/json" \
-H "Authorization: Bearer $KSC_API_KEY" \
-d '{
"model": "doubao-seedream-4.5",
"prompt": "生成图中人物的正视图、左视图及右视图",
"image": "https://allprodad.com/wp-content/uploads/2021/03/05-12-21-happy-people.jpg",
"size": "2K",
"sequential_image_generation": "auto",
"sequential_image_generation_options": {
"max_images": 4
},
"stream": false,
"response_format": "url",
"watermark": false
}'curl https://kspmas.ksyun.com/v1/images/generations \
-H "Content-Type: application/json" \
-H "Authorization: Bearer $KSC_API_KEY" \
-d '{
"model": "doubao-seedream-4.5",
"prompt": "生成3张图中动物一起在河边喝水的场景,涵盖草原、树林、雪山",
"image": ["https://images.unsplash.com/photo-1591824438708-ce405f36ba3d?w=400&auto=format&fit=crop&q=60&ixlib=rb-4.1.0&ixid=M3wxMjA3fDB8MHxzZWFyY2h8NHx8YW5pbWFsc3xlbnwwfHwwfHx8MA%3D%3D", "https://plus.unsplash.com/premium_photo-1666278379770-440439b08656?w=400&auto=format&fit=crop&q=60&ixlib=rb-4.1.0&ixid=M3wxMjA3fDB8MHxzZWFyY2h8MXx8YW5pbWFsc3xlbnwwfHwwfHx8MA%3D%3D"],
"sequential_image_generation": "auto",
"sequential_image_generation_options": {
"max_images": 3
},
"size": "2K",
"watermark": false
}'
纯净模式
