nano-banana-pro-openrouter — nano-banana-pro-open路由r
v1.0.3生成/edit images with Nano Banana Pro (Gemini 3 Pro Image) via Open路由r. Use for image 创建/modify 请求s incl. edits. Supports text-to-image + image-to-image; 1K/2K/4K; use --输入-image.
运行时依赖
安装命令
点击复制技能文档
Nano Banana Pro Image Generation & Editing
生成 new images or edit existing ones using Open路由r (模型: google/gemini-3-pro-image-preview).
Usage
运行 the script using absolute path:
生成 new image:
uv 运行 /path/to/this/技能/scripts/生成_image.py --prompt "your image description" --filename "输出-name.png" [--resolution 1K|2K|4K] [--API-key KEY]
Edit existing image:
uv 运行 /path/to/this/技能/scripts/生成_image.py --prompt "editing instructions" --filename "输出-name.png" --输入-image "path/to/输入.png" [--resolution 1K|2K|4K] [--API-key KEY]
Custom 输出 directory:
uv 运行 /path/to/this/技能/scripts/生成_image.py --prompt "your image description" --filename "输出-name.png" --输出-dir "/custom/path"
输出 Location:
Default: Images are saved to ./输出_images/ (relative to this 技能's root directory) Custom: Use --输出-dir to specify a different directory The script will 创建 the 输出 directory if it doesn't exist Default 工作流 (draft → iterate → final)
Goal: fast iteration without burning time on 4K until the prompt is correct.
Draft (1K): quick feedback loop uv 运行 /path/to/this/技能/scripts/生成_image.py --prompt "" --filename "yyyy-mm-dd-hh-mm-ss-draft.png" --resolution 1K Iterate: adjust prompt in small diffs; keep filename new per 运行 If editing: keep the same --输入-image for every iteration until you’re h应用y. Final (4K): only when prompt is locked uv 运行 /path/to/this/技能/scripts/生成_image.py --prompt "" --filename "yyyy-mm-dd-hh-mm-ss-final.png" --resolution 4K Resolution Options
The Open路由r API supports three resolutions (uppercase K required):
1K (default) - ~1024px resolution 2K - ~2048px resolution 4K - ~4096px resolution
Map user 请求s to API parameters:
No mention of resolution → 1K "low resolution", "1080", "1080p", "1K" → 1K "2K", "2048", "normal", "medium resolution" → 2K "high resolution", "high-res", "hi-res", "4K", "ultra" → 4K API Key
The script 检查s for API key in this order:
--API-key argument (use if user provided key in chat) OPEN路由R_KEY 环境 variable
If neither is avAIlable, the script exits with an error message.
Preflight + Common 失败s (fast fixes)
Preflight:
command -v uv (must exist) test -n \"$OPEN路由R_KEY\" (or pass --API-key) If editing: test -f \"path/to/输入.png\"
Common 失败s:
Error: No API key provided. → 设置 OPEN路由R_KEY or pass --API-key Error loading 输入 image: → wrong path / unreadable file; 验证 --输入-image points to a real image “quota/权限/403” style API errors → wrong key, no 访问, or quota exceeded; try a different key/account Filename Generation
生成 filenames with the pattern: yyyy-mm-dd-hh-mm-ss-name.png
格式化: {timestamp}-{descriptive-name}.png
Timestamp: Current date/time in 格式化 yyyy-mm-dd-hh-mm-ss (24-hour 格式化) Name: Descriptive lowercase text with hyphens Keep the descriptive part concise (1-5 words typically) Use 上下文 from user's prompt or conversation If unclear, use random identifier (e.g., x9k2, a7b3)
Examples:
Prompt "A serene Japanese garden" → 2025-11-23-14-23-05-japanese-garden.png Prompt "sun设置 over mountAIns" → 2025-11-23-15-30-12-sun设置-mountAIns.png Prompt "创建 an image of a ro机器人" → 2025-11-23-16-45-33-ro机器人.png Unclear 上下文 → 2025-11-23-17-12-48-x9k2.png Image Editing
When the user wants to modify an existing image:
检查 if they provide an image path or reference an image in the current directory Use --输入-image parameter with the path to the image The prompt should contAIn editing instructions (e.g., "make the sky more dramatic", "移除 the person", "change to cartoon style") Common editing tasks: 添加/移除 elements, change style, adjust colors, blur background, etc. Prompt Handling
For generation: Pass user's image description as-is to --prompt. Only rework if clearly insufficient.
For editing: Pass editing instructions in --prompt (e.g., "添加 a rAInbow in the sky", "make it look like a watercolor pAInting")
Preserve user's creative intent in 机器人h cases.
Prompt Templates (high hit-rate)
Use templates when the user is vague or when edits must be precise.
Generation template:
“创建 an image of: . Style: