进阶 docs.leonardo.ai 2026-11-22 15:11:20 · 0 阅读
第35章 Leonardo.AI API 使用 Seedream 5.0 Flash 模型生成图片指南
Seedream 5.0 Flash
本指南介绍如何通过 Leonardo.AI REST API 使用 Seedream 5.0 Flash 模型生成图片。
请求示例
curl --request POST \
--url https://cloud.leonardo.ai/api/rest/v2/generations \
--header 'accept: application/json' \
--header 'authorization: Bearer ' \
--header 'content-type: application/json' \
--data '{
"model": "bytedance/seedream-5.0-flash",
"parameters": {
"width": 2048,
"height": 2048,
"prompt": "Koala with purple wizard hat on a skateboard",
"quantity": 2,
"guidances": {
"image_reference": [
{
"image": {
"id": "YOUR_UPLOADED_IMAGE_ID",
"type": "UPLOADED"
}
}
]
}
},
"public": false
}'
API 请求地址、请求头与参数
Endpoint
https://cloud.leonardo.ai/api/rest/v2/generations
Headers
--header "accept: application/json" \
--header "authorization: Bearer " \
--header "content-type: application/json"
Body 参数
更新于约 2 个月前
这个页面对你有帮助吗?
| 参数 | 类型 | 说明 |
|---|---|---|
| guidances | object | 可选。定义图像引导输入的对象,会影响生成结果。 |
| guidances.image_reference | array | 可选。最多 10 张参考图片的数组。每张参考需包含 image.type(UPLOADED、GENERATED、VARIATION、URL 或 BASE64),以及对应的 image.id、image.url 或 image.data。 |
| height | integer | 可选。输入分辨率的高度,支持 1024 到 3008,默认 2048。 |
| model | string | 必填。模型标识,设为 bytedance/seedream-5.0-flash。 |
| output_format | string | 可选。输出图片格式,支持 jpeg 或 png,默认 jpeg。 |
| prompt | string | 必填。描述想要生成图片的文本提示词,支持 1 到 9999 个字符。 |
| prompt_enhance | string | 可选。控制提示词增强,支持 AUTO、ON 或 OFF,默认 AUTO。 |
| public | boolean | 可选。布尔值,决定生成结果是公开(true)还是私密(false)。 |
| quantity | integer | 可选。单次请求生成的图片数量,支持 1 到 8,默认 1。 |
| width | integer | 可选。输入分辨率的宽度,支持 1024 到 3008,默认 2048。 |
上一篇
第34章 Leonardo.AI 使用 Seedream 5.0 Pro 模型生成图像教程
下一篇
第36章 使用 Leonardo.AI API 调用 Seedream 5.5 图像生成模型