Catalog
github/nano-banana-pro-openrouter

github

nano-banana-pro-openrouter

Generate 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.

global
emoji:๐ŸŒ
primaryEnv:OPENROUTER_API_KEY
New~618
v1.0Saved Jul 12, 2026

Nano Banana Pro OpenRouter

Overview

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.

Prompt-only generation

uv run {baseDir}/scripts/generate_image.py \
  --prompt "A cinematic sunset over snow-capped mountains" \
  --filename sunset.png

Edit a single image

uv run {baseDir}/scripts/generate_image.py \
  --prompt "Replace the sky with a dramatic aurora" \
  --input-image input.jpg \
  --filename aurora.png

Compose multiple images

uv run {baseDir}/scripts/generate_image.py \
  --prompt "Combine the subjects into a single studio portrait" \
  --input-image face1.jpg \
  --input-image face2.jpg \
  --filename composite.png

Resolution

  • Use --resolution with 1K, 2K, or 4K.
  • Default is 1K if not specified.

System prompt customization

The skill reads an optional system prompt from assets/SYSTEM_TEMPLATE. This allows you to customize the image generation behavior without modifying code.

Behavior and constraints

  • Accept up to 3 input images via repeated --input-image.
  • --filename accepts relative paths (saves to current directory) or absolute paths.
  • If multiple images are returned, append -1, -2, etc. to the filename.
  • Print MEDIA: <path> for each saved image. Do not read images back into the response.

Troubleshooting

If the script exits non-zero, check stderr against these common blockers:

Symptom Resolution
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-..."
uv: command not found or not recognized macOS/Linux: curl -LsSf https://astral.sh/uv/install.sh | sh. Windows: powershell -ExecutionPolicy ByPass -c "irm https://astral.sh/uv/install.ps1 | iex". Then restart the terminal.
AuthenticationError / HTTP 401 Key is invalid or has no credits. Verify at https://openrouter.ai/settings/keys.

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.

Files3
3 files ยท 8.0 KB

Select a file to preview

Overall Score

78/100

Grade

B

Good

Safety

75

Quality

82

Clarity

79

Completeness

75

Summary

A skill for generating and editing images via OpenRouter's Gemini 3 Pro Image model. It runs a Python script that accepts prompts and optional input images, communicates with the OpenRouter API using environment-based credentials, and saves generated/edited images to disk. Supports resolution control (1K/2K/4K), multi-image composition, and optional system prompt customization.

Static Analysis Findings

1 finding

Patterns detected by deterministic static analysis before AI scoring. Hover over any finding code for detailed information and remediation guidance.

Remote Code Execution
SEC-031Script Download

Dynamic script download for execution

SKILL.mdcurl -LsSf https://astral.sh/uv/install.sh &#124; sh</code>. Windows: <code>powershell -ExecutionPolicy ByPass -c "irm h...

Detected Capabilities

shell execution (uv run)file write (image output)environment variable read (API key)API request (OpenRouter)file read (input images, system template)base64 encoding/decodingdirectory creation

Trigger Keywords

Phrases that MCP clients use to match this skill to user intent.

generate images openrouteredit images geminiimage compositionprompt to imagemulti-image editing

Risk Signals

WARNING

curl piped to shell for uv installation

SKILL.md | Troubleshooting section
INFO

Environment variable OPENROUTER_API_KEY read from environment

scripts/generate_image.py | require_api_key()
INFO

Outbound API request to openrouter.ai

scripts/generate_image.py | client.chat.completions.create()
INFO

File write to user-controlled path (--filename)

scripts/generate_image.py | resolve_output_path() and output_path.write_bytes()
INFO

Directory creation with mkdir(parents=True, exist_ok=True)

scripts/generate_image.py | line ~138

Referenced Domains

External domains referenced in skill content, detected by static analysis.

astral.shopenrouter.ai

Use Cases

  • Generate images from text prompts using Gemini 3
  • Edit or transform existing images via prompts
  • Composite multiple images into a single result
  • Control output resolution for different use cases
  • Customize image generation behavior with system prompts

Quality Notes

  • Skill clearly documents three primary use cases with concrete CLI examples
  • Error handling is comprehensive: validates API key, input image limits, path existence, MIME type mismatches, and base64 decoding failures
  • Behavior constraints are explicit: max 3 images, filename handling rules, automatic numbering for multiple outputs, MEDIA output format
  • Troubleshooting table covers common failure modes (missing API key, missing uv, 401 auth errors, transient failures) with clear resolutions
  • Script uses type hints and clear variable names for readability
  • System prompt customization is optional and gracefully handles missing/empty files
  • Good separation of concerns: path resolution, image encoding, API communication are distinct functions
  • Minor: pip-installable dependencies handled via uv inline script block; no external build step required
Model: claude-haiku-4-5-20251001Analyzed: Jul 12, 2026

Reviews

Add this skill to your library to leave a review.

No reviews yet

Be the first to share your experience.

Use github/nano-banana-pro-openrouter in your dev environment

Command Palette

Search for a command to run...