View as Markdown
Leonardo AI icon

Leonardo AI ACTION

Generate Image

Generates new images using Leonardo AI's image generation API. See the documentation
  • Action
  • Writes data
  • API key
  • SDK
  • MCP

IMPLEMENTATION

Call this tool

Connect a user's Leonardo AI account once, then configure and run Generate Image from your backend or agent.

import { PipedreamClient } from "@pipedream/sdk"

const pd = new PipedreamClient({
  projectId: process.env.PIPEDREAM_PROJECT_ID!,
  clientId: process.env.PIPEDREAM_CLIENT_ID!,
  clientSecret: process.env.PIPEDREAM_CLIENT_SECRET!,
  projectEnvironment: "production",
})

const result = await pd.actions.run({
  id: "leonardo_ai-generate-image",
  externalUserId: "{external_user_id}", // any stable ID for this user in your system
  configuredProps: {
    leonardo_ai: { authProvisionId: "apn_xxxxxxx" },
    prompt: "Prompt",
    modelId: "Model",
  },
})

console.log(result)

SCHEMA

Inputs

Pipedream supplies the connected account. Your application provides the operation-specific values below. Dynamic inputs are resolved against that user's account.

Generate Image inputs
Property Type Description
prompt Prompt string
The text prompt describing the image you want to generate.
Required
modelId Model string
The model to use for generation. Leave empty to use the default model.
Optional Dynamic
width Width integer
Width of the generated image in pixels.
Required
height Height integer
Height of the generated image in pixels.
Required
numImages Number of Images integer
Number of images to generate (1-8). If either width or height is over 768, must be between 1 and 4.
Required
guidanceScale Guidance Scale integer
How closely the model should follow the prompt. Must be between 1 and 20. Higher values = more adherence to prompt.
Optional
numInferenceSteps Inference Steps integer
Number of denoising steps. More steps = higher quality but slower generation.
Optional
seed Seed integer
Random seed for reproducible generation. Leave empty for random generation.
Optional

REFERENCE

Tool details

Behavior hints are published with the component in the Pipedream registry and surface as MCP tool annotations, so an agent can reason about a tool before it calls it.

Registry key
leonardo_ai-generate-image
Version
0.0.3
App
Leonardo AI
Authentication
API key
Read-only
No
Destructive
No
Open world
Yes