Skip to main content

Upload Dataset Image

Uploads an image from your local file system to a dataset for training custom 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).
  • Dataset ID (String) - ID of the dataset to upload the image to (from Create Dataset node).
  • Image Path (String) - Local file path to the image you want to upload.

Options

  • API Key - Leonardo AI API key (optional if using Connection ID).
  • Image Type - Image file format:
    • png (Default)
    • jpg
    • jpeg
    • webp

Outputs

This node does not have outputs.

How It Works

The Upload Dataset Image node adds an image to a dataset. When executed, the node:

  1. Validates the dataset ID and image path are not empty
  2. Requests upload credentials from Leonardo AI API
  3. Uploads the image file to the dataset
  4. The image becomes part of the dataset for model training

Requirements

  • Valid Leonardo AI API key (via Connection ID or credentials)
  • Valid dataset ID from a Create Dataset node
  • Valid local file path to an image
  • Image file must exist and be readable
  • Supported image format (png, jpg, jpeg, webp)

Error Handling

The node will return specific errors in the following cases:

  • Empty dataset ID - "Dataset ID cannot be empty. Please provide a valid dataset ID."
  • Empty image path - "Image Path cannot be empty. Please provide a valid file path to the image."
  • File not found - System error if file doesn't exist
  • Upload failed - API error if upload fails

Usage Examples

Build Training Dataset

Upload multiple images to a dataset:

  1. Create Dataset and get the dataset ID
  2. Prepare 5-15 training images
  3. Loop through images:
    • Upload Dataset Image with dataset ID and image path
  4. Use Get Dataset to verify all uploads succeeded
  5. Create Model from the complete dataset

Upload Images from Folder

Batch upload all images from a directory:

// Get list of image files in folder
const imageFolder = '/path/to/training/images/';
const imageFiles = [
'image1.png',
'image2.png',
'image3.png'
// ... more images
];

const datasetId = 'your-dataset-id';

// Loop through and upload each image
imageFiles.forEach(filename => {
const imagePath = imageFolder + filename;
// Use Upload Dataset Image with datasetId and imagePath
});

Upload Product Photos

Build a product training dataset:

  1. Take or collect 10-15 photos of a product from different angles
  2. Create Dataset: "Product - Modern Lamp"
  3. Upload each photo:
    • Image Path: /products/lamp/front.jpg, Type: jpg
    • Image Path: /products/lamp/side.jpg, Type: jpg
    • Image Path: /products/lamp/back.jpg, Type: jpg
    • Continue for all angles
  4. Create model for generating similar products

Upload Character References

Create a character dataset:

  1. Create Dataset: "Character - Space Explorer"
  2. Upload reference images:
    • Full body shot
    • Close-up of face
    • Different poses
    • Various lighting conditions
  3. Ensure 10-15 quality images
  4. Train model for character generation

Usage Notes

  • Upload 5-15 images for best model training results
  • Images should be high quality and clearly show the subject
  • Consistent subject across images improves model quality
  • The dataset ID must be from a dataset you own
  • Image type should match your actual file format
  • Larger images may take longer to upload
  • No output means you should use Get Dataset to verify uploads
  • Use varied angles and lighting for better model versatility
  • Avoid blurry or low-quality images
  • Images should focus on the subject you want to train
  • Consider image resolution - higher quality generally produces better models
  • Upload images in batches using loops for efficiency
  • The image becomes permanently associated with the dataset