Ideogram 4.5

This guide shows how to generate images using the Ideogram 4.5 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": "ideogram/ideogram-4.5",
       "parameters": {
           "width": 1024,
           "height": 1024,
           "prompt": "A retro-futuristic concert poster for a synthwave band, bold chrome lettering that reads NEON HORIZON, a glowing sunset grid landscape, palm silhouettes, high contrast magenta and teal palette",
           "quality": "MEDIUM",
           "quantity": 4,
           "prompt_enhance": "AUTO"
       },
       "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
guidances.image_referencearrayOptional. Reference images used to guide the image generation. Accepts up to 5 items.
guidances.image_reference.imageobjectRequired (for each image_reference item). The reference image object.
guidances.image_reference.image.datastringOptional. Base64-encoded image bytes. Required when type is BASE64.
guidances.image_reference.image.heightintegerOptional. Height of the reference image.
guidances.image_reference.image.idstringOptional. UUID of the reference image. Use with type set to UPLOADED, GENERATED, or VARIATION.
guidances.image_reference.image.typestringOptional. Source of the reference image. One of UPLOADED, GENERATED, VARIATION, URL, or BASE64.
guidances.image_reference.image.urlstringOptional. Image URL or a base64 data URL. Required when type is URL.
guidances.image_reference.image.widthintegerOptional. Width of the reference image.
guidances.image_reference.orderintegerOptional. Position of this reference in the list of guidances. Minimum 0.
heightintegerOptional. Height input resolution. Defaults to 1024. Accepts one of: 720, 800, 832, 864, 896, 1024, 1120, 1152, 1248, 1280, 1296, 1440, 1600, 1664, 1728, 1792, 2048, 2240, 2304, 2496, 2560, 2880, 2944, 3072, 3168, 3328.
modelstringRequired. Model identifier. Set to ideogram/ideogram-4.5.
promptstringRequired. Text prompt describing what image you want the model to generate. Accepts 1 to 10000 characters.
prompt_enhancestringOptional. Controls prompt enhancement. One of AUTO, ON, or OFF. Defaults to AUTO.
publicbooleanOptional. Determines whether the generated images show in the community feed (true) or stay private (false).
qualitystringOptional. Output quality tier. One of VERY_LOW, LOW, MEDIUM, or HIGH. Defaults to MEDIUM. Use quality instead of mode for third-party models.
quantityintegerOptional. Number of images to generate in a single request. Accepts 1 to 8. Defaults to 4.
seedintegerOptional. Apply a fixed seed to maintain consistency across generation sets. Accepts 0 to 2147483647.
widthintegerOptional. Width input resolution. Defaults to 1024. Accepts one of: 720, 800, 832, 864, 896, 1024, 1120, 1152, 1248, 1280, 1296, 1440, 1600, 1664, 1728, 1792, 2048, 2240, 2304, 2496, 2560, 2880, 2944, 3072, 3168, 3328.

Did this page help you?