This module integrates Google's Gemini AI models into Drupal for image generation. It allows users to create images from text prompts or transform existing ones, with options for aspect ratio control, high-resolution output, and multi-image composition.
Overview
NanoBanana is an AI provider plugin for the Drupal AI module that integrates Google's Gemini image generation models. It supports both text-to-image and image-to-image generation with advanced features like multi-image composition, aspect ratio control, and high-resolution output.
With the Nano Banana Editor Module we have also a POC for a nicer editor experience
Features
- Text-to-Image Generation: Generate images from text descriptions
- Image-to-Image Transformation: Edit and transform existing images
- Multi-Image Composition: Combine up to 14 images into composite scenes (model-dependent)
- Aspect Ratio Control: 10 aspect ratio options (1:1, 3:4, 4:3, 9:16, 16:9, etc.)
- High-Resolution Output: Up to 4K resolution with Gemini 3 Pro
- AI API Explorer Integration: Built-in UI for testing with automatic multi-image field injection
Supported Models
Gemini 2.5 Flash Image
- Speed: Fast, low-latency
- Multi-Image: Up to 3 images (1 main + 2 additional)
- Best For: Quick iterations, prototyping, real-time applications
Gemini 3 Pro Image (Preview)
- Speed: Slower, higher quality
- Multi-Image: Up to 14 images (1 main + 13 additional)
- Resolution: 1K, 2K, 4K
- Best For: Final production, high-quality output, complex compositions
Post-Installation
1. Configure API Key
Use the Key module to store your API key securely:
- Navigate to Configuration → System → Keys
- Add a new key with your Gemini API key
- Select it in the NanoBanana settings (
/admin/config/ai/providers/nanobanana)
2. Verify Configuration
Navigate to AI API Explorer → Image-To-Image Explorer (/admin/config/ai/explorers/image_to_image_generator):
- Select Provider: NanoBanana
- The available models should appear in the dropdown
AI API Explorer
Text-to-Image
- Navigate to AI API Explorer → Text-To-Image Explorer
- Select Provider: NanoBanana
- Select Model: Gemini 2.5 Flash Image or Gemini 3 Pro Image
- Configure options:
- Aspect Ratio: Choose from 10 options
- Image Size: (Gemini 3 Pro only) Default, 1K, 2K, or 4K
- Enter your prompt
- Click Generate Image
Image-to-Image
- Navigate to AI API Explorer → Image-To-Image Explorer
- Select Provider: NanoBanana
- Select Model: Gemini 2.5 Flash Image or Gemini 3 Pro Image
- Upload main image
- Multi-Image: Upload additional images (fields appear automatically)
- Configure options and enter prompt
- Click Generate Image
Additional Requirements
- Drupal 10.3+ or Drupal 11+
- AI module
- Key module
- Google Gemini API key (Get one here)