Refactor high-complexity React components in Dify frontend. Use when `pnpm analyze-component...
npx skills add eovidiu/agents-skills --skill "nano-banana-image-generator"
Install specific skill from multi-skill repository
# Description
Use this agent when an article has been completed by the content-writer agent AND reviewed by the article-credibility-reviewer agent, and a visual header image is needed for the post. This agent should be triggered proactively after both content creation and credibility review are complete.
# SKILL.md
name: nano-banana-image-generator
description: Use this agent when an article has been completed by the content-writer agent AND reviewed by the article-credibility-reviewer agent, and a visual header image is needed for the post. This agent should be triggered proactively after both content creation and credibility review are complete.
Nano Banana Image Generator
Overview
This skill provides comprehensive image generation and editing capabilities using Google's Nano Banana (Gemini 2.5 Flash Image) and Nano Banana Pro (Gemini 3 Pro Image) models. Generate complex UI mockups, hero images, illustrations, and any visual assets needed for articles, applications, or presentations.
Prerequisites
Before using this skill, ensure:
1. The GEMINI_API_KEY or GOOGLE_API_KEY environment variable is set
2. Required packages are installed (auto-installs on first run, or run setup manually)
Setup
The script automatically installs dependencies on first run using the best available installer:
- uv (preferred - 10-100x faster than pip)
- pip3 (fallback)
- pip (fallback)
To manually install or force reinstall:
# Auto-install using best available installer
python scripts/nano_banana.py setup
# Force reinstall
python scripts/nano_banana.py setup --force
# Or manually with uv (recommended)
uv pip install google-genai Pillow
# Or with pip
pip install google-genai Pillow
Quick Start
Generate Article Header Image
To generate a header image for a completed article:
python scripts/nano_banana.py generate "A professional hero image for an article about [topic], featuring [visual elements], [style] style" --model pro --aspect-ratio 16:9 --output header.png
Generate UI Mockup
python scripts/nano_banana.py ui "Dashboard showing user analytics with charts and metrics" --type web --style modern --output dashboard.png
Edit Existing Image
python scripts/nano_banana.py edit input.png "Make the colors more vibrant and add a professional gradient overlay" --output enhanced.png
Core Capabilities
1. Text-to-Image Generation
Generate images from text descriptions using either:
- Flash model: Fast generation (~3-5 seconds), good for iteration
- Pro model: Higher quality (~8-15 seconds), better for final output
from scripts.nano_banana import generate_image
# Basic generation
paths = generate_image(
prompt="A futuristic city skyline at sunset with flying cars",
model="flash", # or "pro" for higher quality
aspect_ratio="16:9",
output_path="city.png"
)
2. UI Mockup Generation
Specialized function for generating realistic interface mockups:
from scripts.nano_banana import generate_ui_mockup
path = generate_ui_mockup(
description="A social media analytics dashboard with follower growth charts, engagement metrics, and recent post performance",
ui_type="dashboard", # web, mobile, desktop, tablet, dashboard
style="modern", # modern, minimal, corporate, playful, dark, glassmorphism
model="pro",
output_path="social_dashboard.png"
)
Available UI types:
- web: Website interface (16:9)
- mobile: Mobile app interface (9:16)
- desktop: Desktop application (16:9)
- tablet: Tablet app interface (4:3)
- dashboard: Analytics dashboard (16:9)
3. Image Editing
Edit existing images with natural language instructions:
from scripts.nano_banana import edit_image
path = edit_image(
image_path="original.png",
prompt="Remove the background and replace with a gradient from blue to purple",
model="flash",
output_path="edited.png"
)
4. Multi-Image Blending
Combine multiple images into a cohesive composition:
from scripts.nano_banana import blend_images
path = blend_images(
image_paths=["photo1.png", "photo2.png", "photo3.png"],
prompt="Create a seamless collage combining elements from all images",
model="flash",
output_path="collage.png"
)
5. Style Transfer
Apply artistic styles to images:
from scripts.nano_banana import style_transfer
# Using text description
path = style_transfer(
content_image_path="photo.png",
style_reference="watercolor painting with soft edges and flowing colors",
output_path="watercolor.png"
)
# Using reference image
path = style_transfer(
content_image_path="photo.png",
style_reference="style_reference.png",
output_path="styled.png"
)
Article Header Image Workflow
When generating header images for articles:
- Analyze article content: Identify key themes, concepts, and visual metaphors
- Choose appropriate style: Match the article tone (professional, creative, technical)
- Generate with Pro model: Use
--model profor publication-quality images - Use 16:9 aspect ratio: Standard for blog headers and social sharing
Example Prompts for Article Headers
Technical Article:
A professional hero image for a technical article about cloud architecture,
featuring abstract cloud formations with interconnected nodes and data streams,
clean modern style with blue and white color scheme, soft lighting
Business Article:
A sophisticated header image for a business strategy article,
featuring abstract geometric shapes representing growth and progress,
corporate professional style with navy and gold accents, gradient background
Creative Article:
An artistic hero image for a creative writing article,
featuring flowing ink strokes transforming into words and ideas,
watercolor style with vibrant colors, organic flowing composition
Supported Aspect Ratios
| Ratio | Best For | Dimensions |
|---|---|---|
| 1:1 | Profile images, thumbnails | 1024x1024 |
| 16:9 | Article headers, YouTube | 1344x768 |
| 9:16 | Mobile, Instagram Stories | 768x1344 |
| 4:3 | Presentations, tablets | 1152x896 |
| 3:2 | Photography, prints | 1216x832 |
| 21:9 | Ultra-wide banners | 1536x640 |
Model Selection Guide
| Use Case | Recommended Model | Reason |
|---|---|---|
| Quick iterations | flash | Fast generation |
| Final publication images | pro | Higher quality |
| Complex UI mockups | pro | Better detail and text |
| Simple graphics | flash | Sufficient quality |
| Text-heavy images | pro | Superior text rendering |
| Batch generation | flash | Cost and time efficient |
Command Line Reference
# Setup dependencies (uses uv if available, pip as fallback)
python scripts/nano_banana.py setup
python scripts/nano_banana.py setup --force # Force reinstall
# Generate image
python scripts/nano_banana.py generate "prompt" --model flash --aspect-ratio 16:9 --output image.png --count 4
# Edit image
python scripts/nano_banana.py edit input.png "editing instructions" --output edited.png
# Generate UI mockup
python scripts/nano_banana.py ui "description" --type mobile --style dark --output app.png
# Blend images
python scripts/nano_banana.py blend img1.png img2.png --prompt "blend instructions" --output merged.png
# Style transfer
python scripts/nano_banana.py style content.png --style "Van Gogh" --output styled.png
References
For detailed API documentation and advanced prompting techniques:
- references/api_reference.md: Complete API documentation
- references/ui_prompting_guide.md: UI mockup generation best practices
Troubleshooting
API Key Not Found
Ensure GEMINI_API_KEY or GOOGLE_API_KEY is set:
export GEMINI_API_KEY="your-key-here"
Rate Limiting
If encountering rate limits, wait 60 seconds between requests or use the Flash model for faster quota recovery.
Safety Filters
If content is blocked, rephrase the prompt to avoid triggering safety filters. Avoid requests for real people, violence, or copyrighted characters.
# Supported AI Coding Agents
This skill is compatible with the SKILL.md standard and works with all major AI coding agents:
Learn more about the SKILL.md standard and how to use these skills with your preferred AI coding agent.