SKILL.md
readonlyread-only
name
nano-banana-pro-openrouter
description
透過 OpenRouter 使用 Gemini 3 Pro Image 模型生成或編輯圖片。支援純提示詞生成、圖片編輯及多圖合成;輸出解析度可選 1K/2K/4K。
Nano Banana Pro OpenRouter
概述
使用 OpenRouter 搭配 google/gemini-3-pro-image-preview 模型生成或編輯圖片。支援純提示詞生成、單張圖片編輯以及多張圖片合成。
純提示詞生成
uv run {baseDir}/scripts/generate_image.py \
--prompt "A cinematic sunset over snow-capped mountains" \
--filename sunset.png
編輯單張圖片
uv run {baseDir}/scripts/generate_image.py \
--prompt "Replace the sky with a dramatic aurora" \
--input-image input.jpg \
--filename aurora.png
合成多張圖片
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搭配1K、2K或4K。 - 若未指定,預設為
1K。
系統提示詞自訂
此技能會從 assets/SYSTEM_TEMPLATE 讀取選用的系統提示詞。這讓您無需修改程式碼即可自訂圖片生成行為。
行為與限制
- 最多接受 3 張輸入圖片,透過重複
--input-image指定。 --filename接受相對路徑(儲存至目前目錄)或絕對路徑。- 若回傳多張圖片,則在檔名後附加
-1、-2等。 - 每張儲存的圖片會輸出
MEDIA: <path>。請勿將圖片讀回回應中。
疑難排解
若腳本以非零狀態結束,請檢查 stderr 中常見的阻礙因素:
| 症狀 | 解決方式 |
|---|---|
OPENROUTER_API_KEY is not set |
請使用者設定。PowerShell:$env:OPENROUTER_API_KEY = "sk-or-..." / bash:export OPENROUTER_API_KEY="sk-or-..." |
uv: command not found 或無法識別 |
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>。然後重新啟動終端機。 |
AuthenticationError / HTTP 401 |
金鑰無效或額度不足。請至 https://openrouter.ai/settings/keys 確認。 |
對於暫時性錯誤(HTTP 429、網路逾時),請在 30 秒後重試一次。相同錯誤請勿重試超過兩次——應將問題回報給使用者。






