Krea 2 Turbo

This guide shows how to generate images using the Krea 2 Turbo 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-2-turbo",
       "parameters": {
           "width": 1024,
           "height": 1024,
           "prompt": "Koala with purple wizard hat on a skateboard",
           "quantity": 2
       },
       "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
heightintegerOptional. Height of the image to generate in pixels. Supports 16 to 4096 in multiples of 8. Defaults to 1024.
modelstringRequired. Model identifier. Set to krea-2-turbo.
promptstringRequired. Text prompt describing what image you want the model to generate. Supports up to 9999 characters.
prompt_enhancestringOptional. Controls prompt enhancement. Supports AUTO, ON, or OFF. Defaults to AUTO.
publicbooleanOptional. Boolean flag that determines whether the generation is public (true) or private (false).
quantityintegerOptional. Number of images to generate in a single request. Supports 1 to 8. Defaults to 4.
widthintegerOptional. Width of the image to generate in pixels. Supports 16 to 4096 in multiples of 8. Defaults to 1024.


Did this page help you?