nano-banana-pro by steipete/agent-scripts
npx skills add https://github.com/steipete/agent-scripts --skill nano-banana-pro使用 Google 的 Nano Banana Pro API (Gemini 3 Pro Image) 生成新图像或编辑现有图像。
使用绝对路径运行脚本(请勿先切换到技能目录):
生成新图像:
uv run ~/.codex/skills/nano-banana-pro/scripts/generate_image.py --prompt "your image description" --filename "output-name.png" [--resolution 1K|2K|4K] [--api-key KEY]
编辑现有图像:
uv run ~/.codex/skills/nano-banana-pro/scripts/generate_image.py --prompt "editing instructions" --filename "output-name.png" --input-image "path/to/input.png" [--resolution 1K|2K|4K] [--api-key KEY]
重要提示: 始终从用户的当前工作目录运行,以便图像保存在用户工作的地方,而不是技能目录中。
目标:快速迭代,在提示词确定之前不浪费时间在 4K 分辨率上。
uv run ~/.codex/skills/nano-banana-pro/scripts/generate_image.py --prompt "<draft prompt>" --filename "yyyy-mm-dd-hh-mm-ss-draft.png" --resolution 1K广告位招租
在这里展示您的产品或服务
触达数万 AI 开发者,精准高效
--input-image。uv run ~/.codex/skills/nano-banana-pro/scripts/generate_image.py --prompt "<final prompt>" --filename "yyyy-mm-dd-hh-mm-ss-final.png" --resolution 4KGemini 3 Pro Image API 支持三种分辨率(必须使用大写 K):
将用户请求映射到 API 参数:
1K1K2K4K脚本按以下顺序检查 API 密钥:
--api-key 参数(如果用户在聊天中提供了密钥则使用)GEMINI_API_KEY 环境变量如果两者都不可用,脚本将退出并显示错误信息。
预检:
command -v uv (必须存在)test -n \"$GEMINI_API_KEY\" (或传递 --api-key)test -f \"path/to/input.png\"常见故障:
Error: No API key provided. → 设置 GEMINI_API_KEY 或传递 --api-keyError loading input image: → 路径错误 / 文件不可读;验证 --input-image 指向真实的图像文件使用以下模式生成文件名:yyyy-mm-dd-hh-mm-ss-name.png
格式: {时间戳}-{描述性名称}.png
yyyy-mm-dd-hh-mm-ss (24 小时制)x9k2, a7b3)示例:
2025-11-23-14-23-05-japanese-garden.png2025-11-23-15-30-12-sunset-mountains.png2025-11-23-16-45-33-robot.png2025-11-23-17-12-48-x9k2.png当用户想要修改现有图像时:
--input-image 参数并指定图像路径对于生成: 将用户的图像描述原样传递给 --prompt。仅在明显不足时进行改写。
对于编辑: 在 --prompt 中传递编辑指令(例如,"在天空中添加一道彩虹", "使其看起来像水彩画")
在两种情况下都要保留用户的创作意图。
当用户描述模糊或编辑需要精确时使用模板。
生成模板:
编辑模板(保留其他所有内容):
生成新图像:
uv run ~/.codex/skills/nano-banana-pro/scripts/generate_image.py --prompt "A serene Japanese garden with cherry blossoms" --filename "2025-11-23-14-23-05-japanese-garden.png" --resolution 4K
编辑现有图像:
uv run ~/.codex/skills/nano-banana-pro/scripts/generate_image.py --prompt "make the sky more dramatic with storm clouds" --filename "2025-11-23-14-25-30-dramatic-sky.png" --input-image "original-photo.jpg" --resolution 2K
每周安装次数
107
代码仓库
GitHub 星标数
2.3K
首次出现时间
Jan 23, 2026
安全审计
已安装于
codex95
opencode94
gemini-cli89
cursor84
github-copilot82
claude-code69
Generate new images or edit existing ones using Google's Nano Banana Pro API (Gemini 3 Pro Image).
Run the script using absolute path (do NOT cd to skill directory first):
Generate new image:
uv run ~/.codex/skills/nano-banana-pro/scripts/generate_image.py --prompt "your image description" --filename "output-name.png" [--resolution 1K|2K|4K] [--api-key KEY]
Edit existing image:
uv run ~/.codex/skills/nano-banana-pro/scripts/generate_image.py --prompt "editing instructions" --filename "output-name.png" --input-image "path/to/input.png" [--resolution 1K|2K|4K] [--api-key KEY]
Important: Always run from the user's current working directory so images are saved where the user is working, not in the skill directory.
Goal: fast iteration without burning time on 4K until the prompt is correct.
uv run ~/.codex/skills/nano-banana-pro/scripts/generate_image.py --prompt "<draft prompt>" --filename "yyyy-mm-dd-hh-mm-ss-draft.png" --resolution 1K--input-image for every iteration until you’re happy.uv run ~/.codex/skills/nano-banana-pro/scripts/generate_image.py --prompt "<final prompt>" --filename "yyyy-mm-dd-hh-mm-ss-final.png" --resolution 4KThe Gemini 3 Pro Image API supports three resolutions (uppercase K required):
Map user requests to API parameters:
1K1K2K4KThe script checks for API key in this order:
--api-key argument (use if user provided key in chat)GEMINI_API_KEY environment variableIf neither is available, the script exits with an error message.
Preflight:
command -v uv (must exist)test -n \"$GEMINI_API_KEY\" (or pass --api-key)test -f \"path/to/input.png\"Common failures:
Error: No API key provided. → set GEMINI_API_KEY or pass --api-keyError loading input image: → wrong path / unreadable file; verify --input-image points to a real imageGenerate filenames with the pattern: yyyy-mm-dd-hh-mm-ss-name.png
Format: {timestamp}-{descriptive-name}.png
yyyy-mm-dd-hh-mm-ss (24-hour format)x9k2, a7b3)Examples:
2025-11-23-14-23-05-japanese-garden.png2025-11-23-15-30-12-sunset-mountains.png2025-11-23-16-45-33-robot.png2025-11-23-17-12-48-x9k2.pngWhen the user wants to modify an existing image:
--input-image parameter with the path to the imageFor generation: Pass user's image description as-is to --prompt. Only rework if clearly insufficient.
For editing: Pass editing instructions in --prompt (e.g., "add a rainbow in the sky", "make it look like a watercolor painting")
Preserve user's creative intent in both cases.
Use templates when the user is vague or when edits must be precise.
Generation template:
Editing template (preserve everything else):
Generate new image:
uv run ~/.codex/skills/nano-banana-pro/scripts/generate_image.py --prompt "A serene Japanese garden with cherry blossoms" --filename "2025-11-23-14-23-05-japanese-garden.png" --resolution 4K
Edit existing image:
uv run ~/.codex/skills/nano-banana-pro/scripts/generate_image.py --prompt "make the sky more dramatic with storm clouds" --filename "2025-11-23-14-25-30-dramatic-sky.png" --input-image "original-photo.jpg" --resolution 2K
Weekly Installs
107
Repository
GitHub Stars
2.3K
First Seen
Jan 23, 2026
Security Audits
Gen Agent Trust HubPassSocketPassSnykFail
Installed on
codex95
opencode94
gemini-cli89
cursor84
github-copilot82
claude-code69
AI 代码实施计划编写技能 | 自动化开发任务分解与 TDD 流程规划工具
48,300 周安装