Krea 3
This guide shows how to generate images using the Krea 3 model via the Leonardo.AI REST API.
Sample Request
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": "krea/krea-3",
"parameters": {
"width": 1024,
"height": 1024,
"prompt": "Koala with purple wizard hat on a skateboard",
"quality": "MEDIUM",
"quantity": 2,
"thinking_mode": "fast"
},
"public": false
}'API Request Endpoint, Headers, Parameters
Endpoint
https://cloud.leonardo.ai/api/rest/v2/generationsHeaders
--header "accept: application/json" \
--header "authorization: Bearer <YOUR_API_KEY>" \
--header "content-type: application/json"Body Parameters
| Parameter | Type | Definition |
|---|---|---|
| guidances | object | Optional. Object defining image guidance inputs that influence the generated result. |
| guidances.image_reference | array | Optional. Array of up to 8 reference images. Each reference includes a required image object with image.id and image.type (UPLOADED, GENERATED, VARIATION, URL, or BASE64; use image.url for URL or image.data for BASE64), plus an optional order integer that sets the guidance order. |
| height | integer | Optional. Height of the image to generate in pixels. Supports 256 to 3200 in multiples of 16. Defaults to 1024. |
| model | string | Required. Model identifier. Set to krea/krea-3. |
| prompt | string | Required. Text prompt describing what image you want the model to generate. Supports up to 5000 characters. |
| public | boolean | Optional. Boolean flag that determines whether the generation is public (true) or private (false). |
| quality | string | Optional. How much the model plans the image before it generates it. Supports LOW, MEDIUM, or HIGH. HIGH needs at least one image reference and costs more. Defaults to MEDIUM. |
| quantity | integer | Optional. Number of images to generate in a single request. Supports 1 to 8. Defaults to 4. |
| seed | integer | Optional. Apply a fixed seed to maintain consistency across generation sets. Supports 0 to 2147483647. |
| thinking_mode | string | Optional. Controls generation speed versus detail. Supports slow or fast. slow gives the most detailed images, while fast generates faster. Defaults to fast. |
| width | integer | Optional. Width of the image to generate in pixels. Supports 256 to 3200 in multiples of 16. Defaults to 1024. |
Updated about 3 hours ago
Did this page help you?
