Upload Dataset Generated Image
Uploads a previously generated image from Leonardo AI 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).
- Generated Image Id (String) - ID of the generated image to add to the dataset.
Options
- API Key - Leonardo AI API key (optional if using Connection ID).
Outputs
- Response (String) - ID of the uploaded image in the dataset.
How It Works
The Upload Dataset Generated Image node adds a previously generated image to a dataset. When executed, the node:
- Validates the dataset ID and generated image ID are not empty
- Sends a request to add the generated image to the dataset
- Returns the image ID in 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 generated image ID from a previous Create Generation
- Permission to access the generated image (must be the owner)
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 generated image ID - "Generated Image ID cannot be empty. Please provide a valid generated image ID."
- API error - "Failed to upload generated image to dataset. API response:
{{details}}"
Usage Examples
Add Generated Variations to Dataset
Use generated images to expand your training dataset:
- Create Generation with a base prompt
- Get Generation and extract image IDs
- For each generated image:
- Upload Dataset Generated Image to add it to the dataset
- Use the expanded dataset to train a better model
Iterative Dataset Building
Build a dataset using your own generations:
- Create Dataset for a specific style
- Generate 10 images with similar style
- Loop through generated image IDs:
- Upload Dataset Generated Image for each
- Create Model from the dataset
- Use the model to generate more refined images
Build Dataset from Best Generations
Curate a dataset from high-quality generations:
// Array of generated image IDs
const bestGenerations = [
'gen-image-id-1',
'gen-image-id-2',
'gen-image-id-3'
// Only your best results
];
const datasetId = 'your-dataset-id';
// Upload each to the dataset
bestGenerations.forEach(imageId => {
// Use Upload Dataset Generated Image
// with datasetId and imageId
});
Synthetic Dataset Creation
Create a training dataset entirely from generated images:
- Create Dataset: "Synthetic Landscapes"
- Generate 15-20 landscape images with consistent style
- Upload each generated image to the dataset
- Train a custom model from these synthetic examples
- Use the model to create variations
Combine Generated and Real Images
Build a hybrid dataset:
- Create Dataset
- Upload Dataset Image (real photos): 5-10 images
- Generate similar images using existing models
- Upload Dataset Generated Image (generated): 5-10 images
- Train model on combined dataset
Usage Notes
- Only images you generated can be added to your datasets
- Generated image IDs come from the Create Generation output
- Extract image IDs from the generation object's generated_images array
- Useful for creating synthetic training datasets
- Can combine with real images uploaded via Upload Dataset Image
- Helps expand datasets without collecting more real images
- The generated image must still exist (not deleted)
- Good for creating variations of existing concepts
- Can iteratively improve datasets by generating and adding better examples
- Synthetic datasets can produce creative and consistent models
- Consider the quality of generated images - only add good examples
- The dataset can mix real and generated images
- Generated images remain in their original generation as well