Leonardo AI API - Image Generation, Upscaling & Custom Models avatar

Leonardo AI API - Image Generation, Upscaling & Custom Models

Pricing

from $0.01 / 1,000 results

Go to Apify Store
Leonardo AI API - Image Generation, Upscaling & Custom Models

Leonardo AI API - Image Generation, Upscaling & Custom Models

Generate stunning AI images with Leonardo AI's powerful image generation models. Create images from text prompts, upscale existing images, generate variations, and access custom-trained models through a simple interface.

Pricing

from $0.01 / 1,000 results

Rating

0.0

(0)

Developer

The Howlers

The Howlers

Maintained by Community

Actor stats

0

Bookmarked

10

Total users

0

Monthly active users

7 days ago

Last modified

Share

Generate stunning AI images with Leonardo AI. Create images from text prompts, upscale existing images, generate variations, and use custom-trained models. Perfect for content creation, marketing, game assets, and creative automation.

BYOK (Bring Your Own Key) -- you provide your own API credentials.


Before You Start

This actor requires your own API credentials to fetch real data.

Where to get your key: Your Leonardo AI API key (from app.leonardo.ai/api-access)

You can test with Demo Mode first (free, no key needed) to see the output format before committing.


Quick Start

Test with Demo Mode (free, no API key needed)

{
"demoMode": true
}

Run with real data

{
"demoMode": false,
"task": "generate_image",
"width": 1024,
"height": 1024,
"numImages": 1,
"guidanceScale": 7,
"public": false,
"alchemy": false,
"photoReal": false,
"upscaleMultiplier": 2,
"apiKey": "YOUR_API_KEY_HERE"
}

Input Parameters

ParameterTypeDefaultRequiredDescription
taskstring"generate_image"Yes*The operation to perform with Leonardo AI
promptstring-NoText description of the image to generate
negativePromptstring-NoWhat to avoid in the generated image
modelIdstring-NoLeonardo AI model ID to use for generation
presetStylestring-NoPreset style to apply
widthinteger1024NoImage width in pixels (must be divisible by 8)
heightinteger1024NoImage height in pixels (must be divisible by 8)
numImagesinteger1NoNumber of images to generate (1-8)
guidanceScalenumber7NoHow closely to follow the prompt (1-20, higher = more literal)
seedinteger-NoRandom seed for reproducible results
publicbooleanfalseNoMake generation publicly visible
alchemybooleanfalseNoEnable Alchemy for higher quality output
photoRealbooleanfalseNoEnable PhotoReal for photorealistic images
generationIdstring-NoGeneration ID for get_generation, upscale, or variations
imageIdstring-NoImage ID for upscale or variation operations
upscaleMultipliernumber2NoUpscale factor (1.5 or 2)
apiKeystring-Yes*Your Leonardo AI API key (from app.leonardo.ai/api-access)
webhookUrlstring-NoURL to receive results via webhook for automation platforms
demoModebooleantrueNoRun with sample data for testing (no API calls made)

*Required when Demo Mode is off.


Pricing

This actor uses pay-per-event billing:

EventDescriptionPrice
Image GeneratedEach image generated via Leonardo AI$0.02

Demo mode is free -- no charges for sample data.


Troubleshooting

"API key is required"

You have Demo Mode turned off but didn't provide an API key. Either:

  • Turn Demo Mode on to test with sample data
  • Add your API key in the input

"API error 403" or "Unauthorized"

Your API key is invalid, expired, or doesn't have access to this specific API endpoint. Double-check your key and account permissions.

"API error 429" or "Rate limit"

Too many requests. Wait a minute and try again, or reduce the number of items per run.

No results or empty dataset

Check the run log for error messages. Common causes:

  • Invalid input format (check the examples above)
  • API key without proper permissions
  • The target data doesn't exist or is too small to track

How do I test without an API key?

Enable Demo Mode in the input. This returns realistic sample data so you can verify the output format works for your workflow.


Built by John Rippy | Actor Arsenal