nano-banana-2 by intellectronica/agent-skills
npx skills add https://github.com/intellectronica/agent-skills --skill nano-banana-2使用 Nano Banana 2 (gemini-3.1-flash-image-preview) 生成新图像或编辑现有图像。
使用绝对路径或相对于工作区的路径运行脚本(请勿先切换到技能目录):
生成新图像:
uv run ./.agents/skills/nano-banana-2/scripts/generate_image.py --prompt "你的图像描述" --filename "输出名称.png" [--resolution 512px|1K|2K|4K] [--aspect-ratio 比例] [--api-key 密钥]
使用参考图编辑图像:
uv run ./.agents/skills/nano-banana-2/scripts/generate_image.py --prompt "编辑指令" --filename "输出名称.png" --input-image "路径/到/输入1.png" [--input-image "路径/到/输入2.png" ...] [--resolution 512px|1K|2K|4K] [--aspect-ratio 比例] [--api-key 密钥]
始终从用户的当前工作目录运行,以便输出保存在活动项目上下文中。
使用模型代码:
gemini-3.1-flash-image-preview (Nano Banana 2)请勿在此技能中使用 。
广告位招租
在这里展示您的产品或服务
触达数万 AI 开发者,精准高效
gemini-3-pro-image-previewNano Banana 2 支持:
512px (最快,低延迟迭代)1K (默认)2K4K映射常见用户表述:
512px1K2K4K对于 1K、2K、4K 使用大写 K。
支持的宽高比:
1:1, 1:4, 1:8, 2:3, 3:2, 3:4, 4:1, 4:3, 4:5, 5:4, 8:1, 9:16, 16:9, 21:9映射常见需求:
1:19:1616:921:92:3 或 3:44:1 或 8:1如果未指定,则应用模型的默认行为。
需要时,可通过重复 --input-image 提供最多 14 张参考图像:
简单编辑使用一张图像;对于构图或对一致性敏感的任务,使用多张图像。
按以下顺序解析 API 密钥:
--api-key 参数GEMINI_API_KEY 环境变量如果没有可用的密钥,则停止并报告清晰的错误。
生成的文件名格式为:yyyy-mm-dd-hh-mm-ss-名称.png
示例:
2026-02-26-17-31-04-japanese-garden.png2026-02-26-17-31-59-social-banner.png对于生成任务,除非用户请求严重描述不足,否则按原样传递。对于编辑任务,在提示词中包含明确的转换指令,并保留原始意图。
--filename 中提供的路径)创建 4K 宽屏图像:
uv run ./.agents/skills/nano-banana-2/scripts/generate_image.py --prompt "蓝色时刻下带有霓虹反射的未来主义城市天际线" --filename "2026-02-26-17-45-00-futuristic-skyline.png" --resolution 4K --aspect-ratio 16:9
使用多个参考图进行编辑:
uv run ./.agents/skills/nano-banana-2/scripts/generate_image.py --prompt "创建一个精良的宣传图像,保持完全相同的徽标细节和角色特征" --filename "2026-02-26-17-50-10-campaign-image.png" --input-image "logo.png" --input-image "character.png" --resolution 2K --aspect-ratio 4:5
每周安装量
103
代码仓库
GitHub 星标数
228
首次出现
2026年2月26日
安全审计
已安装于
codex100
gemini-cli99
opencode99
amp98
kimi-cli98
github-copilot98
Generate new images or edit existing images with Nano Banana 2 (gemini-3.1-flash-image-preview).
Run the script using absolute or workspace-relative path (do NOT cd into the skill directory first):
Generate new image:
uv run ./.agents/skills/nano-banana-2/scripts/generate_image.py --prompt "your image description" --filename "output-name.png" [--resolution 512px|1K|2K|4K] [--aspect-ratio RATIO] [--api-key KEY]
Edit image(s) with references:
uv run ./.agents/skills/nano-banana-2/scripts/generate_image.py --prompt "editing instructions" --filename "output-name.png" --input-image "path/to/input1.png" [--input-image "path/to/input2.png" ...] [--resolution 512px|1K|2K|4K] [--aspect-ratio RATIO] [--api-key KEY]
Always run from the user's current working directory so outputs are saved in the active project context.
Use model code:
gemini-3.1-flash-image-preview (Nano Banana 2)Do not use gemini-3-pro-image-preview in this skill.
Nano Banana 2 supports:
512px (fastest, low-latency iteration)1K (default)2K4KMap common user language:
512px1K2K4KUse uppercase K for 1K, 2K, 4K.
Supported aspect ratios:
1:1, 1:4, 1:8, 2:3, 3:2, 3:4, 4:1, 4:3, 4:5, 5:4, 8:1, 9:16, , Map common requests:
1:19:1616:921:92:3 or 3:44:1 or 8:1If unspecified, let the model default behavior apply.
Provide up to 14 reference images when needed by repeating --input-image:
Use one image for simple edits; use multiple images for composition or consistency-sensitive tasks.
Resolve API key in this order:
--api-key argumentGEMINI_API_KEY environment variableIf no key is available, stop and report a clear error.
Generate filenames as: yyyy-mm-dd-hh-mm-ss-name.png
Examples:
2026-02-26-17-31-04-japanese-garden.png2026-02-26-17-31-59-social-banner.pngFor generation, pass the user's request as-is unless critically underspecified. For editing, include explicit transformation instructions in the prompt and preserve the original intent.
--filename)Create a 4K widescreen image:
uv run ./.agents/skills/nano-banana-2/scripts/generate_image.py --prompt "Futuristic city skyline at blue hour with neon reflections" --filename "2026-02-26-17-45-00-futuristic-skyline.png" --resolution 4K --aspect-ratio 16:9
Edit with multiple references:
uv run ./.agents/skills/nano-banana-2/scripts/generate_image.py --prompt "Create a polished campaign image that keeps the exact logo details and character identity" --filename "2026-02-26-17-50-10-campaign-image.png" --input-image "logo.png" --input-image "character.png" --resolution 2K --aspect-ratio 4:5
Weekly Installs
103
Repository
GitHub Stars
228
First Seen
Feb 26, 2026
Security Audits
Gen Agent Trust HubPassSocketPassSnykFail
Installed on
codex100
gemini-cli99
opencode99
amp98
kimi-cli98
github-copilot98
AI 代码实施计划编写技能 | 自动化开发任务分解与 TDD 流程规划工具
50,900 周安装
16:921:9