Skip to main content

Overview

nano-banana-pro-image-gen is a community-contributed open-source AI Agent Skill that lets you generate and edit images with a single natural language command in Codex CLI, OpenCode, Gemini CLI, GitHub Copilot, Cursor, Amp, and more. It calls the Nano Banana Pro model via APIYI — no complex setup needed, just install and go.
Project Info
  • 🔗 Source Code: github.com/wuchubuzai2018/expert-skills-hub
  • 🌐 Skill Page: skills.sh/wuchubuzai2018/expert-skills-hub/nano-banana-pro-image-gen
  • 👤 Author: wuchubuzai2018
  • ⭐ Community contributed

Why This Skill

One-Line Image Gen

Describe in natural language inside your AI coding assistant and instantly generate high-quality images without leaving your editor

Image Editing

Pass in existing images for editing, up to 14 reference images, enabling style transfer and content modification

Multi-Platform

Works with Codex CLI, OpenCode, Gemini CLI, GitHub Copilot, Cursor, Amp, and more

Flexible Output

10 aspect ratios + 3 resolution tiers (1K/2K/4K), covering everything from quick previews to high-res posters

Supported APIYI Models

Model NameModel IDUsageAPI Docs
Nano Banana Progemini-3-pro-image-previewText-to-image, image-to-imageView Docs
This Skill uses the Nano Banana Pro model. If you also want faster speed and lower cost with Nano Banana 2, check out the Nano Banana ComfyUI Nodes, which supports both models.

Quick Start: 3 Steps to Generate Images

1

Step 1: Get Your APIYI Key

  1. Visit APIYI Console to register/login
  2. Go to the Token section and generate a new API key
  3. Copy the key (starts with sk-)
New users get free trial credits, enough to experience Nano Banana image generation.
2

Step 2: Install the Skill

Run the following command in your terminal:
npx skills add https://github.com/wuchubuzai2018/expert-skills-hub --skill nano-banana-pro-image-gen
Requires Node.js. If not installed, visit nodejs.org to download. Python can be used as a fallback runtime.
3

Step 3: Configure API Key

Set the environment variable:
export APIYI_API_KEY="sk-your-apiyi-key"
Windows PowerShell users:
$env:APIYI_API_KEY="sk-your-apiyi-key"
Add the environment variable to your ~/.zshrc or ~/.bashrc to avoid setting it each time.
Setup complete! You can now use image generation directly in any Skills-compatible AI coding tool.

Hands-On Tutorial

Usage 1: Command-Line Text-to-Image

The most direct approach — enter a description in the terminal and generate an image.
node scripts/generate_image.js \
  -p "An astronaut cat floating in space, Earth in the background, digital art style" \
  -f "astronaut-cat.png" \
  -a 16:9 \
  -r 2K

Usage 2: Edit Existing Images

Pass in one or more reference images and describe the desired modification in natural language.
node scripts/generate_image.js \
  -p "Convert this photo to Studio Ghibli animation style, keep the character composition" \
  -i "photo.jpg" \
  -f "ghibli-style.png" \
  -r 2K
Supports multiple reference images (up to 14), automatically converted to Base64:
node scripts/generate_image.js \
  -p "Merge these elements into a poster" \
  -i "bg.jpg" -i "logo.png" -i "text.png" \
  -f "poster.png" \
  -a 3:4 \
  -r 4K

Usage 3: Inside AI Coding Assistants

After installing the Skill, use natural language commands in supported AI coding tools:
  • Codex CLI / OpenCode: “Generate a 16:9 cyberpunk cityscape wallpaper in 4K”
  • Cursor: “Generate a product logo, minimalist style, 1:1 ratio”
  • Gemini CLI: “Edit input.jpg, change the background to a sunset beach”
The AI assistant will automatically invoke the Skill to generate images.

Command Parameters

ParameterShortRequiredDescriptionExample
--prompt-pYesImage description or edit instruction"a cat"
--filename-fNoOutput file path (auto-generated if omitted)"output.png"
--aspect-ratio-aNoAspect ratio16:9
--resolution-rNoResolution (must be uppercase)1K, 2K, 4K
--input-image-iNoInput image path (can specify multiple, up to 14)"photo.jpg"
--key-kNoInline API Key (env var recommended)"sk-xxx"

Supported Aspect Ratios

1:1, 16:9, 9:16, 4:3, 3:4, 3:2, 2:3, 5:4, 4:5, 21:9

Resolution & Processing Time

ResolutionApprox. TimeBest For
1K~30 secondsQuick preview, testing
2K (default)1-4 minutesDaily use, social media
4KLongerHD posters, print materials

FAQ

Check the following:
  1. Node.js is installed (run node -v to confirm)
  2. Network connection is working
  3. If npx is unavailable, manually clone the repo:
git clone https://github.com/wuchubuzai2018/expert-skills-hub.git
Then copy the skills/nano-banana-pro-image-gen directory to your Skills folder.
Please verify:
  1. The APIYI_API_KEY environment variable is correctly set (starts with sk-)
  2. Your APIYI account has sufficient balance
  3. You can also test with the -k parameter to pass the key directly
Resolution must be uppercase: 1K, 2K, 4K. Lowercase 1k, 2k will not be recognized.
  • 4K resolution inherently requires longer processing (may exceed 5 minutes)
  • Use 1K resolution first to test prompts and composition
  • Switch to 2K or 4K for the final version once satisfied
Visit APIYI Console, register an account and generate a new key in the Token section. New users receive free trial credits.
Currently adapted for: Codex CLI, OpenCode, Gemini CLI, GitHub Copilot, Cursor, Amp. Any tool supporting the Skills protocol can use it.