Generate and edit images with Google's Nano Banana 2 model via WaveSpeed AI.
Design & media
Nanobanana Image
Try itImage generation and editing based on Google Gemini native image generation (Nano Banana).
What it does
Image generation and editing based on Google Gemini native image generation (Nano Banana). Supports text-to-image generation, image editing with reference images (modify elements/style/color), multi-image composition, Google Search real-time generation, YouTube video frame-to-image generation, and up to 4K resolution output. Use this skill when users need to generate images, edit images, perform style transfer, or composite multiple images.
The skill document
Nano Banana Image Generation/Editing Skill
Based on the Google Gemini native image generation API (Nano Banana), a single script covers all image generation and editing scenarios.
Prerequisites
1. Install dependencies
pip install google-genai Pillow
2. Set API Key
export GEMINI_API_KEY=your_gemini_api_key
# HTTP/HTTPS proxy (optional)
# export HTTPS_PROXY=$HTTPS_PROXY
# export HTTP_PROXY=$HTTP_PROXY
Get your API Key from Google AI Studio or Google Cloud Console.
1. Text-to-Image Generation
Generate new images from text descriptions.
# Basic generation
python3 scripts/generate.py \
--prompt "A photorealistic portrait of an elderly Japanese ceramicist in his workshop, golden hour lighting, 85mm lens bokeh"
# Specify resolution and aspect ratio
python3 scripts/generate.py \
--prompt "A minimalist 16:9 wallpaper of a misty mountain lake at dawn" \
--aspect-ratio 16:9 \
--image-size 2K \
--output wallpaper.png
# Use Pro model for professional assets
python3 scripts/generate.py \
--model gemini-3-pro-image \
--prompt "A modern minimalist logo for a coffee shop called 'The Daily Grind'. Bold sans-serif font, black and white, circular composition with a coffee bean motif." \
--output logo.png
# Output image only, no text
python3 scripts/generate.py \
--prompt "A kawaii sticker of a happy red panda with bamboo hat, white background, bold outlines" \
--image-only \
--output sticker.png
2. Image Editing
Provide a reference image and describe the modifications in text.
# Modify image elements
python3 scripts/generate.py \
--prompt "Add a small knitted wizard hat on the cat's head. Match the soft lighting of the photo." \
--images cat.jpg \
--output cat_wizard.png
# Local editing (semantic inpainting)
python3 scripts/generate.py \
--prompt "Change only the blue sofa to a vintage brown leather chesterfield sofa. Keep everything else unchanged." \
--images living_room.jpg \
--output living_room_edited.png
# Style transfer
python3 scripts/generate.py \
--prompt "Transform this city street photo into Van Gogh's 'Starry Night' style. Preserve the composition but add swirling brushstrokes in deep blues and bright yellows." \
--images city.jpg \
--output city_van_gogh.png
# Sketch to rendered image
python3 scripts/generate.py \
--prompt "Turn this rough pencil sketch into a polished concept car photo in a showroom. Keep the sleek lines, add metallic blue paint and neon rim lighting." \
--images car_sketch.jpg \
--output car_rendered.png
3. Multi-Image Composition (up to 14 images)
Provide multiple reference images to compose new scenes or maintain character/product consistency.
# People composition (maintain character features)
python3 scripts/generate.py \
--prompt "An office group photo of these people making funny faces. Natural lighting." \
--images person1.jpg person2.jpg person3.jpg person4.jpg \
--aspect-ratio 5:4 \
--image-size 2K \
--output group_photo.png
# Product + model composition (high-fidelity detail retention)
python3 scripts/generate.py \
--prompt "Create a professional e-commerce fashion photo. The woman wears the blue floral dress from the first image. Full-body shot, outdoor lighting." \
--images dress.jpg model.jpg \
--output ecommerce.png
# Logo placement
python3 scripts/generate.py \
--prompt "Put this logo on the woman's black t-shirt. Logo naturally printed on fabric following folds. Woman's face unchanged." \
--images woman.jpg logo.png \
--output woman_with_logo.png
4. Google Search Real-Time Generation
Generate images based on real-time search information (weather charts, news graphics, sports scores, etc.).
# Weather visualization
python3 scripts/generate.py \
--prompt "Visualize the current weather forecast for the next 5 days in Tokyo as a clean modern weather chart. Add clothing suggestions for each day." \
--search \
--aspect-ratio 16:9 \
--output weather_tokyo.png
# News graphics (better results with Pro model)
python3 scripts/generate.py \
--model gemini-3-pro-image \
--prompt "Make a stylish graphic of last night's Champions League match result." \
--search \
--output match_result.png
# Image Search (gemini-3.1-flash-image only)
python3 scripts/generate.py \
--prompt "A detailed painting of a resplendent quetzal bird in its natural habitat. Create a 3:2 wallpaper with a natural gradient background." \
--image-search \
--aspect-ratio 3:2 \
--output quetzal.png
5. Video Frame to Image (gemini-3.1-flash-image only)
Extract visual themes from YouTube videos to generate new images (posters, thumbnails, infographics, etc.).
# Generate video poster
python3 scripts/generate.py \
--prompt "Generate a cinematic movie poster that captures the key themes of this video. Bold title typography." \
--video "https://www.youtube.com/watch?v=UTdfxFyOQTI" \
--aspect-ratio 9:16 \
--output poster.png
6. High Thinking Level Generation (Complex Scenes)
# Enable high-quality thinking and save intermediate thought images
python3 scripts/generate.py \
--prompt "A futuristic city built inside a giant glass bottle floating in space, photorealistic, intricate details." \
--thinking high \
--show-thoughts \
--image-size 2K \
--output city_bottle.png
Parameter Reference
| Parameter | Description | Default |
|---|---|---|
--prompt | Text prompt (required) | - |
--model | Model ID | gemini-3.1-flash-image |
--output | Output file path | output.png |
--image-only | Return image only (no text description) | Off |
--aspect-ratio | Aspect ratio (e.g. 16:9 9:16 1:1) | 1:1 |
--image-size | Resolution (512/1K/2K/4K) | 1K |
--images | Reference image file list (space-separated, up to 14) | None |
--video | YouTube video URL | None |
--search | Enable Google Web Search | Off |
--image-search | Enable Google Image Search (3.1 Flash only) | Off |
--thinking | Thinking level minimal/high | minimal |
--show-thoughts | Save intermediate thought images | Off |
Model Selection Guide
| Scenario | Recommended Model |
|---|---|
| Everyday image generation and editing | gemini-3.1-flash-image (default) |
| Professional logos, commercial ads, complex layouts | gemini-3-pro-image |
| High-concurrency batch generation, lower quality requirements | gemini-2.5-flash-image |
| Requires Image Search / video input | gemini-3.1-flash-image (exclusive) |
For more parameter details, see references/models-and-params.md.
Notes
- All generated images contain invisible SynthID watermarks
- Transparent backgrounds are not supported; post-process if needed
--image-sizerequires uppercase K (1Kis correct,1kwill cause an error)- Multiple image outputs are automatically saved as
output_1.png,output_2.png, etc. - Comply with the Google Generative AI Use Policy
Related skills
Generate and edit images via Google's Nano Banana Pro model on WaveSpeed AI using text prompts.
Recommend suitable prompts from 26,000+ Nano Banana Pro image generation prompts based on user needs. Optimized for Nano Banana Pro (Gemini), but prompts als...
Generate images through the Nano Banana REST API and help agents integrate or operate the service safely. Use when a task involves text-to-image, image-to-im...
AI multi-image generation powered by CellCog via Nano Banana. 10-20 coherent images in one prompt, character consistency across scenes, production-grade composition. Nano Banana AI, Nano Banana Pro, Gemini image generation.
Use when the user wants to generate or edit images with Google's Nanobanana/Gemini image models using the official Gemini API shape, or when they need public...