Phoenix

This guide shows how to generate images using Phoenix models via the Leonardo.AI REST API.

This guide shows how to generate images using Phoenix 1.0 and Phoenix 0.9 models via the Leonardo.AI REST API.

Sample Request

curl --request POST \
     --url https://cloud.leonardo.ai/api/rest/v1/generations \
     --header 'accept: application/json' \
     --header 'authorization: Bearer <YOUR_API_KEY>' \
     --header 'content-type: application/json' \
     --data '{
       "modelId": "de7d3faf-762f-48e0-b3b7-9d0ac3a3fcf3", // Phoenix 1.0
       "contrast": 3.5,
       "prompt": "an orange cat standing on a blue basketball with the text PAWS",
       "num_images": 4,
       "width": 1472,
       "height": 832,
       "alchemy": true,
       "styleUUID": "111dc692-d470-4eec-b791-3475abac4c46",
       "enhancePrompt": false
     }'

Recipe

API Request Endpoint, Headers, Parameters

Endpoint

https://cloud.leonardo.ai/api/rest/v1/generations

Headers

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

Body Parameters

ParameterTypeDefinition
alchemybooleanOptional. When true, enables Quality generation mode for Leonardo Phoenix. This parameter is not supported for Lucid Origin and Lucid Realism.
contrastnumberRequired. Controls the contrast/detail level of generated images. Valid values: [3, 3.5, 4] where 3 corresponds to Low, 3.5 corresponds to Medium, and 4 corresponds to High in the web UI.
enhancePromptstringOptional. Enables prompt enhancement. Set to true for enhanced prompt behavior; when paired with enhancePromptInstruction it refines the prompt further.
enhancePromptInstructionstringOptional. Provides additional instruction used alongside enhancePrompt=true.
heightintegerOptional. Height input resolution.
modelIdstringRequired. UUID of the model to use. Refer to the table below for a list of UUIDs.
num_imagesintegerOptional. Number of images to generate in the batch.
promptstringRequired. Text prompt describing what image you want the model to generate.
seedintegerOptional. Apply a fixed seed to maintain consistency across generation sets.
styleUUIDstringOptional. UUID of a preset style that affects the aesthetic output. Refer to the table below for a list of UUIDs.
ultrabooleanOptional. When true, enables Ultra generation mode.
widthintegerOptional. Width input resolution.

List of Model IDs

PresetModelmodelId
Phoenix 1.0Phoenix 1.0de7d3faf-762f-48e0-b3b7-9d0ac3a3fcf3
Phoenix 0.9Phoenix 0.96b645e3a-d64f-4341-a6d8-7a3690fbf042

List of Style UUIDs

Image Guidance

Sample Request

curl --request POST \
     --url https://cloud.leonardo.ai/api/rest/v1/generations \
     --header 'accept: application/json' \
     --header 'authorization: Bearer <YOUR_API_KEY>' \
     --header 'content-type: application/json' \
     --data '{
       "height": 1024,
       "modelId": "de7d3faf-762f-48e0-b3b7-9d0ac3a3fcf3", // Lucid Origin
       "prompt": "Intricately swirling nebulas dance across a vividly colored galactic map",
       "width": 1024,
       "controlnets": [
             {
                 "initImageId": "06c4d15c-0d32-42b3-bec2-4e1d685d229f",
                 "initImageType": "GENERATED",
                 "preprocessorId": 364, // Content Reference
                 "strengthType": "High"
             }   
         ]
     }'

Body Parameters

ParameterTypeDefinition
initImageIdstringLeonardo Image ID.
initImageTypestringWhether an image is generated on or uploaded to the Leonardo platform. Accepts GENERATED or UPLOADED. To upload an image, see the recipe below.
preprocessorIdintegerID corresponding to the type of image guidance. Refer to the table below for a list of preprocessor IDs.
strengthTypestringStrength of the input image guidance. Accepts Low, Mid, or High.

List of Preprocessor IDs

ModelStyle ReferenceCharacter ReferenceContent Reference
Phoenix 1.0166397364
Phoenix 0.9166397364

Uploading Images