LeonardoAI
AI API keyGenerate images, textures and motion with Leonardo.Ai from any Windmill script, flow or app.
Set up in 3 steps
Create an API key
In the Leonardo.Ai app, open API Access under your account, and create a production key.
Add the resource in Windmill
Open Resources, add a resource of type leonardoai, and paste the key.
Run your first script
Fork any script below and read before writing anything.
Scripts
Building blocks, if none of the projects above fit. Fork one, run it, or call it as a step inside your own flow.
Upload init image
Upload dataset image
Upload a Single Generated Image to a Dataset
Upload Canvas Editor init and mask image
Upload 3D Model
Train a Custom Model
Train a Custom Element
Perform instant refine on a LCM image
Perform inpainting on a LCM image
Perform Alchemy Upscale on a LCM image
List Platform Models
List Elements
Improve a Prompt
Get variation by ID
Get user information
Get texture generations by 3D Model ID
Get single init image
Get generations by user ID
Get a list of Custom Models by User ID
Get a list of Custom Elements by User ID
Get a Single Generation
Get a Single Dataset by ID
Get a Single Custom Model by ID
Get a Single Custom Element by ID
Get Texture Generation by ID
Get 3D models by user ID
Get 3D Model by ID
Generate a Random prompt
Delete init image
Delete a Single Generation
Resource type
leonardoai — the shape of the credential every script on this page expects.
| Field | Type | Required | What it is |
|---|---|---|---|
| apiKey | string | Yes | API key generated from the dashboard |
Questions
Generation is asynchronous
A generation call returns an id, not an image. Poll the generation until it completes — a flow step that sleeps and re-reads is the usual shape.
Generating costs tokens
Every image draws on your API token balance, which is separate from the web app's credits.
Is my key stored on the hub?
Never. It lives only in your own Windmill workspace, encrypted at rest.