openrouter-nano-banana

star 0

Generate or edit images via OpenRouter Nano Banana 2.

cs-qyzhang By cs-qyzhang schedule Updated 3/23/2026

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)

  1. Check whether OPENROUTER_API_KEY is already present in environment variables.
  2. If not present, check whether {baseDir}/.env exists.
  3. If {baseDir}/.env does not exist, copy {baseDir}/.env.example to {baseDir}/.env.
  4. Remind the user to fill OPENROUTER_API_KEY in {baseDir}/.env.
  5. Provide the exact file path {baseDir}/.env to 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-dir to 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_KEY env var
  • .env file at {baseDir}/.env (auto-loaded by the script)
  • Or set skills."nano-banana-pro".apiKey / skills."nano-banana-pro".env.OPENROUTER_API_KEY in ~/.openclaw/openclaw.json

Notes

  • Model default: google/gemini-3.1-flash-image-preview (Nano Banana 2).
  • If no key is found and {baseDir}/.env.example exists, the script auto-creates {baseDir}/.env and 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 ratios 1: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 / -o to 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.
Install via CLI
npx skills add https://github.com/cs-qyzhang/openrouter-nano-banana-skill --skill openrouter-nano-banana
Repository Details
star Stars 0
call_split Forks 0
navigation Branch main
article Path SKILL.md
More from Creator