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/generations

Headers

--header "accept: application/json" \
--header "authorization: Bearer <YOUR_API_KEY>" \
--header "content-type: application/json"

Body Parameters

ParameterTypeDefinition
guidancesobjectOptional. Object defining image guidance inputs that influence the generated result.
guidances.image_referencearrayOptional. 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.
heightintegerOptional. Height of the image to generate in pixels. Supports 256 to 3200 in multiples of 16. Defaults to 1024.
modelstringRequired. Model identifier. Set to krea/krea-3.
promptstringRequired. Text prompt describing what image you want the model to generate. Supports up to 5000 characters.
publicbooleanOptional. Boolean flag that determines whether the generation is public (true) or private (false).
qualitystringOptional. 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.
quantityintegerOptional. Number of images to generate in a single request. Supports 1 to 8. Defaults to 4.
seedintegerOptional. Apply a fixed seed to maintain consistency across generation sets. Supports 0 to 2147483647.
thinking_modestringOptional. Controls generation speed versus detail. Supports slow or fast. slow gives the most detailed images, while fast generates faster. Defaults to fast.
widthintegerOptional. Width of the image to generate in pixels. Supports 256 to 3200 in multiples of 16. Defaults to 1024.

Did this page help you?