Skip to main content

Create Dataset

Creates a new dataset for training custom models with your own images.

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).
  • The name of the dataset (String) - Name for the new dataset. Must not be empty.
  • Description (String) - Description of what the dataset contains or its purpose.

Options

  • API Key - Leonardo AI API key (optional if using Connection ID).

Outputs

  • Response (Object) - Created dataset details including:
    • Dataset ID (use this to upload images and create models)

How It Works

The Create Dataset node creates a new dataset container. When executed, the node:

  1. Validates the dataset name is not empty
  2. Builds the create dataset request with name and optional description
  3. Sends the request to Leonardo AI API
  4. Returns the dataset ID for uploading images and model training

Requirements

  • Valid Leonardo AI API key (via Connection ID or credentials)
  • Non-empty dataset name
  • Sufficient permissions to create datasets

Error Handling

The node will return specific errors in the following cases:

  • Empty name - "Dataset name cannot be empty. Please provide a name for the dataset."
  • API error - "Failed to create dataset. API response: {{details}}"

Usage Examples

Create Character Dataset

Create a dataset for training a custom character model:

  • Name: "Fantasy Character - Elf Warrior"
  • Description: "Training images for a female elf warrior character in medieval armor"
  • Save the returned dataset ID
  • Upload 10-20 images of the character
  • Create a custom model from the dataset

Create Product Dataset

Build a dataset for product generation:

  • Name: "Modern Chair Designs"
  • Description: "Collection of modern minimalist chair designs for furniture generation"
  • Upload images of chairs with similar style
  • Train a model for generating new chair variations

Create Style Dataset

Create a dataset for a specific art style:

  • Name: "Watercolor Landscapes"
  • Description: "Watercolor painting style landscapes for style transfer"
  • Upload 15-30 watercolor landscape examples
  • Use to train a model that generates in this style

Batch Create Datasets

Create multiple datasets programmatically:

const datasets = [
\{ name: "Dataset A", description: "Description A" \},
\{ name: "Dataset B", description: "Description B" \},
\{ name: "Dataset C", description: "Description C" \}
];

// Loop through and create each dataset
// Store dataset IDs for later use

Usage Notes

  • Choose descriptive names to easily identify datasets later
  • A good description helps remember the dataset's purpose
  • You need 5-15 images minimum to train a quality custom model
  • After creating the dataset, use Upload Dataset Image to add images
  • The dataset ID is required for uploading images and creating models
  • Datasets remain until you delete them
  • You can create multiple datasets for different subjects or styles
  • Best results with consistent, high-quality images in the dataset
  • Consider organizing datasets by subject, style, or project
  • The description is optional but recommended for organization