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:
- Validates the dataset ID and image path are not empty
- Requests upload credentials from Leonardo AI API
- Uploads the image file to the dataset
- 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:
- Create Dataset and get the dataset ID
- Prepare 5-15 training images
- Loop through images:
- Upload Dataset Image with dataset ID and image path
- Use Get Dataset to verify all uploads succeeded
- 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:
- Take or collect 10-15 photos of a product from different angles
- Create Dataset: "Product - Modern Lamp"
- 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
- Image Path:
- Create model for generating similar products
Upload Character References
Create a character dataset:
- Create Dataset: "Character - Space Explorer"
- Upload reference images:
- Full body shot
- Close-up of face
- Different poses
- Various lighting conditions
- Ensure 10-15 quality images
- 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