
Nano Banana Pro
Generate or edit PNG images from text (and optional input images) using Google’s Nano Banana Pro / Gemini 3 Pro Image API via a uv-run Python script.
Overview
Nano Banana Pro is an agent skill most often used in Build (also Launch distribution, Grow content) that generates images through Google’s Gemini 3 Pro Image API from a uv-run Python script.
Install
npx skills add https://github.com/intellectronica/agent-skills --skill nano-banana-proWhat is this skill?
- CLI script generate_image.py run with uv and google-genai plus Pillow dependencies
- Resolutions 1K, 2K, or 4K selectable via --resolution
- Optional --input-image path for edit/modify flows on existing assets
- API key via --api-key or GEMINI_API_KEY environment variable
- Required --prompt and --filename for deterministic artifact naming
- Output resolutions: 1K, 2K, and 4K
- Python ≥3.10 with google-genai and pillow dependencies via uv script metadata
Adoption & trust: 2.5k installs on skills.sh; 270 GitHub stars; 1/3 security scanners passed (skills.sh audits).
What problem does it solve?
You need on-brand or product imagery fast but do not want to manually use a separate image UI for every agent-driven content task.
Who is it for?
Solo builders automating blog heroes, app-store shots, or concept art inside Claude Code/Cursor workflows with a Gemini API key and uv installed.
Skip if: Teams needing video, vector brand kits, or guaranteed rights-managed stock without reviewing Google API terms and content policy themselves.
When should I use this skill?
When you need a new or edited raster image from a text prompt (and optional input image) using the Nano Banana Pro Gemini image API.
What do I get? / Deliverables
A PNG (or chosen output file) is written locally from your prompt, with optional input-image editing and 1K–4K resolution control.
- Image file at the specified --filename path
- Repeatable CLI invocation recordable in agent task logs
Recommended Skills
Journey fit
Spans multiple journey phases - primary shelf plus alternate fits below.
Build/integrations is the canonical shelf because the skill wires a third-party generative API into the repo with keys, scripts, and local file output. It is an external API integration skill—not a full design system—meant to be invoked from agent workflows during product work.
Where it fits
Generate a hero illustration for a smoke-test landing page before committing to a designer.
Wire generate_image.py into an agent workflow that emits filenames into the marketing folder.
Produce multiple 2K assets for social posts and store screenshots from the same prompt template.
How it compares
Scripted Gemini image API integration, not an in-editor Figma or Midjourney marketplace plugin.
Common Questions / FAQ
Who is nano-banana-pro for?
Indie builders and agent users who want programmatic image generation from prompts (and optional reference images) using Google GenAI from the terminal.
When should I use nano-banana-pro?
Use it in build when wiring generative assets into the repo, at launch when creating distribution visuals, and in grow when producing content images; validate landing pages can use it for quick hero mocks.
Is nano-banana-pro safe to install?
See the Security Audits panel on this Prism page; you must supply GEMINI_API_KEY or --api-key, which counts as a secret—never commit keys to git.
SKILL.md
READMESKILL.md - Nano Banana Pro
#!/usr/bin/env python3 # /// script # requires-python = ">=3.10" # dependencies = [ # "google-genai>=1.0.0", # "pillow>=10.0.0", # ] # /// """ Generate images using Google's Nano Banana Pro (Gemini 3 Pro Image) API. Usage: uv run generate_image.py --prompt "your image description" --filename "output.png" [--resolution 1K|2K|4K] [--api-key KEY] """ import argparse import os import sys from pathlib import Path def get_api_key(provided_key: str | None) -> str | None: """Get API key from argument first, then environment.""" if provided_key: return provided_key return os.environ.get("GEMINI_API_KEY") def main(): parser = argparse.ArgumentParser( description="Generate images using Nano Banana Pro (Gemini 3 Pro Image)" ) parser.add_argument( "--prompt", "-p", required=True, help="Image description/prompt" ) parser.add_argument( "--filename", "-f", required=True, help="Output filename (e.g., sunset-mountains.png)" ) parser.add_argument( "--input-image", "-i", help="Optional input image path for editing/modification" ) parser.add_argument( "--resolution", "-r", choices=["1K", "2K", "4K"], default="1K", help="Output resolution: 1K (default), 2K, or 4K" ) parser.add_argument( "--api-key", "-k", help="Gemini API key (overrides GEMINI_API_KEY env var)" ) args = parser.parse_args() # Get API key api_key = get_api_key(args.api_key) if not api_key: print("Error: No API key provided.", file=sys.stderr) print("Please either:", file=sys.stderr) print(" 1. Provide --api-key argument", file=sys.stderr) print(" 2. Set GEMINI_API_KEY environment variable", file=sys.stderr) sys.exit(1) # Import here after checking API key to avoid slow import on error from google import genai from google.genai import types from PIL import Image as PILImage # Initialise client client = genai.Client(api_key=api_key) # Set up output path output_path = Path(args.filename) output_path.parent.mkdir(parents=True, exist_ok=True) # Load input image if provided input_image = None output_resolution = args.resolution if args.input_image: try: input_image = PILImage.open(args.input_image) print(f"Loaded input image: {args.input_image}") # Auto-detect resolution if not explicitly set by user if args.resolution == "1K": # Default value # Map input image size to resolution width, height = input_image.size max_dim = max(width, height) if max_dim >= 3000: output_resolution = "4K" elif max_dim >= 1500: output_resolution = "2K" else: output_resolution = "1K" print(f"Auto-detected resolution: {output_resolution} (from input {width}x{height})") except Exception as e: print(f"Error loading input image: {e}", file=sys.stderr) sys.exit(1) # Build contents (image first if editing, prompt only if generating) if input_image: contents = [input_image, args.prompt] print(f"Editing image with resolution {output_resolution}...") else: contents = args.prompt print(f"Generating image with resolution {output_resolution}...") try: response = client.models.generate_content( model="gemini-3-pro-image-preview", contents=contents, config=types.GenerateContentConfig( response_modalities=["TEXT", "IMAGE"], image_config=types.ImageConfig( image_size=output_resolution ) ) ) # Process response and convert to PNG image_saved = False