Skip to main content

Create Generation

Generates images from a text prompt using Leonardo AI's powerful image generation models.

Common Properties

  • Name - The custom name of the node.
  • Color - The custom color of the node.
  • Delay Before (sec) - Waits in seconds before executing the node.
  • Delay After (sec) - Waits in seconds after executing node.
  • Continue On Error - Automation will continue regardless of any error. The default value is false.

Inputs

  • Connection Id (String) - Connection ID from the Connect node (optional if API Key credentials are provided directly).
  • Prompt (String) - Text description of the image you want to generate. Be specific and detailed for best results.

Options

  • API Key - Leonardo AI API key (optional if using Connection ID).
  • Negative Prompt (String) - Elements to exclude from the generation. Helps avoid unwanted features in the image.
  • Number Of Images (String) - Number of images to generate (1-8). If width or height exceeds 768, limit is 1-4. Default: 1.
  • Width (String) - Image width in pixels (32-1024, must be multiple of 8). Default varies by model.
  • Height (String) - Image height in pixels (32-1024, must be multiple of 8). Default varies by model.
  • Guidance Scale (String) - How strongly the generation reflects the prompt (1-20). Recommended: 7. Default: 7.
  • Generation Id (String) - ID of an existing image to use in image-to-image generation.
  • Image Id (String) - ID of an Init Image to use in image-to-image generation.
  • Init Strength (String) - How strongly generated images reflect the original in image-to-image (0.1-0.9). Default: 0.5.
  • Number Of Inference Steps (String) - Inference steps for generation quality (30-60). More steps = better quality but slower. Default: 30.
  • Custom Model ID (String) - Custom model ID when "Custom" is selected from Model ID dropdown.
  • Model ID - Pre-trained model to use:
    • Dream Shaper V7
    • Absolute Reality v1.6
    • RPG 4.0
    • SDXL 0.9
    • Dream Shaper V6
    • Dream Shaper V5
    • Leonardo Diffusion
    • Leonardo Signature
    • Leonardo Creative (Default)
    • Leonardo Select
    • 3D Animation Style
    • Custom (requires Custom Model ID)
  • Control Net (Boolean) - Enable ControlNet for guided image generation. Default: False.
  • Control Net Type - Type of ControlNet guidance:
    • POSE - Guide generation using pose detection
    • CANNY - Guide using edge detection
    • DEPTH - Guide using depth maps
    • NONE - No ControlNet (Default: POSE)
  • Preset Style - Preset style to apply:
    • LEONARDO (Default)
    • NONE
  • Prompt Magic (Boolean) - Enable enhanced prompt interpretation. Default: False.
  • Public (Boolean) - Make generated images publicly visible. Default: False.
  • Scheduler - Diffusion process scheduler algorithm:
    • KLMS (Default)
    • EULER ANCESTRAL DISCRETE
    • EULER DISCRETE
    • DDIM
    • DPM SOLVER
    • PNDM
  • Sd Version - Stable Diffusion version:
    • v1_5 (Default)
    • v2
  • Tiling (Boolean) - Enable seamless texture generation. Default: False.

Outputs

  • Generation Id (String) - ID of the created generation job. Use this with Get Generation to retrieve the results.

How It Works

The Create Generation node initiates an image generation job with Leonardo AI. When executed, the node:

  1. Validates the prompt is not empty
  2. Builds the generation request with your specified parameters
  3. Sets default dimensions based on the selected model if not specified
  4. Validates numeric parameters (width, height, guidance scale, etc.)
  5. Sends the generation request to Leonardo AI API
  6. Returns the generation ID for tracking and retrieval

Requirements

  • Valid Leonardo AI API key (via Connection ID or credentials)
  • Non-empty text prompt
  • Valid parameter values within specified ranges
  • Sufficient API credits in your Leonardo AI account

Error Handling

The node will return specific errors in the following cases:

  • Empty prompt - "Prompt cannot be empty. Please provide a text description for the image generation."
  • Custom model selected without ID - "Custom Model ID cannot be empty when Custom Model is selected. Please provide a valid custom model ID."
  • Invalid width - "Width must be a valid integer. Current value: {value}"
  • Invalid height - "Height must be a valid integer. Current value: {value}"
  • Invalid inference steps - "Number of Inference Steps must be a valid integer. Current value: {value}"
  • Invalid guidance scale - "Guidance Scale must be a valid integer. Current value: {value}"
  • Invalid init strength - "Init Strength must be a valid float number. Current value: {value}"
  • API error - "Failed to create generation. API error {status}: {details}"

Usage Examples

Basic Text-to-Image Generation

Generate a simple image from a text prompt:

  • Prompt: "A majestic mountain landscape at sunset with snow-capped peaks"
  • Model ID: Leonardo Creative
  • Number Of Images: 1
  • Use default settings for other parameters

Advanced Generation with Custom Settings

Create a high-quality image with specific parameters:

  • Prompt: "A futuristic cyberpunk city street with neon lights and flying cars"
  • Negative Prompt: "blurry, low quality, distorted, ugly"
  • Model ID: Dream Shaper V7
  • Width: 768
  • Height: 512
  • Guidance Scale: 10
  • Number Of Inference Steps: 50
  • Number Of Images: 4

Image-to-Image Generation

Transform an existing image based on a new prompt:

  • Prompt: "Transform this into a watercolor painting style"
  • Image Id: (ID from Upload Image node)
  • Init Strength: 0.7
  • Model ID: Leonardo Signature

Seamless Texture Generation

Create tileable textures:

  • Prompt: "Seamless wood grain texture, high quality"
  • Tiling: True
  • Width: 512
  • Height: 512

Usage Notes

  • Generation is asynchronous - use Get Generation node to check status and retrieve images
  • Higher guidance scales produce images that follow the prompt more closely
  • More inference steps improve quality but increase generation time
  • Each model has optimal dimensions - defaults are set automatically
  • ControlNet requires additional setup and compatible init images
  • Prompt Magic can enhance prompt interpretation but uses more credits
  • Keep prompts clear and descriptive for best results
  • Use negative prompts to exclude unwanted elements
  • The generation may take 10-60 seconds depending on parameters
  • Check your API credit balance before generating multiple images