feat(skills): add nano-banana-pro-openrouter skill with image generation capabilities

This commit is contained in:
nblog
2026-02-09 16:59:06 +08:00
parent ef4aa0b2bc
commit 5efb7329a3
3 changed files with 8 additions and 5 deletions

View File

@@ -1,6 +1,6 @@
---
name: nano-banana-pro-openrouter
description: '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, saves results to the current working directory, and prints MEDIA lines.'
description: '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.'
metadata:
emoji: 🍌
requires:
@@ -16,7 +16,7 @@ metadata:
## 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. Save results to the current working directory and output MEDIA lines for easy attachment.
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
@@ -58,5 +58,6 @@ The skill reads an optional system prompt from `assets/SYSTEM_TEMPLATE`. This al
- Read the API key from `OPENROUTER_API_KEY` (no CLI flag).
- Accept up to 3 input images via repeated `--input-image`.
- Save output in the current working directory. If multiple images are returned, append `-1`, `-2`, etc.
- `--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.

View File

@@ -90,8 +90,9 @@ def resolve_output_paths(filename: str, image_count: int, mime: str):
suffix = MIME_TO_EXT.get(mime, ".png")
output_path = output_path.with_suffix(suffix)
if output_path.parent and not output_path.parent.exists():
raise SystemExit(f"Output directory does not exist: {output_path.parent}")
# Create parent directory if it doesn't exist (for absolute paths)
if output_path.parent and str(output_path.parent) != '.':
output_path.parent.mkdir(parents=True, exist_ok=True)
if image_count == 1:
return [output_path]