@prama13/n8n-nodes-advance-gemini
v0.3.3
Published
Advanced Gemini Node for n8n - Unlock the full potential of Gemini AI with advanced image generation capabilities in n8n workflows.
Maintainers
Readme
n8n-nodes-nano-banana
This is an n8n community node that integrates Google's Gemini AI models for advanced text and image generation capabilities. It lets you use Nano Banana Pro (powered by Gemini AI) in your n8n workflows for creating images, analyzing visual content, and generating text responses.
Google Gemini AI is a powerful multimodal AI platform that can understand and generate both text and images, making it perfect for creative workflows, content generation, and AI-powered automation.
n8n is a fair-code licensed workflow automation platform.
Table of Contents
Installation
Operations
Credentials
Getting Started
Usage Examples
Compatibility
Resources
Contributing
License
Installation
Follow the installation guide in the n8n community nodes documentation.
Install via npm
npm install @nectopro/n8n-nodes-nano-bananaInstall in n8n
- Go to Settings > Community Nodes
- Select Install
- Enter
@nectopro/n8n-nodes-nano-banana - Agree to the risks of using community nodes
- Select Install
After installation restart n8n to use the new nodes.
Operations
The Nano Banana Pro node supports the following operations:
Generate Content
- Text Generation: Create written content, stories, code, and more
- Image Generation: Generate images from text descriptions
- Image Analysis: Analyze and describe uploaded images
- Multimodal Conversations: Combine text and images in interactive dialogues
- Creative Tasks: Logo design, artwork, technical diagrams, and illustrations
- JSON Input Format: Provide message history and current message as JSON for programmatic workflows
Key Features
- Support for multiple content types (text, images via URL or base64)
- Conversation history management
- Streaming responses for real-time processing
- Multiple response modalities (text, images, or both)
- Advanced configuration options (temperature, tokens, etc.)
- Comprehensive error handling
- Flexible input formats (Manual UI mapping or JSON)
Credentials
To use this node, you need a Google AI Studio API key.
Getting Your API Key
Visit Google AI Studio
- Go to Google AI Studio
- Sign in with your Google account
Create API Key
- Click "Create API Key"
- Choose "Create API key in new project" or select an existing project
- Copy the generated API key (starts with
AIza...)
Configure in n8n
- In your n8n workflow, add the Nano Banana Pro node
- Click on the credential field
- Select "Create New"
- Choose "AI Studio Credentials API"
- Paste your API key
- Save the credential
Important Notes
- Keep your API key secure and never share it publicly
- Google AI Studio has usage limits and quotas
- Some features may require billing to be enabled in Google Cloud
- The API key provides access to Gemini models including image generation capabilities
Getting Started
Input Format Options
The node supports two input formats that can be selected in the node settings:
- Manual Mapping: Use the UI fields to define message history and current message
- JSON Format: Provide all input data as a JSON object in the "JSON Input" field
JSON Input Format
When using JSON format, provide a JSON object with the following structure:
{
"messageHistory": [
{
"contentType": "text",
"text": "What's in this image?",
"role": "user"
},
{
"contentType": "imageUrl",
"imageUrl": "https://example.com/image.jpg",
"mimeType": "image/jpeg",
"role": "user"
},
{
"contentType": "text",
"text": "This is a beautiful landscape with mountains and a lake.",
"role": "model"
}
],
"currentMessage": "Can you describe the colors in more detail?"
}Basic Text Generation
- Add a Nano Banana Pro node to your workflow
- Set up your AI Studio Credentials
- Select Generate Image operation
- Choose Nano Banana Pro Image model
- Select JSON Format if you want to use JSON input, or keep Manual Mapping
- Enter your prompt in Current Message (Manual) or JSON Input (JSON)
- Set Response Modalities to TEXT
- Execute the node
Basic Image Generation
- Follow steps 1-5 from above
- Enter an image description prompt
- Set Response Modalities to IMAGE
- Execute to generate an image
Image Analysis
- Add the node and configure credentials
- Select input format (Manual or JSON)
- For Manual: In Message History, add a message with:
- Content Type: Image (URL) or Image (Base64)
- Image URL or Image Base64 data
- Role: User
- For JSON: Include image data in the JSON input
- Set Current Message to your question about the image
- Set Response Modalities to TEXT
- Execute to get image analysis
Usage Examples
Example 1: Creative Writing
{
"operation": "generateContent",
"model": "gemini-2.5-flash-image-preview",
"currentMessage": "Write a short story about a robot learning to paint",
"responseModalities": ["TEXT"]
}Example 2: Logo Design
{
"operation": "generateContent",
"model": "gemini-2.5-flash-image-preview",
"currentMessage": "Create a modern, minimalist logo for a coffee shop called 'Morning Brew'",
"responseModalities": ["IMAGE", "TEXT"]
}Example 3: Image Analysis
{
"operation": "generateContent",
"model": "gemini-2.5-flash-image-preview",
"messageHistory": {
"messages": [{
"role": "user",
"contentType": "imageUrl",
"imageUrl": "https://example.com/photo.jpg",
"mimeType": "image/jpeg"
}]
},
"currentMessage": "What objects do you see in this image?",
"responseModalities": ["TEXT"]
}Example 4: Conversation with Context
{
"operation": "generateContent",
"model": "gemini-2.5-flash-image-preview",
"messageHistory": {
"messages": [
{
"role": "user",
"contentType": "text",
"text": "I need help designing a website"
},
{
"role": "model",
"contentType": "text",
"text": "I'd be happy to help! What type of website are you looking to create?"
}
]
},
"currentMessage": "It's for a photography portfolio",
"responseModalities": ["TEXT"]
}Example 5: JSON Input Format
{
"operation": "generateContent",
"model": "gemini-2.5-flash-image-preview",
"inputFormat": "json",
"jsonInput": "{\n \"messageHistory\": [\n {\n \"contentType\": \"text\",\n \"text\": \"What's in this image?\",\n \"role\": \"user\"\n },\n {\n \"contentType\": \"imageUrl\",\n \"imageUrl\": \"https://example.com/image.jpg\",\n \"mimeType\": \"image/jpeg\",\n \"role\": \"user\"\n }\n ],\n \"currentMessage\": \"Can you describe the colors in more detail?\"\n}",
"responseModalities": ["TEXT"]
}Advanced Configuration
The node supports advanced parameters for fine-tuning:
- Temperature: Controls creativity (0.0-1.0)
- Max Output Tokens: Limits response length
- Top P: Nucleus sampling parameter
- Top K: Top-k sampling parameter
- Stream Response: Enable real-time streaming
Compatibility
- Minimum n8n version: 0.227.0
- Node.js: 20.15 or higher
- Tested with: n8n 1.0+
Known Limitations
- Image generation requires sufficient API quotas
- Large images may take longer to process
- Rate limits apply based on your Google AI Studio plan
Resources
- n8n community nodes documentation
- Google AI Studio
- Gemini API Documentation
- Google AI Studio API Key Management
- Node GitHub Repository
Contributing
Contributions are welcome! Please feel free to submit a Pull Request.
Development Setup
Clone the repository:
git clone https://github.com/necto-pro/n8n-nodes-nano-banana.git cd n8n-nodes-nano-bananaInstall dependencies:
npm installBuild the project:
npm run buildLint the code:
npm run lint npm run lintfix # To auto-fix issuesTest locally:
npm run dev
License
Created by Necto Pro | Questions? Open an issue
