Ideogram 4.6

This guide shows how to generate images using the Ideogram 4.6 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.6",
       "parameters": {
           "width": 2048,
           "height": 2048,
           "prompt": "A vintage travel poster for a coastal town, bold serif lettering that reads VISIT SEABROOK, a lighthouse on rocky cliffs at golden hour, sailboats on a calm turquoise sea, flat screen-print style with warm orange and deep navy 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 of the image in pixels. Defaults to 2048. Supports 256 to 4096 in multiples of 32. The longer side can be at most 6 times the shorter side. When quality is VERY_LOW, the maximum is 2048.
modelstringRequired. Model identifier. Set to ideogram/ideogram-4.6.
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 of the image in pixels. Defaults to 2048. Supports 256 to 4096 in multiples of 32. The longer side can be at most 6 times the shorter side. When quality is VERY_LOW, the maximum is 2048.

Did this page help you?