Generate and edit images using Google Gemini image models via the nano-banana CLI. Use when the user asks to create, generate, make, or edit images with AI. Supports text-to-image, image editing, style transfer, and multi-image composition. Trigger on requests like "create an image", "generate a picture", "make me a logo", "edit this photo", "add X to this image".
npx skills add https://github.com/BlackBeltTechnology/pi-agent-dashboard --skill nano-banana-imagegen
Generate and edit images using Google's Gemini image models. This skill ships the
pi-nano-banana CLI (a TypeScript wrapper — no Python) that resolves the
GEMINI_API_KEY for you and delegates to @the-focus-ai/nano-banana.
GEMINI_API_KEY set via the environment or a gitignored .env in the projector package directory (the CLI resolves it automatically).
@the-focus-ai/nano-banana CLI is fetched via npx.Prefer the bundled pi-nano-banana bin (auto key resolution, output-dir creation):
# Generate a new image
pi-nano-banana "a serene mountain landscape at sunset"
# Edit an existing image
pi-nano-banana "add a hot air balloon to the sky" --file photo.jpg
# Specify output path
pi-nano-banana "a minimalist logo" --output logo.png
# Use a specific model / faster flash model
pi-nano-banana "detailed illustration" --model gemini-2.0-flash-exp
pi-nano-banana "a quick sketch" --flash
The raw CLI still works if you prefer it (npx @the-focus-ai/nano-banana "…").
For batch generation from code, import batchGenerate from
@blackbelt-technology/pi-dashboard-nano-banana/nano-banana.js.
Before generating, clarify:
Read references/prompting-guide.md for comprehensive guidance.
Key principles:
Example — Weak prompt:
"a cat"
Example — Strong prompt:
"A fluffy orange tabby cat curled up on a velvet armchair, soft afternoon sunlight streaming through a window, warm cozy interior, photorealistic style, shallow depth of field"
npx @the-focus-ai/nano-banana "your detailed prompt here"
Default output: output/generated-<timestamp>.png
If the result isn't right:
--file to modify the generated imagenpx @the-focus-ai/nano-banana "<prompt>"
npx @the-focus-ai/nano-banana "<edit instruction>" --file <input-image>
Edit instructions should describe the change:
| Option | Description |
|--------|-------------|
| --file <image> | Input image for editing |
| --output <path> | Custom output path |
| --model <name> | Specific Gemini model |
| --flash | Use gemini-2.0-flash (faster, simpler images) |
| --prompt-file <path> | Read prompt from file |
| --list-models | Show available models |
Ensure GEMINI_API_KEY is set:
export GEMINI_API_KEY="your-api-key-here"
Or create a .env file in your project:
GEMINI_API_KEY=your-api-key-here
| Problem | Solution |
|---------|----------|
| "No image in response" | Prompt may have triggered safety filters — rephrase |
| Poor quality results | Add more specific style guidance, use gemini-2.0-flash-exp |
| Image doesn't match description | Be more explicit about composition, add negative constraints |
Take blackbelttechnology/nano-banana-imagegen from the repository into ~/.claude/skills for personal
use, or into .claude/skills inside a project.
The agent identifies a skill by the name field in its header. Two skills with the
same name cannot sit side by side — one of them will be ignored.
The instructions reference npx.
Without those the skill loads but fails at the first command.