This is a community node collection for n8n developed by Self-Host Hub that enables integration with various AI services, starting with Leonardo.ai. These nodes allow workflow automation with AI image and content generation capabilities.
Self-Host Hub is dedicated to creating high-quality, production-ready n8n nodes for AI and content generation services. Our nodes are designed to work seamlessly with Self-Host Hub Studio, our no-code AI platform, but can also be used independently in any n8n installation.
- Link Tree: linktr.ee/selfhosthub
This is an unofficial integration not affiliated with, endorsed by, or connected to Leonardo.ai. Leonardo is a trademark of Leonardo.ai, Inc. All product and company names are trademarks™ or registered® trademarks of their respective holders. Use of them does not imply any affiliation with or endorsement by them.
- Generate AI images using text prompts
- Fine-tune generation with negative prompts, guidance scaling, and scheduling options
- Support for all Leonardo.ai official models plus custom model IDs
- Image-to-image generation with customizable strength
- Prompt Magic support for better prompt adherence
- Transparency and tiling options
- Customizable inference steps and seed values
- Flexible input/output options for integration with other n8n workflows
- Comprehensive error handling and retry logic
- 100% test coverage with automated tests
Follow these steps to install this custom node:
- In n8n, Click
Settings
->Community Nodes
- In the npm Package Name field, enter
n8n-nodes-selfhosthub
then Install - Restart n8n
- Click
add node
->Advanced AI
- Click
Self-Host Hub (Leonardo)
. (You may have to expand "Results in other categories")
A specialized node designed for working with Leonardo.ai API for image generation that provides:
- Image Generation: Create stunning AI-generated images from text prompts with advanced parameters and controls
- Full compatibility with Self-Host Hub Studio and n8n workflows
- Comprehensive options for fine-tuning image generation with the latest Leonardo.ai capabilities
To use this node, you'll need a Leonardo AI API key:
- Create an account at Leonardo.ai
- Go to your profile settings and navigate to the API section
- Generate a new API key
- Copy and paste the key into n8n's credentials for "Self-Host Hub - Leonardo AI API"
- Add the "Self-Host Hub (Leonardo)" node to your workflow
- Configure your image generation parameters
- Enter a descriptive prompt
- Choose a model, width, height, and number of images
- Run the workflow to generate images
- Follow steps 1-4 from basic image generation
- Enable "Advanced Options"
- Add a negative prompt to specify what you don't want in the image
- Adjust the guidance scale (higher values = more prompt-adherent images)
- Choose a scheduler for different generation styles
- Set init strength if using image-to-image generation
The node returns a structured JSON response with the following fields:
-
success
: Boolean indicating if the generation was successful -
generationId
: Unique identifier for the generation -
status
: Status of the generation (e.g., "COMPLETE") -
prompt
: The text prompt used for generation -
modelId
: The model used for generation -
imageCount
: Number of images generated -
images
: Array of generated image objects, each containing:-
id
: Unique image identifier -
url
: URL to the generated image -
nsfw
: Boolean indicating if the image is flagged as NSFW -
width
: Width of the generated image -
height
: Height of the generated image
-
-
rawResponse
: The full API response for advanced use cases
As this node package continues to evolve, we've identified several areas for enhancement based on code review and user feedback:
- Refactor the execute method into smaller, more maintainable functions
- Extract polling logic into a reusable utility function
- Consolidate credential files to reduce duplication and improve consistency
- Strengthen parameter handling with more consistent naming between camelCase and snake_case
- Add JSDoc comments to all exported classes and functions
- Expand usage examples with more real-world workflow scenarios
- Document error conditions and provide troubleshooting guidance
- Implement request caching for repetitive operations
- Optimize polling intervals based on Leonardo.ai API response patterns
- Improve error recovery strategies for intermittent API issues
- Eliminate all istanbul ignore directives by creating comprehensive tests for difficult-to-reach code paths
- Increase test coverage for edge cases and error scenarios
- Refactor code to improve testability of complex conditional logic
- Implement more thorough parameter validation testing
- Improve organization of test files to reduce overlapping tests
- Add more comprehensive documentation for manual test procedures
This node package is designed with expandability in mind as part of the Self-Host Hub collection. Future development consideration includes:
-
Creative Assets & Generation:
- Video Generation API - Create AI-generated videos from text prompts
- Texture Generation API - Generate seamless textures for 3D models and game development
- Image Variation API - Create variations of existing images
- Init Image Generation API - Advanced image-to-image generation
-
3D Asset Creation:
- 3D Model Generation API - Generate 3D models from text descriptions
- 3D Model Texturing API - Apply AI-generated textures to 3D models
- Character Generation API - Create detailed character models for games and animations
-
Content Management:
- Dataset Operations API - Create and manage training datasets
- User Generated Content API - Access and manage user-generated assets
- Model Fine-tuning API - Create custom-trained models
-
Account & Workflow Management:
- User Authentication API - Manage user access and permissions
- Webhook Integration - Enable event-based automation workflows
- Platform-specific Job Management API - Advanced job queuing and monitoring
The Self-Host Hub node collection will expand to include other AI services in future releases.
This repository includes detailed documentation in the docs/
directory:
- User Documentation - Comprehensive guide for using the node
- Development Guidelines - Technical details and development guidelines
- Parameter Handling - Technical details on parameter processing and testing
- Leonardo.ai Documentation
- n8n Community Node Documentation
- Self-Host Hub Linktree - Connect with us on YouTube, GitHub, and all other platforms