Nano Banana Node for n8n
npm install @nectopro/n8n-nodes-nano-bananaThis 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 (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.
Installation
Operations
Credentials
Getting Started
Usage Examples
Compatibility
Resources
Contributing
License
Follow the installation guide in the n8n community nodes documentation.
``bash`
npm install @nectopro/n8n-nodes-nano-banana
1. Go to Settings > Community Nodes
2. Select Install
3. Enter @nectopro/n8n-nodes-nano-banana
4. Agree to the risks of using community nodes
5. Select Install
After installation restart n8n to use the new nodes.
The Nano Banana node supports the following operations:
To use this node, you need a Google AI Studio API key.
1. Visit Google AI Studio
- Go to Google AI Studio
- Sign in with your Google account
2. 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...)
3. Configure in n8n
- In your n8n workflow, add the Nano Banana node
- Click on the credential field
- Select "Create New"
- Choose "AI Studio Credentials API"
- Paste your API key
- Save the credential
The node supports two input formats that can be selected in the node settings:
1. Manual Mapping: Use the UI fields to define message history and current message
2. JSON Format: Provide all input data as a JSON object in the "JSON Input" field
When using JSON format, provide a JSON object with the following structure:
`json`
{
"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?"
}
1. Add a Nano Banana node to your workflow
2. Set up your AI Studio Credentials
3. Select Generate Image operation
4. Choose Nano Banana Image model
5. Select JSON Format if you want to use JSON input, or keep Manual Mapping
6. Enter your prompt in Current Message (Manual) or JSON Input (JSON)
7. Set Response Modalities to TEXT
8. Execute the node
1. Follow steps 1-5 from above
2. Enter an image description prompt
3. Set Response Modalities to IMAGE
4. Execute to generate an image
1. Add the node and configure credentials
2. Select input format (Manual or JSON)
3. For Manual: In Message History, add a message with:
- Content Type: Image (URL) or Image (Base64)
- Image URL or Image Base64 data
- Role: User
4. For JSON: Include image data in the JSON input
5. Set Current Message to your question about the image
6. Set Response Modalities to TEXT
7. Execute to get image analysis
json
{
"operation": "generateContent",
"model": "gemini-2.5-flash-image-preview",
"currentMessage": "Write a short story about a robot learning to paint",
"responseModalities": ["TEXT"]
}
`$3
`json
{
"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"]
}
`$3
`json
{
"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"]
}
`$3
`json
{
"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"]
}
`$3
`json
{
"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+
$3
- Image generation requires sufficient API quotas
- Large images may take longer to process
- Rate limits apply based on your Google AI Studio planResources
- 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.
$3
1. Clone the repository:
`bash
git clone https://github.com/necto-pro/n8n-nodes-nano-banana.git
cd n8n-nodes-nano-banana
`2. Install dependencies:
`bash
npm install
`3. Build the project:
`bash
npm run build
`4. Lint the code:
`bash
npm run lint
npm run lintfix # To auto-fix issues
`5. Test locally:
`bash
npm run dev
``---
Created by Necto Pro | Questions? Open an issue