🍌

Nano Banana Pro

Verified

by steipete

AI image generation and editing powered by Google Gemini 3 Pro. Supports text-to-image generation and image editing with 1K/2K/4K resolution options. Uses a draft-iterate-final workflow for efficient prompt refinement. Requires your own Gemini API key.

imagegenerationgeminiaicreativeediting
View on GitHub

Nano Banana Pro Image Generation & Editing

Generate new images or edit existing ones using Google's Nano Banana Pro API (Gemini 3 Pro Image).

Usage

Generate new image:

uv run ~/.codex/skills/nano-banana-pro/scripts/generate_image.py --prompt "your image description" --filename "output-name.png" [--resolution 1K|2K|4K] [--api-key KEY]

Edit existing image:

uv run ~/.codex/skills/nano-banana-pro/scripts/generate_image.py --prompt "editing instructions" --filename "output-name.png" --input-image "path/to/input.png" [--resolution 1K|2K|4K] [--api-key KEY]

Default Workflow (draft -> iterate -> final)

  • Draft (1K): quick feedback loop
  • Iterate: adjust prompt, keep filename new per run
  • Final (4K): only when prompt is locked

Resolution Options

  • 1K (default) - ~1024px resolution
  • 2K - ~2048px resolution
  • 4K - ~4096px resolution

API Key

The script checks for API key in this order:

  1. --api-key argument
  2. GEMINI_API_KEY environment variable

Prompt Handling

For generation: Pass user's image description as-is to --prompt.

For editing: Pass editing instructions in --prompt (e.g., "add a rainbow in the sky").

Prompt Templates

  • Generation: "Create an image of: <subject>. Style: <style>. Composition: <camera/shot>. Lighting: <lighting>. Background: <background>."
  • Editing: "Change ONLY: <single change>. Keep identical: subject, composition, pose, lighting, color palette, background, text, and overall style."

Filename Generation

Pattern: yyyy-mm-dd-hh-mm-ss-name.png

Examples:

  • "A serene Japanese garden" -> 2025-11-23-14-23-05-japanese-garden.png
  • "sunset over mountains" -> 2025-11-23-15-30-12-sunset-mountains.png