Nano Banana Assets Generator Skill
This skill enables AI agents to generate any kind of visual asset using OpenRouter's Nano Banana Pro model (Google Gemini 3 Pro Image Preview).
Use this skill when users request:
- Any image, graphic, or visual content
- Icons, logos, banners, backgrounds, UI elements
- Illustrations, characters, stickers, avatars
- Product mockups, designs, compositions
- Social media graphics, marketing materials
- Creative artwork of any style or type
Key Philosophy: Be flexible and creative. Adapt to the user's needs rather than forcing predefined templates.
About Nano Banana Pro
Nano Banana Pro is Google's most advanced image-generation and editing model, built on Gemini 3 Pro. It extends the original Nano Banana with significantly improved multimodal reasoning, real-world grounding, and high-fidelity visual synthesis.
Key Features:
- Multi-Image Support: Can blend and edit up to 14 reference images per request
- Identity Preservation: Maintains consistency across up to 5 distinct subjects/characters simultaneously
- Multi-Image Blending: Consistent style across multiple generations with superior quality
- Text Rendering: Industry-leading text placement in images (94-96% accuracy) with multilingual layouts
- Fine-Grained Controls: Localized edits, lighting adjustments, focus control, camera transformations
- Flexible Outputs: Support for 2K/4K outputs and multiple aspect ratios (1:1, 16:9, 9:16, 4:3, 3:4, 21:9, 9:21, 2:3, 3:2, 5:4, 4:5)
- Context-Rich Graphics: From infographics and diagrams to cinematic composites
- Conversational Editing: Iterative, multi-turn editing workflows for refinement
- Photorealistic Quality: Advanced multimodal reasoning for professional-quality outputs
Understanding Image Limits:
- Reference Images: You can include up to 14 reference images in a single API request
- Identity Subjects: The model can maintain consistency for up to 5 different characters/subjects within those references
- Series Generation: For generating series of many images (10+, 20+, 50+), use the sliding window technique (detailed in section 5 below) to maintain visual consistency across the entire collection by using the most recent 5-14 generated images as references for each new image.
Known Limitations
⚠️ Transparent Backgrounds Not Supported
IMPORTANT: Nano Banana Pro (Google Gemini 3 Pro Image Preview) does not generate images with true alpha transparency. This is a model limitation, not a configuration issue.
What Actually Happens:
- Generated images are RGB PNG files (color type 2) without alpha channels
- When you request "transparent background," the model paints a solid color or pattern
- The background may appear white, gray, or have a checkered pattern painted as pixels
- The resulting PNG files cannot be overlaid on other backgrounds with transparency
Implications for Agents:
- ❌ Do NOT promise users transparent backgrounds or alpha channel support
- ❌ Do NOT include "transparent background" in prompts - it creates fake checkered patterns
- ✅ DO use chroma key colors for easy background removal (#00FF00 bright green recommended)
- ✅ DO inform users that post-processing is needed for true transparency
Recommended Approach: Chroma Key Backgrounds
When users need transparency, use a bright chroma key color that can be easily removed:
Best Chroma Key Colors:
- Bright Green (#00FF00) - Most common, rarely appears in subjects
- Bright Magenta (#FF00FF) - Alternative if subject contains green
- Bright Blue (#0000FF) - For subjects with green/magenta elements
Example Prompts:
- "Solid bright green background (#00FF00) for chroma key removal"
- "Pure #00FF00 green background, flat and uniform"
- "Subject isolated on solid bright green (#00FF00) chroma key background"
Why This Works:
- ✅ Model generates clean, uniform color fills
- ✅ No fake checkered patterns painted as pixels
- ✅ Easy to select and remove using color-based tools
- ✅ Chroma key removal is cleaner than edge detection
- ✅ Works perfectly with standard video/photo editing workflows
Automated Scripts Available:
The skill includes several helper scripts in scripts/ directory for various workflows:
1. Single Asset with Transparency (Recommended):
cd .github/skills/nano-banana-assets/scripts
python generate_with_transparency.py "Your prompt" "1:1" "1024x1024"
- ✅ Generates with #00FF00 chroma key (no fake checkered patterns)
- ✅ Removes background with rembg (AI-powered)
- ✅ Outputs transparent RGBA PNG files
- ✅ Saves both transparent and original versions
2. Batch Generation:
# From config file
python batch_generate.py --config example_batch_config.json --transparent
# From prompts
python batch_generate.py --prompts "Icon 1" "Icon 2" "Icon 3" --transparent
- ✅ Generate multiple assets at once
- ✅ Optional transparency support
- ✅ Progress tracking and error handling
3. Post-Process Existing Images:
# Remove backgrounds from already-generated images
python remove_backgrounds.py --directory ./images/
# Or with chroma key
python remove_backgrounds.py --chroma-key "#00FF00" image.png
- ✅ AI-powered removal with rembg
- ✅ Chroma key color removal
- ✅ Batch directory processing
See scripts/README.md for complete documentation and examples.
Requirements:
pip install rembg requests Pillow
Post-Processing Background Removal:
Recommended: Using rembg (AI-powered removal)
The rembg tool provides automated, high-quality background removal that works with any background color (including chroma key backgrounds):
Install rembg:
pip install rembg[gpu] # For GPU acceleration
# or
pip install rembg # CPU only
Remove background (single file):
rembg i input.png output.png
Batch process all files:
# Process all PNG files in directory
for file in *.png; do
rembg i "$file" "transparent_$file"
done
# Or use rembg's built-in batch processing
rembg p input_folder output_folder
Python API (for integration):
from rembg import remove
from PIL import Image
input_path = 'input.png'
output_path = 'output.png'
with open(input_path, 'rb') as i:
with open(output_path, 'wb') as o:
input_data = i.read()
output_data = remove(input_data)
o.write(output_data)
Why rembg is Best:
- ✅ AI-powered edge detection (U²-Net model)
- ✅ Works with any background color (chroma key or natural)
- ✅ High-quality results with fine details (hair, fur, transparent objects)
- ✅ Fully automated - no manual selection needed
- ✅ Fast batch processing
- ✅ Open source and free
Alternative: Manual Chroma Key Removal
If you prefer manual control or don't want to install rembg:
Using ImageMagick (CLI):
# Remove bright green background with tolerance
convert input.png -fuzz 5% -transparent "#00FF00" output.png
# Batch process all files
for file in *.png; do
convert "$file" -fuzz 5% -transparent "#00FF00" "transparent_$file"
done
Using Photoshop:
- Select → Color Range → Sample the green background
- Adjust tolerance as needed
- Delete selection → Save as PNG with transparency
Using GIMP:
- Colors → Color to Alpha → Select the green (#00FF00)
- Export as PNG with alpha channel
Using FFmpeg (for batch):
ffmpeg -i input.png -filter_complex "colorkey=0x00FF00:0.3:0.2" output.png
Not Recommended:
Plain White/Gray Backgrounds:
- ⚠️ Harder to remove if subject has similar colors
- Requires more manual editing around edges
Request "Transparent" (Avoid):
- ❌ Creates fake checkered patterns painted as pixels
- ❌ Very difficult to remove cleanly
What to Tell Users:
Note: Generated images have solid backgrounds (RGB PNG format).
The model cannot create true transparent backgrounds (RGBA).
For transparency removal, I recommend using rembg (AI-powered):
pip install rembg
rembg i input.png output.png
Or for manual chroma key removal with the bright green (#00FF00) background:
convert image.png -fuzz 5% -transparent "#00FF00" output.png
The chroma key approach avoids the "fake checkered pattern" issue.
Core Capabilities
- Generate Single Assets: Create icons, banners, backgrounds, UI elements, and more
- Generate Asset Packs: Create cohesive sets of related assets with consistent branding
- Edit Existing Assets: Apply fine-grained edits to existing images
- Ensure Brand Consistency: Analyze and maintain visual identity across multiple assets
- Generate Consistent Series (6+ Images): Create large image series maintaining consistency using the sliding window technique
Prerequisites
Before using this skill, ensure you have:
- OpenRouter API key (get one from https://openrouter.ai/)
- The API key should be stored as
OPENROUTER_API_KEY environment variable
- Internet access to call the OpenRouter API
API Configuration
Base URL
https://openrouter.ai/api/v1/chat/completions
Model
google/gemini-3-pro-image-preview
Authentication
Authorization: Bearer <OPENROUTER_API_KEY>
Core Operations
1. Generate a Single Asset
Use this when the user needs one specific asset (icon, banner, background, etc.).
When to use:
- User asks for "create an icon"
- User wants "generate a banner"
- User needs "make a background image"
- User requests any single graphic asset
Steps:
Collect requirements:
- What type of asset (icon, banner, background, UI element, etc.)
- Description/prompt (be detailed and specific)
- Aspect ratio (1:1, 16:9, 9:16, 4:3, 21:9, etc.)
- Resolution (1080x1080, 1920x1080, 2K, 4K)
- Color palette (hex codes)
- Any reference images or logos
Build the prompt using the Six-Element Framework (Google's recommended approach):
Generate a high-quality [asset type] with the following specifications:
Subject: [Who/what is in the image - be specific about physical attributes, elements]
Composition: [Framing, perspective, layout - e.g., "centered", "rule of thirds", "close-up", "wide shot"]
Action: [What is happening - static pose, interaction, movement]
Location: [Setting, environment, context - where the scene takes place]
Style: [Overall aesthetic - photorealistic, flat design, minimalist, bold, etc.]
Lighting: [Specific lighting setup - "soft diffused daylight", "dramatic side lighting", "golden hour", etc.]
Camera Details: [Optional - "85mm lens", "shallow depth of field", "low angle", etc.]
Materiality: [Optional - texture details like "matte finish", "brushed steel", "translucent glass"]
Technical Specifications:
Aspect Ratio: [ratio]
Resolution: [resolution]
Color Palette: [hex codes]
Requirements:
- Professional, web-ready quality
- Modern and visually appealing design
- Optimized for digital use
- Clean and polished appearance
Make the API call (see API Call Format section below)
Extract generated images from response.choices[0].message.images array
Present the images to the user
Example prompt (using Six-Element Framework):
Generate a high-quality hero banner with the following specifications:
Subject: Abstract geometric shapes (floating hexagons, connecting lines, particles) creating a tech-forward atmosphere
Composition: Wide shot with visual weight on right side, negative space on left for text overlay, balanced with rule of thirds
Action: Subtle sense of movement with particles drifting upward, energy flowing through connecting lines
Location: Digital space with infinite depth, contemporary tech environment
Style: Modern minimalist with vibrant gradients, clean professional aesthetic suitable for SaaS landing page
Lighting: Soft ambient glow from gradient background, subtle rim lighting on geometric elements to create depth
Camera Details: Slight elevated perspective, as if viewing a 3D space, medium depth of field
Materiality: Gradient elements have smooth glass-like quality, geometric shapes with subtle metallic sheen
Technical Specifications:
Aspect Ratio: 16:9
Resolution: 1920x1080
Color Palette: #667EEA (primary blue), #764BA2 (deep purple), #F093FB (accent pink)
Requirements:
- Professional, web-ready quality
- Eye-catching yet not overwhelming
- Clear space on left third for headline text
- Optimized for digital use
2. Generate Asset Pack
Use this when the user needs multiple related assets maintaining brand consistency.
When to use:
- User asks for "social media kit"
- User wants "complete branding package"
- User needs "set of icons" or "icon set"
- User requests multiple related assets
Steps:
Collect requirements:
- Overall purpose/description
- List of asset types needed (e.g., "instagram-post", "facebook-cover", "icon-set")
- Brand guidelines (style, tone, values)
- Color palette
- Logo file (if any)
- Default aspect ratio and resolution
Build the prompt using the Six-Element Framework:
Generate a complete, brand-consistent asset pack for web development:
Project Description: [description]
Asset Types to Generate:
1. [asset type 1] - Subject: [...], Composition: [...], Style: [...]
2. [asset type 2] - Subject: [...], Composition: [...], Style: [...]
3. [asset type 3] - Subject: [...], Composition: [...], Style: [...]
...
Brand Guidelines:
Subject Matter: [What visual elements represent the brand]
Composition Approach: [How elements should be arranged - balanced, dynamic, minimal, etc.]
Visual Actions: [Static vs dynamic, energy level, mood]
Contextual Environment: [Where these assets exist - digital, physical, abstract]
Overall Style: [Aesthetic direction - minimalist, bold, elegant, playful, etc.]
Lighting Treatment: [Consistent lighting approach across all assets]
Camera & Materiality:
[Any specific perspective or texture requirements]
Brand Color Palette: [colors]
Default Aspect Ratio: [ratio]
Default Resolution: [resolution]
Requirements:
- All assets must maintain visual consistency
- Follow the brand guidelines strictly
- Use the provided color palette throughout
- Professional, production-ready quality
- Each asset should be optimized for its specific use case
- Cohesive design language across all assets
Make the API call with reference images if provided
Extract all generated images from the response
Present each asset with its type/purpose labeled
Example prompt (with Six-Element Framework):
Generate a complete, brand-consistent asset pack for web development:
Project Description: Social media kit for an eco-friendly coffee brand targeting young professionals
Asset Types to Generate:
1. Instagram post (square, 1:1) - Subject: Coffee cup with natural elements, Composition: Centered product shot, Style: Warm and inviting
2. Instagram story (vertical, 9:16) - Subject: Brewing process with eco messaging, Composition: Vertical flow top to bottom, Style: Dynamic and engaging
3. Facebook cover (wide banner) - Subject: Coffee beans and sustainable packaging, Composition: Wide panoramic layout, Style: Professional and earthy
4. Twitter header (wide banner) - Subject: Brand story visual elements, Composition: Horizontal narrative, Style: Clean and modern
5. App icon (square, simple) - Subject: Stylized coffee cup or bean, Composition: Centered symbol, Style: Minimalist and recognizable
Brand Guidelines:
Subject Matter: Natural coffee elements (beans, cups, plants), sustainable packaging, organic textures, eco-friendly themes
Composition Approach: Clean, balanced layouts with breathing room, focus on product and nature harmony
Visual Actions: Static, serene presentations with subtle organic movement suggestions
Contextual Environment: Natural light settings, wooden surfaces, green plants, sustainable materials backdrop
Overall Style: Minimalist, nature-inspired, earthy aesthetics. Modern organic fusion with professional polish.
Lighting Treatment: Warm, soft natural light (golden hour quality), gentle shadows, inviting and cozy atmosphere
Camera & Materiality:
Slight top-down or 3/4 angles for product shots, natural wood grain textures, matte ceramic finishes, organic paper textures
Brand Color Palette: #2ECC71 (eco green), #27AE60 (forest), #8B4513 (coffee brown), #F5F5DC (cream)
Default Aspect Ratio: 1:1
Default Resolution: 1080x1080
Requirements:
- All assets must maintain visual consistency
- Follow the brand guidelines strictly
- Use the provided color palette throughout
- Professional, production-ready quality
- Each asset should be optimized for its specific use case
- Cohesive design language across all assets
3. Edit Existing Asset
Use this when the user wants to modify an existing image.
When to use:
- User says "edit this image"
- User wants "adjust the lighting"
- User needs "change the colors"
- User requests any modification to an existing asset
Steps:
Get the source image (URL or base64 data)
Collect edit requirements:
- Specific edit instructions (be precise)
- Elements to preserve (logo, text, specific objects)
- Target aspect ratio (if changing)
- Target resolution (if changing)
Build the prompt with detailed editing instructions:
Edit the provided image with the following instructions:
Edit Instructions: [Specific edits using the Six-Element Framework]
- Subject modifications: [What elements to add, remove, or change]
- Composition adjustments: [Layout, framing, perspective changes]
- Action changes: [Modify movement, energy, or static elements]
- Location alterations: [Background, environment, context changes]
- Style refinements: [Aesthetic adjustments, visual treatment]
- Lighting adjustments: [Specific lighting changes - "warmer tones", "increase contrast", "soften shadows"]
Camera & Detail Changes:
- [Optional: focal point, depth of field, perspective adjustments]
- [Optional: texture, materiality, surface quality changes]
Preserve These Elements: [elements to keep]
Target Aspect Ratio: [ratio]
Target Resolution: [resolution]
Editing Requirements:
- Apply edits precisely as instructed
- Maintain image quality and professional appearance
- Preserve specified elements without alteration
- Ensure smooth transitions and natural-looking results
- Output should be web-ready and optimized
Make the API call with the source image included in the content array
Extract edited image from the response
Present the edited image to the user
Example prompt with image (using Six-Element Framework):
Edit the provided image with the following instructions:
Edit Instructions:
- Subject modifications: Enhance the main product to appear more premium, add subtle glow effect around edges
- Composition adjustments: Maintain current centered composition but add slight depth with background blur
- Action changes: Keep static presentation but add subtle energy with light particles
- Location alterations: Keep current setting but add warmer, more inviting environmental tones
- Style refinements: Shift toward more premium, upscale aesthetic while maintaining brand identity
- Lighting adjustments: Adjust to golden hour lighting quality - warm amber tones from top-left, increase contrast by 20%, soften hard shadows to create more inviting mood, add subtle vignette effect around edges for focus
Camera & Detail Changes:
- Simulate shallow depth of field effect (85mm equivalent)
- Enhance material quality: make surfaces appear more premium with subtle highlights
- Add subtle warm color grading throughout
Preserve These Elements: logo in top-left corner, main product in center, text overlay at bottom, brand colors in text elements
Editing Requirements:
- Apply edits precisely as instructed
- Maintain image quality and professional appearance
- Preserve specified elements without alteration
- Ensure smooth transitions and natural-looking results
- Output should be web-ready and optimized
4. Ensure Brand Consistency
Use this when the user wants to check if multiple assets follow brand guidelines.
When to use:
- User says "check these assets for consistency"
- User wants "review brand compliance"
- User needs "validate branding"
- User asks if assets "match the guidelines"
Steps:
Collect all assets to analyze (URLs or base64 data)
Get brand guidelines:
- Detailed style requirements
- Color palette (official brand colors)
- Reference images showing desired style
- Logo file
- Typography preferences
- Tone and values
Build the prompt:
Analyze the following assets for brand consistency and provide recommendations:
Brand Guidelines:
[detailed guidelines]
Brand Colors: [hex codes]
Analysis Requirements:
- Check adherence to brand guidelines
- Verify consistent use of colors, typography, and style
- Identify inconsistencies across assets
- Provide specific recommendations for improvements
- Suggest refinements to maintain brand identity
- Ensure logo usage is consistent and appropriate
- Verify visual cohesion across all assets
I have [N] assets to analyze. Please review them for consistency.
Make the API call with all assets and reference images
Extract analysis text and any corrected images
Present the analysis with specific recommendations
Example prompt:
Analyze the following assets for brand consistency and provide recommendations:
Brand Guidelines:
- Style: Modern, minimalist, professional
- Tone: Trustworthy, innovative, forward-thinking
- Colors must be limited to the brand palette
- Logo must always be visible and properly sized
- Typography: Clean, sans-serif, high readability
- Imagery: High-tech, futuristic, abstract geometric patterns preferred
Brand Colors: #667EEA, #764BA2, #FFFFFF, #2D3748
Analysis Requirements:
- Check adherence to brand guidelines
- Verify consistent use of colors, typography, and style
- Identify inconsistencies across assets
- Provide specific recommendations for improvements
- Suggest refinements to maintain brand identity
- Ensure logo usage is consistent and appropriate
- Verify visual cohesion across all assets
I have 4 assets to analyze. Please review them for consistency.
5. Generate Consistent Series (More than 5 Images)
Use this when the user needs to generate a large series of images (10+, 20+, 50+) that must maintain consistency across the entire series.
Background: Nano Banana Pro can process up to 14 reference images per request and maintain identity for up to 5 distinct subjects/characters. For generating extensive series (many more images than can be used as references), use a sliding window approach where you use the most recent 5-14 generated images as references for each new image.
When to use:
- User asks for "20+ icons in the same style"
- User wants "a storyboard with 15+ frames"
- User needs "30-day social media calendar with consistent branding"
- User requests any extensive image series (icon libraries, product catalogs, etc.)
Steps:
Initial Setup:
- Collect series requirements:
- Overall series description
- Individual descriptions for each image
- Brand guidelines and style requirements
- Color palette
- Aspect ratio and resolution
- Any initial reference images or logo (up to 14 images)
Generate First Image:
- Use any initial reference images provided
- Include brand guidelines and color palette
- This establishes the baseline style
Generate Subsequent Images (Sliding Window):
- For images 2-14: Use ALL previously generated images as references (accumulating)
- For image 15 onwards: Use only the LAST 10-14 generated images as references (sliding window)
- This maintains consistency while respecting the model's 14-image reference limit
- Recommended: Use 10-12 recent images to leave room for logo/initial references
Workflow Pattern:
For each image in the series:
a. Build the prompt:
Generate image [N] of [TOTAL] for this series:
Series Context: [overall description]
This Image: [specific description for this image]
Brand Guidelines:
[guidelines]
Color Palette: [colors]
Aspect Ratio: [ratio]
Resolution: [resolution]
Consistency Requirements:
- Maintain the same visual style as the reference images
- Use consistent design language, color treatment, and composition
- Ensure this image feels like part of the same cohesive series
- Professional, web-ready quality
- Modern and polished appearance
IMPORTANT: The reference images show the previously generated images in this series. Match their style, tone, and visual identity exactly while creating this new variation.
b. Prepare reference images (up to 14 total):
reference_images = []
# Add logo if provided (takes 1 slot)
if logo_file:
reference_images.append(logo_file)
# Add initial style references only for first image (up to 3-5 slots)
if current_image == 1 and initial_references:
reference_images.extend(initial_references[:5]) # Limit to first 5
# Add previously generated images (sliding window approach)
if generated_images:
# Calculate how many slots remain (max 14 total)
remaining_slots = 14 - len(reference_images)
# For images 2-14: Use all previous images (if they fit)
if current_image <= 14:
reference_images.extend(generated_images[:remaining_slots])
else:
# For image 15+: Use last 10-12 images (sliding window)
# Keep 2-4 slots for logo and initial references
window_size = min(remaining_slots, 12)
start_index = max(0, len(generated_images) - window_size)
reference_images.extend(generated_images[start_index:])
c. Make API call with reference images (max 14)
d. Store the generated image for use in next iteration
e. Repeat for next image
Present results with clear tracking:
- Show each image with its number and description
- Indicate which images were used as references
- Confirm consistency across the series
Example workflow for 20-icon series:
User Request: "Create 20 minimalist weather icons with consistent style"
Your Workflow:
Step 1: Generate Icon 1 (Sunny)
---
Prompt: "Generate icon 1 of 20 for this series:
Series Context: Weather icon set with minimalist design. Clean lines, modern style, consistent 2px stroke weight, rounded line caps, monochrome design (#2D3748) on solid bright green (#00FF00) chroma key background for easy removal.
This Image: Sunny weather - sun with rays
Aspect Ratio: 1:1
Resolution: 512x512
Consistency Requirements:
- Professional, web-ready quality
- Modern and polished appearance
- Clean, simple design with consistent visual language"
References: [initial style guide images if any, logo if any]
[Make API call]
[Store generated icon 1]
Step 2: Generate Icon 2 (Cloudy)
---
Prompt: "Generate icon 2 of 20 for this series:
Series Context: Weather icon set with minimalist design, matching the previous icon's stroke weight and design language.
This Image: Cloudy weather - cloud shape
Consistency Requirements:
- Maintain the same visual style as the reference images
- Use consistent design language, stroke weight, line caps
- Ensure this icon feels like part of the same icon family
IMPORTANT: The reference images show the previously generated icons. Match their style exactly."
References: [logo if any, icon 1]
[Make API call]
[Store generated icon 2]
Steps 3-14: Generate Icons 3-14
---
Same process, accumulating all previous icons as references
- Icon 3 references: [logo, icons 1-2]
- Icon 4 references: [logo, icons 1-3]
- Icon 5 references: [logo, icons 1-4]
...
- Icon 14 references: [logo, icons 1-13] (at or near 14-image limit)
Step 15: Generate Icon 15 (Heavy Rain) - SLIDING WINDOW STARTS
---
Prompt: [same structure emphasizing consistency]
References: [logo, icons 4-14] ← Last 11 icons (11 + 1 logo = 12 references)
[Make API call]
[Store generated icon 15]
Steps 16-20: Generate Icons 16-20
---
Continue with sliding window:
- Icon 16 references: [logo, icons 5-15]
- Icon 17 references: [logo, icons 6-16]
- Icon 18 references: [logo, icons 7-17]
- Icon 19 references: [logo, icons 8-18]
- Icon 20 references: [logo, icons 9-19] ← Last 11 + logo
[Store generated icon 8]
Final Response:
Final Response:
"✅ Generated 20 consistent weather icons!
Icons created with sliding window consistency:
- Icons 1-14: Each new icon referenced all previous icons (accumulating references)
- Icons 15-20: Each used the last 11 icons + logo (sliding window of 12 references)
Consistency maintained throughout:
- Same stroke weight (2px)
- Same line caps (rounded)
- Same color (#2D3748)
- Same minimalist style
- Cohesive visual family
All 20 icons maintain perfect consistency across the entire series!"
[Present all 20 icons]
Key Points:
- 14-image reference limit: Model can process up to 14 reference images per request
- Sliding window: Use last 10-14 images as references for extensive series
- 5 subject identities: Model maintains consistency for up to 5 different characters/subjects
- Explicit instructions: Tell the model the reference images are from the same series
- Consistency emphasis: Emphasize matching style, tone, and identity in every prompt
- Series context: Always include the overall series description
- Track progress: Keep track of which images are used as references
- Quality control: After generation, visually verify consistency
Common Use Cases:
- Large icon sets (20+, 50+, 100+ icons)
- Storyboards with many frames (15-30+ frames)
- Social media calendar (30-90 days of posts)
- Product catalog (extensive product variations)
- UI component libraries (complete design systems)
- Brand asset collections (comprehensive asset libraries)
- Character variations (same character in different poses/scenes)
API Call Format
Basic Request Structure
{
"model": "google/gemini-3-pro-image-preview",
"messages": [
{
"role": "user",
"content": [
{
"type": "text",
"text": "YOUR PROMPT HERE"
}
]
}
],
"modalities": ["image", "text"],
"temperature": 0.7,
"max_tokens": 4096
}
With Image Input (for editing or reference)
{
"model": "google/gemini-3-pro-image-preview",
"messages": [
{
"role": "user",
"content": [
{
"type": "image_url",
"image_url": {
"url": "https://example.com/image.png"
}
},
{
"type": "text",
"text": "YOUR PROMPT HERE"
}
]
}
],
"modalities": ["image", "text"],
"temperature": 0.7,
"max_tokens": 4096
}
With Aspect Ratio Control
{
"model": "google/gemini-3-pro-image-preview",
"messages": [
{
"role": "user",
"content": [
{
"type": "text",
"text": "YOUR PROMPT HERE"
}
]
}
],
"modalities": ["image", "text"],
"image_config": {
"aspect_ratio": "16:9"
},
"temperature": 0.7,
"max_tokens": 4096
}
Required Headers
Authorization: Bearer YOUR_OPENROUTER_API_KEY
Content-Type: application/json
HTTP-Referer: https://github.com/shelbeely/Openrouter-Nano-banana-assets-generator-MCP
X-Title: Nano Banana Assets Generator
Response Format
{
"choices": [
{
"message": {
"content": "Description of generated assets...",
"images": [
{
"image_url": {
"url": "data:image/png;base64,iVBORw0KGgoAAAANS..."
}
}
]
}
}
]
}
Supported Aspect Ratios
The following aspect ratios are supported by Gemini/Nano Banana Pro (per official Google documentation):
Landscape formats:
21:9 - Ultra-wide cinematic (ideal for hero banners, cinematic compositions)
16:9 - Widescreen (YouTube thumbnails, web banners, hero sections, presentations)
4:3 - Traditional landscape (presentations, older displays)
3:2 - Standard photo landscape (traditional photography)
5:4 - Landscape with slight squareness
Square format:
1:1 - Square (Instagram posts, icons, profile pictures, avatars)
Portrait formats:
9:16 - Vertical widescreen (Instagram/Facebook stories, mobile screens, TikTok)
3:4 - Traditional portrait (traditional photography)
2:3 - Portrait photo standard (magazine covers, portraits)
4:5 - Portrait with slight width
9:21 - Ultra-tall portrait (rare, specialized mobile UI)
Supported Resolutions
1080x1080 - Standard square (1:1)
1920x1080 - Full HD (16:9)
1080x1920 - Full HD vertical (9:16)
2K (2560x1440) - High quality
4K (3840x2160) - Ultra high quality
3840x2160 - 4K explicit
2560x1440 - 2K explicit
1280x720 - HD ready
Best Practices
Writing Effective Prompts (Google's Six-Element Framework)
Google's research shows that prompts structured around six core elements produce the best results with Gemini models:
Subject: Define Who/What
- Be specific about the main elements, characters, or objects
- Include physical attributes, characteristics, and details
- ❌ "A banner"
- ✅ "A modern SaaS hero banner featuring abstract geometric shapes (floating hexagons, connecting nodes, light particles)"
Composition: Describe Framing & Layout
- Specify camera angles, framing, and perspective
- Use standard photography/design terms
- ❌ "Nice layout"
- ✅ "Wide shot with rule of thirds composition, negative space on left third for text overlay, visual weight balanced on right"
Action: Explain What's Happening
- Describe movement, interactions, or static positioning
- Define energy level and dynamics
- ❌ "Some movement"
- ✅ "Subtle upward particle drift creating sense of innovation and progress, energy flowing through connecting lines"
Location: Set the Environment
- Describe setting, context, and surroundings
- Include environmental details that enhance the scene
- ❌ "Tech background"
- ✅ "Contemporary digital workspace with infinite depth, clean minimal environment suggesting cloud/SaaS platform"
Style: Define the Aesthetic
- Be specific about visual treatment and design approach
- Reference design movements, art styles, or specific aesthetics
- ❌ "Modern look"
- ✅ "Modern minimalist with vibrant gradients, flat design principles, clean professional aesthetic suitable for enterprise SaaS"
Lighting: Specify Illumination Details
- Describe light sources, quality, direction, and mood
- Include shadows, highlights, and atmospheric effects
- ❌ "Good lighting"
- ✅ "Soft ambient glow from gradient background, subtle rim lighting on geometric elements from top-right creating depth, gentle shadows"
Advanced Prompt Enhancements
Camera Details (Optional but Powerful)
- Lens specifications: "85mm portrait lens", "24mm wide angle"
- Focal properties: "shallow depth of field", "everything in focus"
- Perspective: "low angle looking up", "bird's eye view", "eye level"
- Example: "Shot with 85mm equivalent focal length, f/2.8 aperture for subtle background blur"
Materiality & Texture (For Product/Design Assets)
- Surface qualities: "matte finish", "glossy", "brushed metal", "frosted glass"
- Texture details: "smooth gradient", "paper texture", "fabric weave", "metallic sheen"
- Example: "Gradient elements have smooth glass-like quality, geometric shapes with subtle metallic sheen, soft velvety background"
Full Sentence Narratives
- Use natural language, not just keywords
- Brief the AI like a creative director
- ❌ "blue purple gradient tech shapes modern"
- ✅ "Create a hero shot featuring an abstract technology landscape with flowing gradients from deep blue to vibrant purple, populated with geometric shapes that suggest connectivity and innovation"
Iterative Conversational Editing
Nano Banana Pro excels at multi-turn refinement. Instead of regenerating, use conversational edits:
Initial Prompt:
Generate a product banner for smart home device...
Follow-up Edit 1:
Make the lighting warmer and more inviting, shift from cool tones to golden hour quality
Follow-up Edit 2:
Add the brand logo in top-left corner, subtle drop shadow, 15% opacity
Follow-up Edit 3:
Increase the contrast of the main product by 20%, make it pop more against the background
This preserves composition and layout while refining specific aspects.
Writing Effective Prompts (Legacy Guidelines - Still Valid)
Be Specific and Detailed
- ❌ "Make a banner"
- ✅ "Create a modern tech startup hero banner with gradient background from blue to purple, abstract geometric elements, and space for overlaying text"
Include Context
- Mention where the asset will be used (website, social media, email, app)
- Specify the target audience
- Describe the desired mood/emotion
Define Style Clearly
- Use descriptive terms: minimalist, vibrant, elegant, playful, professional
- Reference art styles: flat design, material design, glassmorphism, etc.
- Mention specific elements: gradients, shadows, textures, patterns
Specify Technical Requirements
- Always include aspect ratio for the intended use case
- Mention resolution if quality is critical
- List any technical constraints
Color Guidance
Provide Hex Codes
- ✅ Use: "#667EEA", "#764BA2"
- ❌ Avoid: "blue", "purple"
Include 3-5 Brand Colors
- Primary color
- Secondary color
- Accent color(s)
- Background color (if applicable)
Consider Color Harmony
- Complementary colors for contrast
- Analogous colors for harmony
- Triadic colors for vibrancy
Reference Images
Use Up to 14 Reference Images (Not Just 5)
- Nano Banana Pro supports up to 14 reference images per request
- Use for style guidance, composition examples, and identity preservation
- Categories of references:
- Style references: Overall aesthetic and visual treatment (1-3 images)
- Composition references: Layout and arrangement examples (1-2 images)
- Color treatment references: Mood and color grading (1-2 images)
- Subject/identity references: For maintaining character or product consistency (up to 5 distinct subjects)
- Technical references: Quality level and detail expectations (1-2 images)
- Brand assets: Logos and brand elements (1-2 images)
Provide Context for References
- Explain what aspect to emulate from each reference
- Clarify what to avoid from the reference
- Specify if it's for style, composition, color, or subject identity
- Example: "Reference image 1 shows the composition layout to follow. Reference image 2 demonstrates the lighting quality desired."
Identity Preservation Across References
- Model can maintain consistency for up to 5 distinct subjects/characters across the 14 references
- Use
…(truncated)
1---2name: nano-banana-assets3description: Generate any kind of visual asset using OpenRouter's Nano Banana Pro (Google Gemini 3 Pro Image Preview). Handles images, graphics, illustrations, icons, banners, backgrounds, UI elements, stickers, characters, and more. Flexible and adaptable to any creative request.4license: MIT5---6
7# Nano Banana Assets Generator Skill
8
9This skill enables AI agents to generate **any kind of visual asset** using OpenRouter's Nano Banana Pro model (Google Gemini 3 Pro Image Preview).
10
11**Use this skill when users request:**
12- Any image, graphic, or visual content
13- Icons, logos, banners, backgrounds, UI elements
14- Illustrations, characters, stickers, avatars
15- Product mockups, designs, compositions
16- Social media graphics, marketing materials
17- Creative artwork of any style or type
18
19**Key Philosophy:** Be flexible and creative. Adapt to the user's needs rather than forcing predefined templates.
20
21## About Nano Banana Pro
22
23Nano Banana Pro is Google's most advanced image-generation and editing model, built on Gemini 3 Pro. It extends the original Nano Banana with significantly improved multimodal reasoning, real-world grounding, and high-fidelity visual synthesis.
24
25**Key Features:**
26- **Multi-Image Support**: Can blend and edit up to **14 reference images** per request
27- **Identity Preservation**: Maintains consistency across up to **5 distinct subjects/characters** simultaneously
28- **Multi-Image Blending**: Consistent style across multiple generations with superior quality
29- **Text Rendering**: Industry-leading text placement in images (94-96% accuracy) with multilingual layouts
30- **Fine-Grained Controls**: Localized edits, lighting adjustments, focus control, camera transformations
31- **Flexible Outputs**: Support for 2K/4K outputs and multiple aspect ratios (1:1, 16:9, 9:16, 4:3, 3:4, 21:9, 9:21, 2:3, 3:2, 5:4, 4:5)
32- **Context-Rich Graphics**: From infographics and diagrams to cinematic composites
33- **Conversational Editing**: Iterative, multi-turn editing workflows for refinement
34- **Photorealistic Quality**: Advanced multimodal reasoning for professional-quality outputs
35
36**Understanding Image Limits:**
37- **Reference Images**: You can include up to 14 reference images in a single API request
38- **Identity Subjects**: The model can maintain consistency for up to 5 different characters/subjects within those references
39- **Series Generation**: For generating series of many images (10+, 20+, 50+), use the **sliding window technique** (detailed in section 5 below) to maintain visual consistency across the entire collection by using the most recent 5-14 generated images as references for each new image.
40
41## Known Limitations
42
43### ⚠️ Transparent Backgrounds Not Supported
44
45**IMPORTANT:** Nano Banana Pro (Google Gemini 3 Pro Image Preview) **does not generate images with true alpha transparency**. This is a model limitation, not a configuration issue.
46
47**What Actually Happens:**
48- Generated images are RGB PNG files (color type 2) without alpha channels
49- When you request "transparent background," the model paints a solid color or pattern
50- The background may appear white, gray, or have a checkered pattern painted as pixels
51- The resulting PNG files cannot be overlaid on other backgrounds with transparency
52
53**Implications for Agents:**
54- ❌ **Do NOT promise users transparent backgrounds** or alpha channel support
55- ❌ **Do NOT include "transparent background" in prompts** - it creates fake checkered patterns
56- ✅ **DO use chroma key colors** for easy background removal (#00FF00 bright green recommended)
57- ✅ **DO inform users** that post-processing is needed for true transparency
58
59**Recommended Approach: Chroma Key Backgrounds**
60
61When users need transparency, use a **bright chroma key color** that can be easily removed:
62
63**Best Chroma Key Colors:**
641. **Bright Green (#00FF00)** - Most common, rarely appears in subjects
652. **Bright Magenta (#FF00FF)** - Alternative if subject contains green
663. **Bright Blue (#0000FF)** - For subjects with green/magenta elements
67
68**Example Prompts:**
69```
70- "Solid bright green background (#00FF00) for chroma key removal"
71- "Pure #00FF00 green background, flat and uniform"
72- "Subject isolated on solid bright green (#00FF00) chroma key background"
73```
74
75**Why This Works:**
76- ✅ Model generates clean, uniform color fills
77- ✅ No fake checkered patterns painted as pixels
78- ✅ Easy to select and remove using color-based tools
79- ✅ Chroma key removal is cleaner than edge detection
80- ✅ Works perfectly with standard video/photo editing workflows
81
82**Automated Scripts Available:**
83
84The skill includes several helper scripts in `scripts/` directory for various workflows:
85
86**1. Single Asset with Transparency (Recommended):**
87```bash
88cd .github/skills/nano-banana-assets/scripts
89python generate_with_transparency.py "Your prompt" "1:1" "1024x1024"
90```
91- ✅ Generates with #00FF00 chroma key (no fake checkered patterns)
92- ✅ Removes background with rembg (AI-powered)
93- ✅ Outputs transparent RGBA PNG files
94- ✅ Saves both transparent and original versions
95
96**2. Batch Generation:**
97```bash
98# From config file
99python batch_generate.py --config example_batch_config.json --transparent
100
101# From prompts
102python batch_generate.py --prompts "Icon 1" "Icon 2" "Icon 3" --transparent
103```
104- ✅ Generate multiple assets at once
105- ✅ Optional transparency support
106- ✅ Progress tracking and error handling
107
108**3. Post-Process Existing Images:**
109```bash
110# Remove backgrounds from already-generated images
111python remove_backgrounds.py --directory ./images/
112
113# Or with chroma key
114python remove_backgrounds.py --chroma-key "#00FF00" image.png
115```
116- ✅ AI-powered removal with rembg
117- ✅ Chroma key color removal
118- ✅ Batch directory processing
119
120**See `scripts/README.md` for complete documentation and examples.**
121
122**Requirements:**
123```bash
124pip install rembg requests Pillow
125```
126
127**Post-Processing Background Removal:**
128
129**Recommended: Using rembg (AI-powered removal)**
130
131The **rembg** tool provides automated, high-quality background removal that works with any background color (including chroma key backgrounds):
132
1331. **Install rembg:**
134 ```bash
135 pip install rembg[gpu] # For GPU acceleration
136 # or
137 pip install rembg # CPU only
138 ```
139
1402. **Remove background (single file):**
141 ```bash
142 rembg i input.png output.png
143 ```
144
1453. **Batch process all files:**
146 ```bash
147 # Process all PNG files in directory
148 for file in *.png; do
149 rembg i "$file" "transparent_$file"
150 done
151
152 # Or use rembg's built-in batch processing
153 rembg p input_folder output_folder
154 ```
155
1564. **Python API (for integration):**
157 ```python
158 from rembg import remove
159 from PIL import Image
160
161 input_path = 'input.png'
162 output_path = 'output.png'
163
164 with open(input_path, 'rb') as i:
165 with open(output_path, 'wb') as o:
166 input_data = i.read()
167 output_data = remove(input_data)
168 o.write(output_data)
169 ```
170
171**Why rembg is Best:**
172- ✅ AI-powered edge detection (U²-Net model)
173- ✅ Works with any background color (chroma key or natural)
174- ✅ High-quality results with fine details (hair, fur, transparent objects)
175- ✅ Fully automated - no manual selection needed
176- ✅ Fast batch processing
177- ✅ Open source and free
178
179**Alternative: Manual Chroma Key Removal**
180
181If you prefer manual control or don't want to install rembg:
182
1831. **Using ImageMagick (CLI):**
184 ```bash
185 # Remove bright green background with tolerance
186 convert input.png -fuzz 5% -transparent "#00FF00" output.png
187
188 # Batch process all files
189 for file in *.png; do
190 convert "$file" -fuzz 5% -transparent "#00FF00" "transparent_$file"
191 done
192 ```
193
1942. **Using Photoshop:**
195 - Select → Color Range → Sample the green background
196 - Adjust tolerance as needed
197 - Delete selection → Save as PNG with transparency
198
1993. **Using GIMP:**
200 - Colors → Color to Alpha → Select the green (#00FF00)
201 - Export as PNG with alpha channel
202
2034. **Using FFmpeg (for batch):**
204 ```bash
205 ffmpeg -i input.png -filter_complex "colorkey=0x00FF00:0.3:0.2" output.png
206 ```
207
208**Not Recommended:**
209
2101. **Plain White/Gray Backgrounds:**
211 - ⚠️ Harder to remove if subject has similar colors
212 - Requires more manual editing around edges
213
2142. **Request "Transparent" (Avoid):**
215 - ❌ Creates fake checkered patterns painted as pixels
216 - ❌ Very difficult to remove cleanly
217
218**What to Tell Users:**
219```
220Note: Generated images have solid backgrounds (RGB PNG format).
221The model cannot create true transparent backgrounds (RGBA).
222
223For transparency removal, I recommend using rembg (AI-powered):
224 pip install rembg
225 rembg i input.png output.png
226
227Or for manual chroma key removal with the bright green (#00FF00) background:
228 convert image.png -fuzz 5% -transparent "#00FF00" output.png
229
230The chroma key approach avoids the "fake checkered pattern" issue.
231```
232
233## Core Capabilities
234
2351. **Generate Single Assets**: Create icons, banners, backgrounds, UI elements, and more
2362. **Generate Asset Packs**: Create cohesive sets of related assets with consistent branding
2373. **Edit Existing Assets**: Apply fine-grained edits to existing images
2384. **Ensure Brand Consistency**: Analyze and maintain visual identity across multiple assets
2395. **Generate Consistent Series (6+ Images)**: Create large image series maintaining consistency using the sliding window technique
240
241## Prerequisites
242
243Before using this skill, ensure you have:
244
245- OpenRouter API key (get one from https://openrouter.ai/)
246- The API key should be stored as `OPENROUTER_API_KEY` environment variable
247- Internet access to call the OpenRouter API
248
249## API Configuration
250
251### Base URL
252```
253https://openrouter.ai/api/v1/chat/completions
254```
255
256### Model
257```
258google/gemini-3-pro-image-preview
259```
260
261### Authentication
262```
263Authorization: Bearer <OPENROUTER_API_KEY>
264```
265
266## Core Operations
267
268### 1. Generate a Single Asset
269
270Use this when the user needs one specific asset (icon, banner, background, etc.).
271
272**When to use:**
273- User asks for "create an icon"
274- User wants "generate a banner"
275- User needs "make a background image"
276- User requests any single graphic asset
277
278**Steps:**
2791. Collect requirements:
280 - What type of asset (icon, banner, background, UI element, etc.)
281 - Description/prompt (be detailed and specific)
282 - Aspect ratio (1:1, 16:9, 9:16, 4:3, 21:9, etc.)
283 - Resolution (1080x1080, 1920x1080, 2K, 4K)
284 - Color palette (hex codes)
285 - Any reference images or logos
286
2872. Build the prompt using the **Six-Element Framework** (Google's recommended approach):
288 ```
289 Generate a high-quality [asset type] with the following specifications:
290
291 Subject: [Who/what is in the image - be specific about physical attributes, elements]
292 Composition: [Framing, perspective, layout - e.g., "centered", "rule of thirds", "close-up", "wide shot"]
293 Action: [What is happening - static pose, interaction, movement]
294 Location: [Setting, environment, context - where the scene takes place]
295 Style: [Overall aesthetic - photorealistic, flat design, minimalist, bold, etc.]
296 Lighting: [Specific lighting setup - "soft diffused daylight", "dramatic side lighting", "golden hour", etc.]
297
298 Camera Details: [Optional - "85mm lens", "shallow depth of field", "low angle", etc.]
299 Materiality: [Optional - texture details like "matte finish", "brushed steel", "translucent glass"]
300
301 Technical Specifications:
302 Aspect Ratio: [ratio]
303 Resolution: [resolution]
304 Color Palette: [hex codes]
305
306 Requirements:
307 - Professional, web-ready quality
308 - Modern and visually appealing design
309 - Optimized for digital use
310 - Clean and polished appearance
311 ```
312
3133. Make the API call (see API Call Format section below)
314
3154. Extract generated images from response.choices[0].message.images array
316
3175. Present the images to the user
318
319**Example prompt (using Six-Element Framework):**
320```
321Generate a high-quality hero banner with the following specifications:
322
323Subject: Abstract geometric shapes (floating hexagons, connecting lines, particles) creating a tech-forward atmosphere
324Composition: Wide shot with visual weight on right side, negative space on left for text overlay, balanced with rule of thirds
325Action: Subtle sense of movement with particles drifting upward, energy flowing through connecting lines
326Location: Digital space with infinite depth, contemporary tech environment
327Style: Modern minimalist with vibrant gradients, clean professional aesthetic suitable for SaaS landing page
328Lighting: Soft ambient glow from gradient background, subtle rim lighting on geometric elements to create depth
329
330Camera Details: Slight elevated perspective, as if viewing a 3D space, medium depth of field
331Materiality: Gradient elements have smooth glass-like quality, geometric shapes with subtle metallic sheen
332
333Technical Specifications:
334Aspect Ratio: 16:9
335Resolution: 1920x1080
336Color Palette: #667EEA (primary blue), #764BA2 (deep purple), #F093FB (accent pink)
337
338Requirements:
339- Professional, web-ready quality
340- Eye-catching yet not overwhelming
341- Clear space on left third for headline text
342- Optimized for digital use
343```
344
345### 2. Generate Asset Pack
346
347Use this when the user needs multiple related assets maintaining brand consistency.
348
349**When to use:**
350- User asks for "social media kit"
351- User wants "complete branding package"
352- User needs "set of icons" or "icon set"
353- User requests multiple related assets
354
355**Steps:**
3561. Collect requirements:
357 - Overall purpose/description
358 - List of asset types needed (e.g., "instagram-post", "facebook-cover", "icon-set")
359 - Brand guidelines (style, tone, values)
360 - Color palette
361 - Logo file (if any)
362 - Default aspect ratio and resolution
363
3642. Build the prompt using the **Six-Element Framework**:
365 ```
366 Generate a complete, brand-consistent asset pack for web development:
367
368 Project Description: [description]
369
370 Asset Types to Generate:
371 1. [asset type 1] - Subject: [...], Composition: [...], Style: [...]
372 2. [asset type 2] - Subject: [...], Composition: [...], Style: [...]
373 3. [asset type 3] - Subject: [...], Composition: [...], Style: [...]
374 ...
375
376 Brand Guidelines:
377 Subject Matter: [What visual elements represent the brand]
378 Composition Approach: [How elements should be arranged - balanced, dynamic, minimal, etc.]
379 Visual Actions: [Static vs dynamic, energy level, mood]
380 Contextual Environment: [Where these assets exist - digital, physical, abstract]
381 Overall Style: [Aesthetic direction - minimalist, bold, elegant, playful, etc.]
382 Lighting Treatment: [Consistent lighting approach across all assets]
383
384 Camera & Materiality:
385 [Any specific perspective or texture requirements]
386
387 Brand Color Palette: [colors]
388 Default Aspect Ratio: [ratio]
389 Default Resolution: [resolution]
390
391 Requirements:
392 - All assets must maintain visual consistency
393 - Follow the brand guidelines strictly
394 - Use the provided color palette throughout
395 - Professional, production-ready quality
396 - Each asset should be optimized for its specific use case
397 - Cohesive design language across all assets
398 ```
399
4003. Make the API call with reference images if provided
401
4024. Extract all generated images from the response
403
4045. Present each asset with its type/purpose labeled
405
406**Example prompt (with Six-Element Framework):**
407```
408Generate a complete, brand-consistent asset pack for web development:
409
410Project Description: Social media kit for an eco-friendly coffee brand targeting young professionals
411
412Asset Types to Generate:
4131. Instagram post (square, 1:1) - Subject: Coffee cup with natural elements, Composition: Centered product shot, Style: Warm and inviting
4142. Instagram story (vertical, 9:16) - Subject: Brewing process with eco messaging, Composition: Vertical flow top to bottom, Style: Dynamic and engaging
4153. Facebook cover (wide banner) - Subject: Coffee beans and sustainable packaging, Composition: Wide panoramic layout, Style: Professional and earthy
4164. Twitter header (wide banner) - Subject: Brand story visual elements, Composition: Horizontal narrative, Style: Clean and modern
4175. App icon (square, simple) - Subject: Stylized coffee cup or bean, Composition: Centered symbol, Style: Minimalist and recognizable
418
419Brand Guidelines:
420Subject Matter: Natural coffee elements (beans, cups, plants), sustainable packaging, organic textures, eco-friendly themes
421Composition Approach: Clean, balanced layouts with breathing room, focus on product and nature harmony
422Visual Actions: Static, serene presentations with subtle organic movement suggestions
423Contextual Environment: Natural light settings, wooden surfaces, green plants, sustainable materials backdrop
424Overall Style: Minimalist, nature-inspired, earthy aesthetics. Modern organic fusion with professional polish.
425Lighting Treatment: Warm, soft natural light (golden hour quality), gentle shadows, inviting and cozy atmosphere
426
427Camera & Materiality:
428Slight top-down or 3/4 angles for product shots, natural wood grain textures, matte ceramic finishes, organic paper textures
429
430Brand Color Palette: #2ECC71 (eco green), #27AE60 (forest), #8B4513 (coffee brown), #F5F5DC (cream)
431Default Aspect Ratio: 1:1
432Default Resolution: 1080x1080
433
434Requirements:
435- All assets must maintain visual consistency
436- Follow the brand guidelines strictly
437- Use the provided color palette throughout
438- Professional, production-ready quality
439- Each asset should be optimized for its specific use case
440- Cohesive design language across all assets
441```
442
443### 3. Edit Existing Asset
444
445Use this when the user wants to modify an existing image.
446
447**When to use:**
448- User says "edit this image"
449- User wants "adjust the lighting"
450- User needs "change the colors"
451- User requests any modification to an existing asset
452
453**Steps:**
4541. Get the source image (URL or base64 data)
455
4562. Collect edit requirements:
457 - Specific edit instructions (be precise)
458 - Elements to preserve (logo, text, specific objects)
459 - Target aspect ratio (if changing)
460 - Target resolution (if changing)
461
4623. Build the prompt with detailed editing instructions:
463 ```
464 Edit the provided image with the following instructions:
465
466 Edit Instructions: [Specific edits using the Six-Element Framework]
467 - Subject modifications: [What elements to add, remove, or change]
468 - Composition adjustments: [Layout, framing, perspective changes]
469 - Action changes: [Modify movement, energy, or static elements]
470 - Location alterations: [Background, environment, context changes]
471 - Style refinements: [Aesthetic adjustments, visual treatment]
472 - Lighting adjustments: [Specific lighting changes - "warmer tones", "increase contrast", "soften shadows"]
473
474 Camera & Detail Changes:
475 - [Optional: focal point, depth of field, perspective adjustments]
476 - [Optional: texture, materiality, surface quality changes]
477
478 Preserve These Elements: [elements to keep]
479 Target Aspect Ratio: [ratio]
480 Target Resolution: [resolution]
481
482 Editing Requirements:
483 - Apply edits precisely as instructed
484 - Maintain image quality and professional appearance
485 - Preserve specified elements without alteration
486 - Ensure smooth transitions and natural-looking results
487 - Output should be web-ready and optimized
488 ```
489
4904. Make the API call with the source image included in the content array
491
4925. Extract edited image from the response
493
4946. Present the edited image to the user
495
496**Example prompt with image (using Six-Element Framework):**
497```
498Edit the provided image with the following instructions:
499
500Edit Instructions:
501- Subject modifications: Enhance the main product to appear more premium, add subtle glow effect around edges
502- Composition adjustments: Maintain current centered composition but add slight depth with background blur
503- Action changes: Keep static presentation but add subtle energy with light particles
504- Location alterations: Keep current setting but add warmer, more inviting environmental tones
505- Style refinements: Shift toward more premium, upscale aesthetic while maintaining brand identity
506- Lighting adjustments: Adjust to golden hour lighting quality - warm amber tones from top-left, increase contrast by 20%, soften hard shadows to create more inviting mood, add subtle vignette effect around edges for focus
507
508Camera & Detail Changes:
509- Simulate shallow depth of field effect (85mm equivalent)
510- Enhance material quality: make surfaces appear more premium with subtle highlights
511- Add subtle warm color grading throughout
512
513Preserve These Elements: logo in top-left corner, main product in center, text overlay at bottom, brand colors in text elements
514
515Editing Requirements:
516- Apply edits precisely as instructed
517- Maintain image quality and professional appearance
518- Preserve specified elements without alteration
519- Ensure smooth transitions and natural-looking results
520- Output should be web-ready and optimized
521```
522
523### 4. Ensure Brand Consistency
524
525Use this when the user wants to check if multiple assets follow brand guidelines.
526
527**When to use:**
528- User says "check these assets for consistency"
529- User wants "review brand compliance"
530- User needs "validate branding"
531- User asks if assets "match the guidelines"
532
533**Steps:**
5341. Collect all assets to analyze (URLs or base64 data)
535
5362. Get brand guidelines:
537 - Detailed style requirements
538 - Color palette (official brand colors)
539 - Reference images showing desired style
540 - Logo file
541 - Typography preferences
542 - Tone and values
543
5443. Build the prompt:
545 ```
546 Analyze the following assets for brand consistency and provide recommendations:
547
548 Brand Guidelines:
549 [detailed guidelines]
550
551 Brand Colors: [hex codes]
552
553 Analysis Requirements:
554 - Check adherence to brand guidelines
555 - Verify consistent use of colors, typography, and style
556 - Identify inconsistencies across assets
557 - Provide specific recommendations for improvements
558 - Suggest refinements to maintain brand identity
559 - Ensure logo usage is consistent and appropriate
560 - Verify visual cohesion across all assets
561
562 I have [N] assets to analyze. Please review them for consistency.
563 ```
564
5654. Make the API call with all assets and reference images
566
5675. Extract analysis text and any corrected images
568
5696. Present the analysis with specific recommendations
570
571**Example prompt:**
572```
573Analyze the following assets for brand consistency and provide recommendations:
574
575Brand Guidelines:
576- Style: Modern, minimalist, professional
577- Tone: Trustworthy, innovative, forward-thinking
578- Colors must be limited to the brand palette
579- Logo must always be visible and properly sized
580- Typography: Clean, sans-serif, high readability
581- Imagery: High-tech, futuristic, abstract geometric patterns preferred
582
583Brand Colors: #667EEA, #764BA2, #FFFFFF, #2D3748
584
585Analysis Requirements:
586- Check adherence to brand guidelines
587- Verify consistent use of colors, typography, and style
588- Identify inconsistencies across assets
589- Provide specific recommendations for improvements
590- Suggest refinements to maintain brand identity
591- Ensure logo usage is consistent and appropriate
592- Verify visual cohesion across all assets
593
594I have 4 assets to analyze. Please review them for consistency.
595```
596
597### 5. Generate Consistent Series (More than 5 Images)
598
599Use this when the user needs to generate **a large series of images** (10+, 20+, 50+) that must maintain consistency across the entire series.
600
601**Background**: Nano Banana Pro can process up to **14 reference images** per request and maintain identity for up to **5 distinct subjects/characters**. For generating extensive series (many more images than can be used as references), use a **sliding window approach** where you use the most recent 5-14 generated images as references for each new image.
602
603**When to use:**
604- User asks for "20+ icons in the same style"
605- User wants "a storyboard with 15+ frames"
606- User needs "30-day social media calendar with consistent branding"
607- User requests any extensive image series (icon libraries, product catalogs, etc.)
608
609**Steps:**
610
6111. **Initial Setup**:
612 - Collect series requirements:
613 - Overall series description
614 - Individual descriptions for each image
615 - Brand guidelines and style requirements
616 - Color palette
617 - Aspect ratio and resolution
618 - Any initial reference images or logo (up to 14 images)
619
6202. **Generate First Image**:
621 - Use any initial reference images provided
622 - Include brand guidelines and color palette
623 - This establishes the baseline style
624
6253. **Generate Subsequent Images (Sliding Window)**:
626 - For images 2-14: Use ALL previously generated images as references (accumulating)
627 - For image 15 onwards: Use only the LAST 10-14 generated images as references (sliding window)
628 - This maintains consistency while respecting the model's 14-image reference limit
629 - Recommended: Use 10-12 recent images to leave room for logo/initial references
630
6314. **Workflow Pattern**:
632
633 **For each image in the series:**
634
635 a. Build the prompt:
636 ```
637 Generate image [N] of [TOTAL] for this series:
638
639 Series Context: [overall description]
640
641 This Image: [specific description for this image]
642
643 Brand Guidelines:
644 [guidelines]
645
646 Color Palette: [colors]
647 Aspect Ratio: [ratio]
648 Resolution: [resolution]
649
650 Consistency Requirements:
651 - Maintain the same visual style as the reference images
652 - Use consistent design language, color treatment, and composition
653 - Ensure this image feels like part of the same cohesive series
654 - Professional, web-ready quality
655 - Modern and polished appearance
656
657 IMPORTANT: The reference images show the previously generated images in this series. Match their style, tone, and visual identity exactly while creating this new variation.
658 ```
659
660 b. Prepare reference images (up to 14 total):
661 ```
662 reference_images = []
663
664 # Add logo if provided (takes 1 slot)
665 if logo_file:
666 reference_images.append(logo_file)
667
668 # Add initial style references only for first image (up to 3-5 slots)
669 if current_image == 1 and initial_references:
670 reference_images.extend(initial_references[:5]) # Limit to first 5
671
672 # Add previously generated images (sliding window approach)
673 if generated_images:
674 # Calculate how many slots remain (max 14 total)
675 remaining_slots = 14 - len(reference_images)
676
677 # For images 2-14: Use all previous images (if they fit)
678 if current_image <= 14:
679 reference_images.extend(generated_images[:remaining_slots])
680 else:
681 # For image 15+: Use last 10-12 images (sliding window)
682 # Keep 2-4 slots for logo and initial references
683 window_size = min(remaining_slots, 12)
684 start_index = max(0, len(generated_images) - window_size)
685 reference_images.extend(generated_images[start_index:])
686 ```
687
688 c. Make API call with reference images (max 14)
689
690 d. Store the generated image for use in next iteration
691
692 e. Repeat for next image
693
6945. **Present results with clear tracking**:
695 - Show each image with its number and description
696 - Indicate which images were used as references
697 - Confirm consistency across the series
698
699**Example workflow for 20-icon series:**
700
701```
702User Request: "Create 20 minimalist weather icons with consistent style"
703
704Your Workflow:
705
706Step 1: Generate Icon 1 (Sunny)
707---
708Prompt: "Generate icon 1 of 20 for this series:
709
710Series Context: Weather icon set with minimalist design. Clean lines, modern style, consistent 2px stroke weight, rounded line caps, monochrome design (#2D3748) on solid bright green (#00FF00) chroma key background for easy removal.
711
712This Image: Sunny weather - sun with rays
713
714Aspect Ratio: 1:1
715Resolution: 512x512
716
717Consistency Requirements:
718- Professional, web-ready quality
719- Modern and polished appearance
720- Clean, simple design with consistent visual language"
721
722References: [initial style guide images if any, logo if any]
723[Make API call]
724[Store generated icon 1]
725
726Step 2: Generate Icon 2 (Cloudy)
727---
728Prompt: "Generate icon 2 of 20 for this series:
729
730Series Context: Weather icon set with minimalist design, matching the previous icon's stroke weight and design language.
731
732This Image: Cloudy weather - cloud shape
733
734Consistency Requirements:
735- Maintain the same visual style as the reference images
736- Use consistent design language, stroke weight, line caps
737- Ensure this icon feels like part of the same icon family
738
739IMPORTANT: The reference images show the previously generated icons. Match their style exactly."
740
741References: [logo if any, icon 1]
742[Make API call]
743[Store generated icon 2]
744
745Steps 3-14: Generate Icons 3-14
746---
747Same process, accumulating all previous icons as references
748- Icon 3 references: [logo, icons 1-2]
749- Icon 4 references: [logo, icons 1-3]
750- Icon 5 references: [logo, icons 1-4]
751...
752- Icon 14 references: [logo, icons 1-13] (at or near 14-image limit)
753
754Step 15: Generate Icon 15 (Heavy Rain) - SLIDING WINDOW STARTS
755---
756Prompt: [same structure emphasizing consistency]
757
758References: [logo, icons 4-14] ← Last 11 icons (11 + 1 logo = 12 references)
759[Make API call]
760[Store generated icon 15]
761
762Steps 16-20: Generate Icons 16-20
763---
764Continue with sliding window:
765- Icon 16 references: [logo, icons 5-15]
766- Icon 17 references: [logo, icons 6-16]
767- Icon 18 references: [logo, icons 7-17]
768- Icon 19 references: [logo, icons 8-18]
769- Icon 20 references: [logo, icons 9-19] ← Last 11 + logo
770[Store generated icon 8]
771
772Final Response:
773Final Response:
774"✅ Generated 20 consistent weather icons!
775
776Icons created with sliding window consistency:
777- Icons 1-14: Each new icon referenced all previous icons (accumulating references)
778- Icons 15-20: Each used the last 11 icons + logo (sliding window of 12 references)
779
780Consistency maintained throughout:
781- Same stroke weight (2px)
782- Same line caps (rounded)
783- Same color (#2D3748)
784- Same minimalist style
785- Cohesive visual family
786
787All 20 icons maintain perfect consistency across the entire series!"
788
789[Present all 20 icons]
790```
791
792**Key Points:**
793
794- **14-image reference limit**: Model can process up to 14 reference images per request
795- **Sliding window**: Use last 10-14 images as references for extensive series
796- **5 subject identities**: Model maintains consistency for up to 5 different characters/subjects
797- **Explicit instructions**: Tell the model the reference images are from the same series
798- **Consistency emphasis**: Emphasize matching style, tone, and identity in every prompt
799- **Series context**: Always include the overall series description
800- **Track progress**: Keep track of which images are used as references
801- **Quality control**: After generation, visually verify consistency
802
803**Common Use Cases:**
804- Large icon sets (20+, 50+, 100+ icons)
805- Storyboards with many frames (15-30+ frames)
806- Social media calendar (30-90 days of posts)
807- Product catalog (extensive product variations)
808- UI component libraries (complete design systems)
809- Brand asset collections (comprehensive asset libraries)
810- Character variations (same character in different poses/scenes)
811
812## API Call Format
813
814### Basic Request Structure
815
816```json
817{
818 "model": "google/gemini-3-pro-image-preview",
819 "messages": [
820 {
821 "role": "user",
822 "content": [
823 {
824 "type": "text",
825 "text": "YOUR PROMPT HERE"
826 }
827 ]
828 }
829 ],
830 "modalities": ["image", "text"],
831 "temperature": 0.7,
832 "max_tokens": 4096
833}
834```
835
836### With Image Input (for editing or reference)
837
838```json
839{
840 "model": "google/gemini-3-pro-image-preview",
841 "messages": [
842 {
843 "role": "user",
844 "content": [
845 {
846 "type": "image_url",
847 "image_url": {
848 "url": "https://example.com/image.png"
849 }
850 },
851 {
852 "type": "text",
853 "text": "YOUR PROMPT HERE"
854 }
855 ]
856 }
857 ],
858 "modalities": ["image", "text"],
859 "temperature": 0.7,
860 "max_tokens": 4096
861}
862```
863
864### With Aspect Ratio Control
865
866```json
867{
868 "model": "google/gemini-3-pro-image-preview",
869 "messages": [
870 {
871 "role": "user",
872 "content": [
873 {
874 "type": "text",
875 "text": "YOUR PROMPT HERE"
876 }
877 ]
878 }
879 ],
880 "modalities": ["image", "text"],
881 "image_config": {
882 "aspect_ratio": "16:9"
883 },
884 "temperature": 0.7,
885 "max_tokens": 4096
886}
887```
888
889### Required Headers
890
891```
892Authorization: Bearer YOUR_OPENROUTER_API_KEY
893Content-Type: application/json
894HTTP-Referer: https://github.com/shelbeely/Openrouter-Nano-banana-assets-generator-MCP
895X-Title: Nano Banana Assets Generator
896```
897
898### Response Format
899
900```json
901{
902 "choices": [
903 {
904 "message": {
905 "content": "Description of generated assets...",
906 "images": [
907 {
908 "image_url": {
909 "url": "data:image/png;base64,iVBORw0KGgoAAAANS..."
910 }
911 }
912 ]
913 }
914 }
915 ]
916}
917```
918
919## Supported Aspect Ratios
920
921The following aspect ratios are supported by Gemini/Nano Banana Pro (per official Google documentation):
922
923**Landscape formats:**
924- `21:9` - Ultra-wide cinematic (ideal for hero banners, cinematic compositions)
925- `16:9` - Widescreen (YouTube thumbnails, web banners, hero sections, presentations)
926- `4:3` - Traditional landscape (presentations, older displays)
927- `3:2` - Standard photo landscape (traditional photography)
928- `5:4` - Landscape with slight squareness
929
930**Square format:**
931- `1:1` - Square (Instagram posts, icons, profile pictures, avatars)
932
933**Portrait formats:**
934- `9:16` - Vertical widescreen (Instagram/Facebook stories, mobile screens, TikTok)
935- `3:4` - Traditional portrait (traditional photography)
936- `2:3` - Portrait photo standard (magazine covers, portraits)
937- `4:5` - Portrait with slight width
938- `9:21` - Ultra-tall portrait (rare, specialized mobile UI)
939
940## Supported Resolutions
941
942- `1080x1080` - Standard square (1:1)
943- `1920x1080` - Full HD (16:9)
944- `1080x1920` - Full HD vertical (9:16)
945- `2K` (2560x1440) - High quality
946- `4K` (3840x2160) - Ultra high quality
947- `3840x2160` - 4K explicit
948- `2560x1440` - 2K explicit
949- `1280x720` - HD ready
950
951## Best Practices
952
953### Writing Effective Prompts (Google's Six-Element Framework)
954
955Google's research shows that prompts structured around six core elements produce the best results with Gemini models:
956
9571. **Subject: Define Who/What**
958 - Be specific about the main elements, characters, or objects
959 - Include physical attributes, characteristics, and details
960 - ❌ "A banner"
961 - ✅ "A modern SaaS hero banner featuring abstract geometric shapes (floating hexagons, connecting nodes, light particles)"
962
9632. **Composition: Describe Framing & Layout**
964 - Specify camera angles, framing, and perspective
965 - Use standard photography/design terms
966 - ❌ "Nice layout"
967 - ✅ "Wide shot with rule of thirds composition, negative space on left third for text overlay, visual weight balanced on right"
968
9693. **Action: Explain What's Happening**
970 - Describe movement, interactions, or static positioning
971 - Define energy level and dynamics
972 - ❌ "Some movement"
973 - ✅ "Subtle upward particle drift creating sense of innovation and progress, energy flowing through connecting lines"
974
9754. **Location: Set the Environment**
976 - Describe setting, context, and surroundings
977 - Include environmental details that enhance the scene
978 - ❌ "Tech background"
979 - ✅ "Contemporary digital workspace with infinite depth, clean minimal environment suggesting cloud/SaaS platform"
980
9815. **Style: Define the Aesthetic**
982 - Be specific about visual treatment and design approach
983 - Reference design movements, art styles, or specific aesthetics
984 - ❌ "Modern look"
985 - ✅ "Modern minimalist with vibrant gradients, flat design principles, clean professional aesthetic suitable for enterprise SaaS"
986
9876. **Lighting: Specify Illumination Details**
988 - Describe light sources, quality, direction, and mood
989 - Include shadows, highlights, and atmospheric effects
990 - ❌ "Good lighting"
991 - ✅ "Soft ambient glow from gradient background, subtle rim lighting on geometric elements from top-right creating depth, gentle shadows"
992
993### Advanced Prompt Enhancements
994
9951. **Camera Details** (Optional but Powerful)
996 - Lens specifications: "85mm portrait lens", "24mm wide angle"
997 - Focal properties: "shallow depth of field", "everything in focus"
998 - Perspective: "low angle looking up", "bird's eye view", "eye level"
999 - Example: "Shot with 85mm equivalent focal length, f/2.8 aperture for subtle background blur"
1000
10012. **Materiality & Texture** (For Product/Design Assets)
1002 - Surface qualities: "matte finish", "glossy", "brushed metal", "frosted glass"
1003 - Texture details: "smooth gradient", "paper texture", "fabric weave", "metallic sheen"
1004 - Example: "Gradient elements have smooth glass-like quality, geometric shapes with subtle metallic sheen, soft velvety background"
1005
10063. **Full Sentence Narratives**
1007 - Use natural language, not just keywords
1008 - Brief the AI like a creative director
1009 - ❌ "blue purple gradient tech shapes modern"
1010 - ✅ "Create a hero shot featuring an abstract technology landscape with flowing gradients from deep blue to vibrant purple, populated with geometric shapes that suggest connectivity and innovation"
1011
1012### Iterative Conversational Editing
1013
1014Nano Banana Pro excels at multi-turn refinement. Instead of regenerating, use conversational edits:
1015
1016**Initial Prompt:**
1017```
1018Generate a product banner for smart home device...
1019```
1020
1021**Follow-up Edit 1:**
1022```
1023Make the lighting warmer and more inviting, shift from cool tones to golden hour quality
1024```
1025
1026**Follow-up Edit 2:**
1027```
1028Add the brand logo in top-left corner, subtle drop shadow, 15% opacity
1029```
1030
1031**Follow-up Edit 3:**
1032```
1033Increase the contrast of the main product by 20%, make it pop more against the background
1034```
1035
1036This preserves composition and layout while refining specific aspects.
1037
1038### Writing Effective Prompts (Legacy Guidelines - Still Valid)
1039
10401. **Be Specific and Detailed**
1041 - ❌ "Make a banner"
1042 - ✅ "Create a modern tech startup hero banner with gradient background from blue to purple, abstract geometric elements, and space for overlaying text"
1043
10442. **Include Context**
1045 - Mention where the asset will be used (website, social media, email, app)
1046 - Specify the target audience
1047 - Describe the desired mood/emotion
1048
10493. **Define Style Clearly**
1050 - Use descriptive terms: minimalist, vibrant, elegant, playful, professional
1051 - Reference art styles: flat design, material design, glassmorphism, etc.
1052 - Mention specific elements: gradients, shadows, textures, patterns
1053
10544. **Specify Technical Requirements**
1055 - Always include aspect ratio for the intended use case
1056 - Mention resolution if quality is critical
1057 - List any technical constraints
1058
1059### Color Guidance
1060
10611. **Provide Hex Codes**
1062 - ✅ Use: "#667EEA", "#764BA2"
1063 - ❌ Avoid: "blue", "purple"
1064
10652. **Include 3-5 Brand Colors**
1066 - Primary color
1067 - Secondary color
1068 - Accent color(s)
1069 - Background color (if applicable)
1070
10713. **Consider Color Harmony**
1072 - Complementary colors for contrast
1073 - Analogous colors for harmony
1074 - Triadic colors for vibrancy
1075
1076### Reference Images
1077
10781. **Use Up to 14 Reference Images (Not Just 5)**
1079 - Nano Banana Pro supports up to **14 reference images** per request
1080 - Use for style guidance, composition examples, and identity preservation
1081 - Categories of references:
1082 - **Style references**: Overall aesthetic and visual treatment (1-3 images)
1083 - **Composition references**: Layout and arrangement examples (1-2 images)
1084 - **Color treatment references**: Mood and color grading (1-2 images)
1085 - **Subject/identity references**: For maintaining character or product consistency (up to 5 distinct subjects)
1086 - **Technical references**: Quality level and detail expectations (1-2 images)
1087 - **Brand assets**: Logos and brand elements (1-2 images)
1088
10892. **Provide Context for References**
1090 - Explain what aspect to emulate from each reference
1091 - Clarify what to avoid from the reference
1092 - Specify if it's for style, composition, color, or subject identity
1093 - Example: "Reference image 1 shows the composition layout to follow. Reference image 2 demonstrates the lighting quality desired."
1094
10953. **Identity Preservation Across References**
1096 - Model can maintain consistency for up to **5 distinct subjects/characters** across the 14 references
1097 - Use
1098
1099…(truncated)