$npx -y skills add github/awesome-copilot --skill nano-banana-pro-openrouterGenerate or edit images via OpenRouter with the Gemini 3 Pro Image model. Use for prompt-only image generation, image edits, and multi-image compositing; supports 1K/2K/4K output.
| 1 | # Nano Banana Pro OpenRouter |
| 2 | |
| 3 | ## Overview |
| 4 | |
| 5 | Generate or edit images with OpenRouter using the `google/gemini-3-pro-image-preview` model. Support prompt-only generation, single-image edits, and multi-image composition. |
| 6 | |
| 7 | ### Prompt-only generation |
| 8 | |
| 9 | ``` |
| 10 | uv run {baseDir}/scripts/generate_image.py \ |
| 11 | --prompt "A cinematic sunset over snow-capped mountains" \ |
| 12 | --filename sunset.png |
| 13 | ``` |
| 14 | |
| 15 | ### Edit a single image |
| 16 | |
| 17 | ``` |
| 18 | uv run {baseDir}/scripts/generate_image.py \ |
| 19 | --prompt "Replace the sky with a dramatic aurora" \ |
| 20 | --input-image input.jpg \ |
| 21 | --filename aurora.png |
| 22 | ``` |
| 23 | |
| 24 | ### Compose multiple images |
| 25 | |
| 26 | ``` |
| 27 | uv run {baseDir}/scripts/generate_image.py \ |
| 28 | --prompt "Combine the subjects into a single studio portrait" \ |
| 29 | --input-image face1.jpg \ |
| 30 | --input-image face2.jpg \ |
| 31 | --filename composite.png |
| 32 | ``` |
| 33 | |
| 34 | ## Resolution |
| 35 | |
| 36 | - Use `--resolution` with `1K`, `2K`, or `4K`. |
| 37 | - Default is `1K` if not specified. |
| 38 | |
| 39 | ## System prompt customization |
| 40 | |
| 41 | The skill reads an optional system prompt from `assets/SYSTEM_TEMPLATE`. This allows you to customize the image generation behavior without modifying code. |
| 42 | |
| 43 | ## Behavior and constraints |
| 44 | |
| 45 | - Accept up to 3 input images via repeated `--input-image`. |
| 46 | - `--filename` accepts relative paths (saves to current directory) or absolute paths. |
| 47 | - If multiple images are returned, append `-1`, `-2`, etc. to the filename. |
| 48 | - Print `MEDIA: <path>` for each saved image. Do not read images back into the response. |
| 49 | |
| 50 | ## Troubleshooting |
| 51 | |
| 52 | If the script exits non-zero, check stderr against these common blockers: |
| 53 | |
| 54 | | Symptom | Resolution | |
| 55 | |---------|------------| |
| 56 | | `OPENROUTER_API_KEY is not set` | Ask the user to set it. PowerShell: `$env:OPENROUTER_API_KEY = "sk-or-..."` / bash: `export OPENROUTER_API_KEY="sk-or-..."` | |
| 57 | | `uv: command not found` or not recognized | macOS/Linux: <code>curl -LsSf https://astral.sh/uv/install.sh | sh</code>. Windows: <code>powershell -ExecutionPolicy ByPass -c "irm https://astral.sh/uv/install.ps1 | iex"</code>. Then restart the terminal. | |
| 58 | | `AuthenticationError` / HTTP 401 | Key is invalid or has no credits. Verify at <https://openrouter.ai/settings/keys>. | |
| 59 | |
| 60 | For transient errors (HTTP 429, network timeouts), retry once after 30 seconds. Do not retry the same error more than twice — surface the issue to the user instead. |