Nano banana pro

From aAAaqwq/AGI-Super-Team · View interactive version

Nano banana pro is an AI agent skill from the GitHub repository aAAaqwq/AGI-Super-Team. Generate/edit images with Nano Banana Pro (Gemini 3 Pro Image). Use for image create/modify requests incl. edits. Supports text-to-image + image-to-image; 1K/2K/4K; use --input-image.

How to use this skill

Skill file

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

Run scripts using absolute path (do NOT cd to skill directory first).

⚡ MANDATORY: Always optimize prompt first before generating!

Step 1: Optimize Prompt (required)

OPTIMIZED=$(uv run ~/.openclaw/agents/content/agent/skills/nano-banana-pro/scripts/optimize_prompt.py \
  --prompt "用户原始描述" \
  --style photo|illustration|anime|oil-painting|3d|pixel|cinematic|watercolor)

Step 2: Generate with optimized prompt

uv run ~/.openclaw/agents/content/agent/skills/nano-banana-pro/scripts/generate_image_boluobao.py \
  --prompt "$OPTIMIZED" --filename "output.png" [--resolution 1k|2k|4k] [--aspect-ratio 16:9]

Or using xingjiabiapi (primary):

uv run ~/.openclaw/agents/content/agent/skills/nano-banana-pro/scripts/generate_image.py \
  --prompt "$OPTIMIZED" --filename "output.png" [--resolution 1K|2K|4K] [--api-key KEY]

Edit existing image (skip optimizer):

uv run ~/.openclaw/agents/content/agent/skills/nano-banana-pro/scripts/generate_image.py \
  --prompt "editing instructions" --filename "output.png" --input-image "path/to/input.png"

Important: Always run from the user's current working directory.

Default Workflow (optimize → draft → iterate → final)

Goal: optimize prompt first, then fast iteration.

  1. Optimize: Run optimize_prompt.py to enhance user's description
  2. Draft (1K): Generate with optimized prompt at low res
  3. Iterate: Adjust prompt or re-optimize if needed
  4. Final (4K): Only when satisfied with the result
# Step 1: Optimize
OPTIMIZED=$(uv run ~/.openclaw/agents/content/agent/skills/nano-banana-pro/scripts/optimize_prompt.py -p "一只在樱花树下的猫" -s photo)

# Step 2: Draft
uv run ~/.openclaw/agents/content/agent/skills/nano-banana-pro/scripts/generate_image_boluobao.py -p "$OPTIMIZED" -f "draft.png" -r 1k

# Step 3: Final (after approval)
uv run ~/.openclaw/agents/content/agent/skills/nano-banana-pro/scripts/generate_image_boluobao.py -p "$OPTIMIZED" -f "final.png" -r 4k

Resolution Options

The Gemini 3 Pro Image API supports three resolutions (uppercase K required):

Map user requests to API parameters:

API Key

Primary (xingjiabiapi / Google Gemini):

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

Fallback (Boluobao 菠萝包):

  1. --api-key argument
  2. BOLUOBAO_API_KEY environment variable
  3. pass show api/boluobao

If the primary provider fails (quota/403/timeout), automatically switch to Boluobao fallback.

Fallback: Boluobao Provider

When xingjiabiapi is unavailable, use the Boluobao script instead:

uv run ~/.openclaw/skills/nano-banana-pro/scripts/generate_image_boluobao.py \
  --prompt "your description" \
  --filename "output.jpg" \
  --resolution 2k \
  --aspect-ratio 16:9

Boluobao-specific options:

Decision logic:

  1. Try primary (xingjiabiapi) first
  2. If fails → use generate_image_boluobao.py with same prompt/resolution

Preflight + Common Failures (fast fixes)

Filename Generation

Generate filenames with the pattern: yyyy-mm-dd-hh-mm-ss-name.png

Format: {timestamp}-{descriptive-name}.png

Examples:

Image Editing

When the user wants to modify an existing image:

  1. Check if they provide an image path or reference an image in the current directory
  2. Use --input-image parameter with the path to the image
  3. The prompt should contain editing instructions (e.g., "make the sky more dramatic", "remove the person", "change to cartoon style")
  4. Common editing tasks: add/remove elements, change style, adjust colors, blur background, etc.

Prompt Handling

For generation: Pass user's image description as-is to --prompt. Only rework if clearly insufficient.

For editing: Pass editing instructions in --prompt (e.g., "add a rainbow in the sky", "make it look like a watercolor painting")

Preserve user's creative intent in both cases.

Prompt Templates (high hit-rate)

Use templates when the user is vague or when edits must be precise.

Output

Examples

Generate new image:

uv run ~/.codex/skills/nano-banana-pro/scripts/generate_image.py --prompt "A serene Japanese garden with cherry blossoms" --filename "2025-11-23-14-23-05-japanese-garden.png" --resolution 4K

Edit existing image:

uv run ~/.codex/skills/nano-banana-pro/scripts/generate_image.py --prompt "make the sky more dramatic with storm clouds" --filename "2025-11-23-14-25-30-dramatic-sky.png" --input-image "original-photo.jpg" --resolution 2K
Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.