Phoenix

This guide shows how to generate images using Phoenix models 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": "phoenix-v1.0",
       "parameters": {
           "mode": "FAST",
           "contrast": "MEDIUM",
           "width": 1472,
           "height": 832,
           "prompt": "an orange cat standing on a blue basketball with the text PAWS",
           "quantity": 4,
           "style_ids": [
               "111dc692-d470-4eec-b791-3475abac4c46"
           ]
       },
       "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
contraststringOptional. The contrast the image should have. Accepts LOW, MEDIUM, or HIGH. Defaults to MEDIUM.
guidancesobjectOptional. Object defining image guidance inputs that influence the generated result.
guidances.characterarrayOptional. References a character from an input image to guide the generation (limited to 1). Each reference includes image.id, image.type (UPLOADED or GENERATED), and strength (LOW, MID, HIGH). Defaults to MID.
guidances.contentarrayOptional. References the form and content from an input image to guide the generation (limited to 1). Each reference includes image.id, image.type (UPLOADED or GENERATED), and strength (LOW, MID, HIGH). Defaults to MID.
guidances.image_to_imagearrayOptional. Uses an input image as the starting point for the generation (limited to 1). Each reference includes image.id, image.type (UPLOADED or GENERATED), and strength (LOW, MID, HIGH). Defaults to MID.
guidances.stylearrayOptional. References the style from an input image to guide the generation (limited to 4). Each reference includes image.id, image.type (UPLOADED or GENERATED), and strength (LOW, MID, HIGH, ULTRA, MAX). Defaults to MID.
heightintegerOptional. Height of the image to generate in pixels. Supports 32 to 2048 in multiples of 8. Defaults to 1024.
modestringOptional. Generation mode. Accepts FAST, QUALITY, or ULTRA. Use this instead of quality for all proprietary models. Defaults to FAST.
modelstringRequired. Model identifier. Set to phoenix-v1.0 or phoenix-v0.9. Refer to the table below for a list of models.
negative_promptstringOptional. The negative prompt to use for the generation.
promptstringRequired. Text prompt describing what image you want the model to generate. Maximum 2000 characters.
prompt_enhancestringOptional. Controls prompt enhancement. Accepts AUTO, ON, or OFF. Defaults to AUTO.
publicbooleanOptional. Boolean flag that determines whether the generated images show in the community feed (true) or remain private (false).
quantityintegerOptional. Number of images to generate in a single request. Supports 1 to 8. Defaults to 4.
seedintegerOptional. Apply a fixed seed (minimum 0) to maintain consistency across generation sets.
style_idsarrayOptional. Array of style UUIDs used to apply a preset style to the output (limited to 1 style). Defaults to ["111dc692-d470-4eec-b791-3475abac4c46"] (Dynamic). Refer to the table below for a list of UUIDs.
tilingbooleanOptional. When true, enables tiling.
widthintegerOptional. Width of the image to generate in pixels. Supports 32 to 2048 in multiples of 8. Defaults to 1024.

List of Models

PresetModelmodel
Phoenix 1.0Phoenix 1.0phoenix-v1.0
Phoenix 0.9Phoenix 0.9phoenix-v0.9

List of Style IDs

Both Phoenix 1.0 and Phoenix 0.9 accept the same set of style UUIDs.

Preset StyleUUID
3D Renderdebdf72a-91a4-467b-bf61-cc02bdeb69c6
Bokeh9fdc5e8c-4d13-49b4-9ce6-5a74cbb19177
Cinematica5632c7c-ddbb-4e2f-ba34-8456ab3ac436
Cinematic Concept33abbb99-03b9-4dd7-9761-ee98650b2c88
Creative6fedbf1f-4a17-45ec-84fb-92fe524a29ef
Dynamic111dc692-d470-4eec-b791-3475abac4c46
Fashion594c4a08-a522-4e0e-b7ff-e4dac4b6b622
Graphic Design Pop Art2e74ec31-f3a4-4825-b08b-2894f6d13941
Graphic Design Vector1fbb6a68-9319-44d2-8d56-2957ca0ece6a
Illustration645e4195-f63d-4715-a3f2-3fb1e6eb8c70
Macro30c1d34f-e3a9-479a-b56f-c018bbc9c02a
Minimalistcadc8cd6-7838-4c99-b645-df76be8ba8d8
Moody621e1c9a-6319-4bee-a12d-ae40659162fa
None556c1ee5-ec38-42e8-955a-1e82dad0ffa1
Portraitab5a4220-7c42-41e5-a578-eddb9fed3d75
Pro B&W photography22a9a7d2-2166-4d86-80ff-22e2643adbcf
Pro color photography7c3f932b-a572-47cb-9b9b-f20211e63b5b
Pro film photography581ba6d6-5aac-4492-bebe-54c424a0d46e
Ray Tracedb504f83c-3326-4947-82e1-7fe9e839ec0f
Sketch (B&W)be8c6b58-739c-4d44-b9c1-b032ed308b61
Sketch (Color)093accc3-7633-4ffd-82da-d34000dfc0d6
Stock Photo5bdc3f2a-1be6-4d1c-8e77-992a30824a2c
Vibrantdee282d3-891f-4f73-ba02-7f8131e5541b

Image Guidance

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": "phoenix-v1.0",
       "parameters": {
           "prompt": "Intricately swirling nebulas dance across a vividly colored galactic map",
           "width": 1024,
           "height": 1024,
           "guidances": {
               "content": [
                   {
                       "image": {
                           "id": "06c4d15c-0d32-42b3-bec2-4e1d685d229f",
                           "type": "UPLOADED"
                       },
                       "strength": "HIGH"
                   }
               ]
           }
       },
       "public": false
   }'

Image guidance is configured through the guidances object. Phoenix models support Style Reference (guidances.style, up to 4 references), Content Reference (guidances.content, limited to 1), Character Reference (guidances.character, limited to 1), and Image to Image (guidances.image_to_image, limited to 1). See the Body Parameters table above for the fields each reference accepts.