Install
openclaw skills install dyagil-nano-bananaGenerate or edit images using Google's "Nano Banana" image models (Gemini 2.5 / 3.x image previews). Use this when the user explicitly asks for Gemini / Nano Banana / Nano Banana Pro, wants iterative image edits with reference inputs, or wants a different (often cheaper) image stack than the built-in image generation tool.
openclaw skills install dyagil-nano-bananaA CLI skill for generating and editing images using Google's Gemini image models, marketed as "Nano Banana" and "Nano Banana Pro".
Use this skill when the user explicitly asks for:
For generic "make me an image" requests with no provider hint, prefer your platform's built-in image generation unless the user has set Nano Banana as the default.
| Nickname | Model ID | Notes |
|---|---|---|
| Nano Banana Pro ← default | gemini-3-pro-image-preview | Highest quality, slower, multi-image edits |
| Nano Banana 3.1 Flash | gemini-3.1-flash-image-preview | Faster, newer, good for iteration |
| Nano Banana (classic) | gemini-2.5-flash-image | Original, cheapest, still solid |
If unspecified, default to Pro.
Store the Gemini API key at ~/.openclaw/credentials/google/gemini_api_key (chmod 600).
Load it before invoking the CLI:
export GEMINI_API_KEY=$(cat ~/.openclaw/credentials/google/gemini_api_key)
⚠️ Never log or echo the key. Never paste it into chat. If rotated, replace the file contents.
Get a key at: https://aistudio.google.com/apikey
Binary: ~/bin/nano-banana (Node.js). Source lives at <your-tools-dir>/nano-banana.js.
~/bin/nano-banana "a person eating a red apple, photorealistic, warm light"
# Writes: ~/.../nano-banana-output/YYYY-MM-DD_HHMMSS.png
# Prints the absolute path on success.
~/bin/nano-banana --model pro "logo for a modern insurance agency, olive green"
~/bin/nano-banana --model flash --aspect 16:9 "morning marathon in a coastal city"
~/bin/nano-banana --model classic --count 4 "red pepper on a wooden table"
~/bin/nano-banana --aspect 1:1 --out /tmp/x.png "..."
Flags:
--model pro|flash|classic|<full-id> (default: pro)--aspect 1:1|4:3|3:4|16:9|9:16|3:2|2:3 (best-effort prompt hint)--count N (1–4, default 1)--out <path> (only valid with --count 1)--out-dir <path> (default: <tools-dir>/nano-banana-output/)--quiet (print only resulting paths, one per line)~/bin/nano-banana --ref photo.jpg "put a red baseball cap on the person"
~/bin/nano-banana --ref a.png --ref b.png "merge the two images, library background"
pro. "Fast" / "Flash" → flash. Otherwise → pro.exec. Capture the output path.MEDIA:<path> on its own line in the reply (or use your platform's attachment convention).User: "Draw a person eating a red apple."
~/bin/nano-banana --aspect 4:3 \
"A realistic portrait of a person taking a bite from a bright red apple, natural daylight, soft shadows, sharp focus, casual modern clothing, slight motion blur on the hand, warm color grading"
# → /home/<user>/.../nano-banana-output/2026-05-11_141815.png
Reply:
Here's the apple shot — Nano Banana Pro MEDIA:/home/<user>/.../nano-banana-output/2026-05-11_141815.png
Under the hood, the CLI POSTs to:
POST https://generativelanguage.googleapis.com/v1beta/models/{model}:generateContent?key={KEY}
Body:
{
"contents": [{"role": "user", "parts": [{"text": "<prompt>"}]}],
"generationConfig": {
"responseModalities": ["IMAGE", "TEXT"],
"candidateCount": <N>
}
}
Response candidates contain parts[].inlineData.{mimeType, data} (base64). The CLI decodes and writes to disk.
For reference images, additional parts with inlineData are prepended before the text prompt.
PERMISSION_DENIED / API_KEY_INVALID → key rotated. Update the credentials file.RESOURCE_EXHAUSTED → free-tier quota hit. Wait, or switch to flash / classic.SAFETY block → response has promptFeedback.blockReason and no image. Rewrite the prompt and retry.aspectRatio field on image models, so the CLI appends a textual hint.<your-skills-dir>/nano-banana/
SKILL.md ← this file
<your-tools-dir>/
nano-banana.js ← the CLI implementation
nano-banana-output/ ← generated images
~/bin/nano-banana ← symlink to nano-banana.js
~/.openclaw/credentials/google/
gemini_api_key ← the secret (chmod 600)