Leonardo AI API - Image Generation, Upscaling & Custom Models
Pricing
from $0.01 / 1,000 results
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
Maintained by CommunityActor stats
0
Bookmarked
18
Total users
0
Monthly active users
21 days ago
Last modified
Categories
Features
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)
Quick Start
Run with real data
{"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
| Parameter | Type | Default | Required | Description |
|---|---|---|---|---|
task | string | "generate_image" | Yes* | The operation to perform with Leonardo AI |
prompt | string | - | No | Text description of the image to generate |
negativePrompt | string | - | No | What to avoid in the generated image |
modelId | string | - | No | Leonardo AI model ID to use for generation |
presetStyle | string | - | No | Preset style to apply |
width | integer | 1024 | No | Image width in pixels (must be divisible by 8) |
height | integer | 1024 | No | Image height in pixels (must be divisible by 8) |
numImages | integer | 1 | No | Number of images to generate (1-8) |
guidanceScale | number | 7 | No | How closely to follow the prompt (1-20, higher = more literal) |
seed | integer | - | No | Random seed for reproducible results |
public | boolean | false | No | Make generation publicly visible |
alchemy | boolean | false | No | Enable Alchemy for higher quality output |
photoReal | boolean | false | No | Enable PhotoReal for photorealistic images |
generationId | string | - | No | Generation ID for get_generation, upscale, or variations |
imageId | string | - | No | Image ID for upscale or variation operations |
upscaleMultiplier | number | 2 | No | Upscale factor (1.5 or 2) |
apiKey | string | - | Yes* | Your Leonardo AI API key (from app.leonardo.ai/api-access) |
webhookUrl | string | - | No | URL to receive results via webhook for automation platforms |
Pricing
This actor uses pay-per-event billing:
| Event | When it is charged | Price |
|---|---|---|
| Actor start | Once when the run starts, one event per GB of memory (minimum one). At the default 2 GB of memory a run starts at $0.20 | $0.10 per GB |
| Generate Image | Generate images from text prompts with customizable settings | $0.01 |
| Get Generation | Get details of a specific generation | $0.01 |
| List Generations | List recent generations | $0.01 |
| Upscale Image | Upscale images to higher resolution (1.5x or 2x) | $0.01 |
| Generate Variations | Create variations of existing images | $0.01 |
| List Models | List available generation models | $0.01 |
| Get Model | Get details of a specific model | $0.01 |
| List User Generations | List your generations | $0.01 |
| Get User Info | Get account info and credit balance | $0.01 |
| Calculate Cost | Estimate credit cost before generating | $0.01 |
| Result | Each item written to the default dataset | $0.00001 |
Troubleshooting
"API key is required"
- 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?
Run the actor without a Leonardo AI API key, or set demoMode to true, and it completes with labeled sample output that shows the exact format of live results. Every sample item carries demo: true and a _notice field, and sample runs charge no task events. Provide your own Leonardo AI API key in the input to receive live data.
Built by John Rippy | Actor Arsenal