name: openrouter-nano-banana description: Generate or edit images via OpenRouter Nano Banana 2. homepage: https://github.com/cs-qyzhang/openrouter-nano-banana-skill metadata: { "openclaw": { "emoji": "🍌", "requires": { "bins": ["python3"], "env": ["OPENROUTER_API_KEY"] }, "primaryEnv": "OPENROUTER_API_KEY" }
}
Nano Banana 2 via OpenRouter
Use the bundled script to generate or edit images.
Agent startup checklist (run this before generation/editing every time)
- Check whether
OPENROUTER_API_KEYis already present in environment variables. - If not present, check whether
{baseDir}/.envexists. - If
{baseDir}/.envdoes not exist, copy{baseDir}/.env.exampleto{baseDir}/.env. - Remind the user to fill
OPENROUTER_API_KEYin{baseDir}/.env. - Provide the exact file path
{baseDir}/.envto the user so they can edit it.
Generate
python3 {baseDir}/scripts/generate_image.py --prompt "your image description" --filename "output.png" --resolution 1K
Default output directory:
~/.openclaw/workspace/generated-images/. Use--output-dirto change:python3 {baseDir}/scripts/generate_image.py --prompt "description" --filename "output.png" --output-dir ./my-images
Edit (single image)
python3 {baseDir}/scripts/generate_image.py --prompt "edit instructions" --filename "output.png" -i "/path/in.png" --resolution 2K
Multi-image composition (up to 14 images)
python3 {baseDir}/scripts/generate_image.py --prompt "combine these into one scene" --filename "output.png" -i img1.png -i img2.png -i img3.png
API key
OPENROUTER_API_KEYenv var.envfile at{baseDir}/.env(auto-loaded by the script)- Or set
skills."nano-banana-pro".apiKey/skills."nano-banana-pro".env.OPENROUTER_API_KEYin~/.openclaw/openclaw.json
Notes
- Model default:
google/gemini-3.1-flash-image-preview(Nano Banana 2). - If no key is found and
{baseDir}/.env.exampleexists, the script auto-creates{baseDir}/.envand asks the user to fill it. - Resolutions:
1K(default),2K,4K. Use--resolution/-r. - Aspect ratios:
1:1(default),2:3,3:2,3:4,4:3,4:5,5:4,9:16,16:9,21:9, and extended ratios1:4,4:1,1:8,8:1(gemini only). Use--aspect-ratio/-a. - Default output directory:
~/.openclaw/workspace/generated-images/(auto-created if not exists). Use--output-dir/-oto customize. - Use timestamps in filenames:
yyyy-mm-dd-hh-mm-ss-name.png. - The script prints a
MEDIA:line for OpenClaw to auto-attach on supported chat providers. - Do not read the image back; report the saved path only.