# nanobanana > Generate and edit images using Google Gemini API (Nano Banana). Use when the user wants to create images, edit photos, generate illustrations for articles, or create visual content. Trigger phrases include "generate an image", "create a picture", "make an illustration", "edit this photo", or when visual content is needed for a project. - Author: Marco Kotrotsos - Repository: Kotrotsos/Content-Marketing - Version: 20251231092109 - Stars: 0 - Forks: 0 - Last Updated: 2026-02-07 - Source: https://github.com/Kotrotsos/Content-Marketing - Web: https://mule.run/skillshub/@@Kotrotsos/Content-Marketing~nanobanana:20251231092109 --- --- name: nanobanana description: Generate and edit images using Google Gemini API (Nano Banana). Use when the user wants to create images, edit photos, generate illustrations for articles, or create visual content. Trigger phrases include "generate an image", "create a picture", "make an illustration", "edit this photo", or when visual content is needed for a project. --- # Nanobanana: Gemini Image Generation ## Overview Nanobanana is a CLI tool for generating and editing images using Google's Gemini API. It supports text-to-image generation, image editing with reference images, and various aspect ratios and sizes. ## Requirements - Python 3.10+ - `google-genai` package - `Pillow` package - `GEMINI_API_KEY` or `GOOGLE_API_KEY` environment variable ## Installation ```bash # Install dependencies pip install google-genai Pillow # The CLI is located at: # ~/.claude/skills/nanobanana/scripts/nanobanana.py ``` ## Basic Usage ```bash # Generate an image from text nanobanana "A cat wearing a top hat in a library" # Edit an existing image nanobanana "Make this look like a watercolor painting" -i photo.jpg # Specify output location nanobanana "A sunset over mountains" -o images/sunset.png # Use specific aspect ratio and size nanobanana "A panoramic landscape" --aspect-ratio 16:9 --size 4K ``` ## CLI Options | Option | Short | Description | |--------|-------|-------------| | `prompt` | | Text prompt for image generation (required) | | `--input` | `-i` | Input image(s) for editing (can repeat, max 14) | | `--output` | `-o` | Output path (file or directory) | | `--aspect-ratio` | `-a` | Aspect ratio (default: 1:1) | | `--size` | `-s` | Image size: 1K, 2K, 4K (default: 2K) | | `--model` | `-m` | Model: flash (fast) or pro (quality, default) | | `--verbose` | `-v` | Verbose output | ## Aspect Ratios Available ratios: `1:1`, `2:3`, `3:2`, `3:4`, `4:3`, `4:5`, `5:4`, `9:16`, `16:9`, `21:9` ## Models - **pro** (default): `gemini-3-pro-image-preview` - Higher quality, better for professional use - **flash**: `gemini-2.5-flash-image` - Faster, good for quick iterations ## Examples for Articles ### Generate a hero image ```bash nanobanana "A person sitting alone on a park bench at dusk, contemplative mood, soft lighting, editorial photography style" --aspect-ratio 16:9 --size 4K -o article_hero.png ``` ### Create an illustration ```bash nanobanana "Abstract illustration of a brain with colorful neural connections, modern flat design, clean lines" --aspect-ratio 3:2 -o brain_illustration.png ``` ### Edit a photo for an article ```bash nanobanana "Convert this photo to a stylized illustration suitable for a magazine article" -i original_photo.jpg -o stylized.png ``` ### Combine multiple reference images ```bash nanobanana "Create a composite image showing these tools working together" -i tool1.png -i tool2.png -i tool3.png -o tools_composite.png ``` ## Integration with Other Skills Other skills can invoke nanobanana by running: ```bash python /Users/marcokotrotsos/.claude/skills/nanobanana/scripts/nanobanana.py "prompt" [options] ``` Or if added to PATH: ```bash nanobanana "prompt" [options] ``` ## Python API (for scripts) ```python import sys sys.path.insert(0, "/Users/marcokotrotsos/.claude/skills/nanobanana/scripts") from nanobanana import generate_image # Generate an image output_path = generate_image( prompt="A futuristic cityscape", input_images=None, # Optional: list of image paths output="output.png", # Optional: output path aspect_ratio="16:9", # Optional: aspect ratio size="2K", # Optional: 1K, 2K, 4K model="pro", # Optional: pro or flash verbose=True # Optional: show progress ) ``` ## Best Practices for Prompts 1. **Be descriptive**: Use detailed narratives rather than keyword lists 2. **Specify style**: Include artistic style, lighting, mood 3. **Consider composition**: Mention framing, perspective, focal points 4. **For articles**: Include "editorial", "magazine quality", or "professional photography" for polished results ## Limitations - Maximum 14 reference images (6 objects + 5 humans recommended) - All generated images include invisible SynthID watermarks - Some content restrictions apply (no harmful, explicit, or copyrighted content) ## Troubleshooting **No API key found** ```bash export GEMINI_API_KEY="your-api-key-here" ``` **Package not installed** ```bash pip install google-genai Pillow ``` **Image not generated** - Check prompt for restricted content - Try a simpler prompt - Use `--verbose` flag for more details