进阶 docs.leonardo.ai 2026-11-22 15:11:20 · 0 阅读
第34章 Leonardo.AI 使用 Seedream 5.0 Pro 模型生成图像教程
# 第34章 Seedream 5.0 Pro
本指南介绍如何通过 Leonardo.AI REST API 使用 Seedream 5.0 Pro 模型生成图像。
请求示例
更新于 5 个月前 这个页面对你有帮助吗?
curl --request POST \
--url https://cloud.leonardo.ai/api/rest/v2/generations \
--header 'accept: application/json' \
--header 'authorization: Bearer <YOUR_API_KEY>' \
--header 'content-type: application/json' \
--data '{
"model": "seedream-5.0-pro",
"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"
},
"strength": "MID"
}
]
}
},
"public": false
}'
API 请求端点、请求头和参数
端点
https://cloud.leonardo.ai/api/rest/v2/generations
请求头
--header "accept: application/json" \
--header "authorization: Bearer <YOUR_API_KEY>" \
--header "content-type: application/json"
请求体参数
| 参数 | 类型 | 说明 |
|---|---|---|
| guidances | object | 可选。定义图像引导输入的对象,会影响生成结果。 |
| guidances.image_reference | array | 可选。参考图像数组,最多 10 张。每张参考图包含 image.id、image.type(GENERATED 或 UPLOADED)以及 strength(LOW、MID、HIGH)。 |
| height | integer | 可选。输入分辨率的高度,支持 768 到 2048,默认 2048。 |
| model | string | 必填。模型标识符,设置为 seedream-5.0-pro。 |
| output_format | string | 可选。输出图像格式,支持 jpeg 或 png,默认 jpeg。 |
| prompt | string | 必填。文本提示词,描述希望模型生成的图像内容。 |
| prompt_enhance | string | 可选。控制提示词增强,支持 AUTO、ON 或 OFF,默认 AUTO。 |
| public | boolean | 可选。布尔值,决定生成结果是公开(true)还是私有(false)。 |
| quantity | integer | 可选。单次请求生成的图像数量,支持 1 到 6,默认 1。 |
| seed | integer | 可选。使用固定 seed,保证多组生成结果的一致性。 |
| width | integer | 可选。输入分辨率的宽度,支持 768 到 2048,默认 2048。 |
更新于 5 个月前 这个页面对你有帮助吗?
上一篇
第33章 Leonardo.AI API 使用 Seedream 4.5 图像生成指南
下一篇
第35章 Leonardo.AI API 使用 Seedream 5.0 Flash 模型生成图片指南