重要前提
安装AI Skills的关键前提是:必须科学上网,且开启TUN模式,这一点至关重要,直接决定安装能否顺利完成,在此郑重提醒三遍:科学上网,科学上网,科学上网。查看完整安装教程 →
nanobanana-skill by feiskyer/codex-settings
npx skills add https://github.com/feiskyer/codex-settings --skill nanobanana-skill使用捆绑的 nanobanana.py 工具通过 Gemini 图像模型生成或编辑图像。默认路径现在指向 Nano Banana 2 (gemini-3.1-flash-image-preview),并默认开启思考摘要和Google 搜索事实依据,因为这些默认设置是使用此技能而非通用图像提示的主要原因。
适用于:
不适用于:
GEMINI_API_KEY 必须存在于 ~/.nanobanana.env 或 shell 环境中。requirements.txt 中的 Python 依赖项。广告位招租
在这里展示您的产品或服务
触达数万 AI 开发者,精准高效
nanobanana.py环境文件示例:
GEMINI_API_KEY=sk-dummy
除非用户明确要求,否则优先使用以下默认设置:
gemini-3.1-flash-image-previewhigh1K对于编辑任务,不指定宽高比通常更好,因为 Gemini 可以匹配输入图像的形状。对于纯文本生成,仅当用户暗示了特定格式(如海报、方形帖子、横幅、手机壁纸或超宽英雄图像)时才选择宽高比。
仅询问对结果有实质性影响的细节:
不要强迫用户选择模型、搜索模式或思考模式,除非他们要求这种级别的控制。最新的 Nanobanana 2 路径已是默认设置。
当没有输入图像时,使用生成模式。
当有一个或多个输入图像时,使用编辑/合成模式。Nanobanana 2 可以混合多个参考图像,因此如果用户明确要求进行混合、排列、故事板或一致性处理,不要人为地将任务限制为单张图像。
使用此技能文件旁边的脚本。
基本生成:
python3 /absolute/path/to/nanobanana.py \
--prompt "Create a high-end coffee bag package design with tactile paper texture and clear typography" \
--output /absolute/path/to/output/package.png
编辑或合成:
python3 /absolute/path/to/nanobanana.py \
--prompt "Turn these product photos into a clean 4:5 ecommerce hero image with a soft studio shadow and subtle headline area" \
--input /absolute/path/to/ref1.png /absolute/path/to/ref2.png \
--aspect-ratio 4:5 \
--output /absolute/path/to/output/hero.png
带有保存文本元数据的事实依据生成:
python3 /absolute/path/to/nanobanana.py \
--prompt "Use Google Search to ground an editorial illustration about the most recent lunar mission and create a clean magazine cover concept" \
--aspect-ratio 2:3 \
--text-output /absolute/path/to/output/cover.txt \
--metadata-output /absolute/path/to/output/cover.json \
--output /absolute/path/to/output/cover.png
始终告知用户:
如果模型返回文本但没有图像,请如实报告,并建议使用更明确的以图像为中心的提示,而不是假装运行成功。
gemini-3.1-flash-image-preview:默认。对于使用 Nanobanana 2 功能进行快速、大批量图像生成和编辑的最佳默认选择。gemini-3-pro-image-preview:较慢,但对于细节非常丰富或对排版敏感的工作是一个很好的覆盖选项。gemini-2.5-flash-image:如果用户特别想要旧的 Nanobanana 模型,则作为备用选项。支持的宽高比:
1:11:41:82:33:23:44:14:34:55:48:19:1616:921:9快速选择:
1:1 用于徽标、图标、缩略图和一般社交媒体帖子4:5 用于信息流帖子和产品卡片2:3 用于海报和书籍封面风格的作品9:16 用于故事、短视频和手机壁纸16:9 或 21:9 用于幻灯片、横幅和桌面英雄图像1:4、4:1、1:8、8:1 用于 Nanobanana 2 现在支持的非常高或非常宽的实验性布局512px:仅限 Nanobanana 2。最适合快速构思。1K:默认。对于大多数请求来说是良好的折衷方案。2K:用于精美的交付成果。4K:当用户明确需要高分辨率最终成果时使用。--thinking-level 降低到 low 或 minimal。好的 Nanobanana 提示词是直接的生产简报,而不是模糊的艺术愿望。应包括:
优先使用类似这样的提示词:
Create a premium sparkling water can advertisement. Use a cold studio product-photo look, silver highlights, condensation droplets, and a clean dark-teal background. Leave negative space in the upper-right for headline copy.
而不是:
make a cool drink ad
对于编辑任务,告诉模型要保留什么和改变什么:
Keep the shoe silhouette and logo placement intact. Replace the background with a bright outdoor basketball court, add dynamic afternoon shadows, and keep the image looking like a real sports campaign photo.
1K、2K 和 4K 外,还支持 512px 快速构思输出如果运行失败:
~/.nanobanana.env 并确认 GEMINI_API_KEY 存在。gemini-3.1-flash-image-preview 重试。python3 /absolute/path/to/nanobanana.py \
--prompt "Create three-dimensional sticker-style fruit mascots on white" \
--resolution 512px \
--output /absolute/path/to/output/stickers.png
python3 /absolute/path/to/nanobanana.py \
--prompt "Use Google Search to ground a newspaper-style illustration about the latest Mars mission and create a restrained front-page visual" \
--aspect-ratio 3:2 \
--output /absolute/path/to/output/mars.png
python3 /absolute/path/to/nanobanana.py \
--prompt "Create a single brand moodboard from these references. Keep the ceramic texture from the first image, the palette from the second, and the lighting mood from the third." \
--input /absolute/path/to/a.png /absolute/path/to/b.png /absolute/path/to/c.png \
--aspect-ratio 16:9 \
--output /absolute/path/to/output/moodboard.png
每周安装次数
60
仓库
GitHub 星标数
164
首次出现时间
Jan 23, 2026
安全审计
安装于
codex57
opencode57
gemini-cli56
claude-code56
github-copilot53
cursor52
Use the bundled nanobanana.py tool to generate or edit images with Gemini image models. The default path now targets Nano Banana 2 (gemini-3.1-flash-image-preview) and turns on thinking summaries plus Google Search grounding by default, because those defaults are the main reason to use this skill instead of a generic image prompt.
Use it for:
Do not use it for:
GEMINI_API_KEY must exist in ~/.nanobanana.env or the shell environment.requirements.txt must be installed.nanobanana.py file in this same skill directory. Resolve its absolute path once before running it.Example env file:
GEMINI_API_KEY=sk-dummy
Unless the user explicitly asks otherwise, prefer these defaults:
gemini-3.1-flash-image-previewhigh1KLeaving aspect ratio unspecified is usually better for edits because Gemini can match the input image shape. For text-only generation, pick an aspect ratio only when the user implies a format such as poster, square post, banner, phone wallpaper, or ultrawide hero image.
Ask only for details that materially affect the result:
Do not force the user to choose a model, search mode, or thinking mode unless they asked for that level of control. The latest Nanobanana 2 path is already the default.
Use generate when there are no input images.
Use edit/composite when there are one or more input images. Nanobanana 2 can mix multiple references, so do not artificially limit the task to a single image if the user is clearly asking for a blend, lineup, storyboard, or consistency pass.
Use the script beside this skill file.
Basic generation:
python3 /absolute/path/to/nanobanana.py \
--prompt "Create a high-end coffee bag package design with tactile paper texture and clear typography" \
--output /absolute/path/to/output/package.png
Editing or compositing:
python3 /absolute/path/to/nanobanana.py \
--prompt "Turn these product photos into a clean 4:5 ecommerce hero image with a soft studio shadow and subtle headline area" \
--input /absolute/path/to/ref1.png /absolute/path/to/ref2.png \
--aspect-ratio 4:5 \
--output /absolute/path/to/output/hero.png
Grounded generation with saved text metadata:
python3 /absolute/path/to/nanobanana.py \
--prompt "Use Google Search to ground an editorial illustration about the most recent lunar mission and create a clean magazine cover concept" \
--aspect-ratio 2:3 \
--text-output /absolute/path/to/output/cover.txt \
--metadata-output /absolute/path/to/output/cover.json \
--output /absolute/path/to/output/cover.png
Always tell the user:
If the model returns text but no image, report that plainly and suggest a more explicit image-focused prompt instead of pretending the run succeeded.
gemini-3.1-flash-image-preview: default. Best default for fast, high-volume image generation and editing with Nanobanana 2 features.gemini-3-pro-image-preview: slower, but a good override for very detail-heavy or typography-sensitive work.gemini-2.5-flash-image: legacy fallback if the user specifically wants the older Nanobanana model.Supported ratios:
1:11:41:82:33:23:44:14:34:55:48:1Quick picks:
1:1 for logos, icons, thumbnails, and general social posts4:5 for feed posts and product cards2:3 for posters and book-cover style work9:16 for stories, shorts, and phone wallpaper16:9 or 21:9 for slides, banners, and desktop hero art1:4, 4:1, 1:8, 8:1 for very tall or very wide experimental layouts now supported by Nanobanana 2512px: Nanobanana 2 only. Best for quick ideation.1K: default. Good tradeoff for most requests.2K: use for polished deliverables.4K: use when the user explicitly needs a high-resolution final.--thinking-level to low or minimal when the user prioritizes latency over refinement.Good Nanobanana prompts are direct production briefs, not vague art wishes. Include:
Prefer prompts like:
Create a premium sparkling water can advertisement. Use a cold studio product-photo look, silver highlights, condensation droplets, and a clean dark-teal background. Leave negative space in the upper-right for headline copy.
Instead of:
make a cool drink ad
For edits, tell the model what to preserve and what to change:
Keep the shoe silhouette and logo placement intact. Replace the background with a bright outdoor basketball court, add dynamic afternoon shadows, and keep the image looking like a real sports campaign photo.
512px fast ideation output in addition to 1K, 2K, and 4KIf the run fails:
~/.nanobanana.env and confirm GEMINI_API_KEY is present.gemini-3.1-flash-image-preview first.python3 /absolute/path/to/nanobanana.py \
--prompt "Create three-dimensional sticker-style fruit mascots on white" \
--resolution 512px \
--output /absolute/path/to/output/stickers.png
python3 /absolute/path/to/nanobanana.py \
--prompt "Use Google Search to ground a newspaper-style illustration about the latest Mars mission and create a restrained front-page visual" \
--aspect-ratio 3:2 \
--output /absolute/path/to/output/mars.png
python3 /absolute/path/to/nanobanana.py \
--prompt "Create a single brand moodboard from these references. Keep the ceramic texture from the first image, the palette from the second, and the lighting mood from the third." \
--input /absolute/path/to/a.png /absolute/path/to/b.png /absolute/path/to/c.png \
--aspect-ratio 16:9 \
--output /absolute/path/to/output/moodboard.png
Weekly Installs
60
Repository
GitHub Stars
164
First Seen
Jan 23, 2026
Security Audits
Gen Agent Trust HubPassSocketPassSnykWarn
Installed on
codex57
opencode57
gemini-cli56
claude-code56
github-copilot53
cursor52
AI界面设计评审工具 - 全面评估UI/UX设计质量、检测AI生成痕迹与优化用户体验
58,500 周安装
9:1616:921:9