nano-banana
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
ChineseNano Banana Image Generation
Nano Banana 图片生成
Generate professional images via the Gemini CLI's nanobanana extension.
通过Gemini CLI的nanobanana扩展生成专业图片。
When to Use This Skill
何时使用此技能
ALWAYS use this skill when the user:
- Asks for any image, graphic, illustration, or visual
- Wants a thumbnail, featured image, or banner
- Requests icons, diagrams, or patterns
- Asks to edit, modify, or restore a photo
- Uses words like: generate, create, make, draw, design, visualize
Do NOT attempt to generate images through any other method.
当用户有以下需求时,务必使用此技能:
- 请求任何图片、图形、插画或视觉内容
- 需要缩略图、首图或横幅
- 要求生成图标、图表或图案
- 请求编辑、修改或修复照片
- 使用了以下词汇:生成、创建、制作、绘制、设计、可视化
请勿尝试通过任何其他方法生成图片。
Before First Use
首次使用前准备
- Verify extension is installed:
bash
gemini extensions list | grep nanobanana - If missing, install it:
bash
gemini extensions install https://github.com/gemini-cli-extensions/nanobanana - Verify API key is set:
bash
[ -n "$GEMINI_API_KEY" ] && echo "API key configured" || echo "Missing GEMINI_API_KEY"
- 验证扩展是否已安装:
bash
gemini extensions list | grep nanobanana - 若未安装,执行安装命令:
bash
gemini extensions install https://github.com/gemini-cli-extensions/nanobanana - 验证API密钥是否已设置:
bash
[ -n "$GEMINI_API_KEY" ] && echo "API key configured" || echo "Missing GEMINI_API_KEY"
Command Selection
命令选择
| User Request | Command |
|---|---|
| "make me a blog header" | |
| "create an app icon" | |
| "draw a flowchart of..." | |
| "fix this old photo" | |
| "remove the background" | |
| "create a repeating texture" | |
| "make a comic strip" | |
| 用户需求 | 命令 |
|---|---|
| "为我制作博客页眉" | |
| "创建一个应用图标" | |
| "绘制一个...的流程图" | |
| "修复这张旧照片" | |
| "去除背景" | |
| "创建重复纹理" | |
| "制作漫画条" | |
Available Commands
可用命令
Note: Always use the flag to automatically approve all tool actions.
--yolo| Command | Use Case |
|---|---|
| Text-to-image generation |
| Modify existing image |
| Repair damaged photos |
| App icons, favicons, UI elements |
| Flowcharts, architecture diagrams |
| Seamless textures and patterns |
| Sequential/narrative images |
| Natural language interface |
注意: 请始终使用标志来自动批准所有工具操作。
--yolo| 命令 | 使用场景 |
|---|---|
| 文本转图片生成 |
| 修改现有图片 |
| 修复损坏的照片 |
| 应用图标、网站图标、UI元素 |
| 流程图、架构图 |
| 无缝纹理和图案 |
| 序列/叙事图片 |
| 自然语言界面 |
Common Options
常用选项
- - Required. Auto-approve all tool actions (no confirmation prompts)
--yolo - - Generate N variations (1-8)
--count=N - - Auto-open generated images
--preview - - Apply artistic styles
--styles="style1,style2" - - Output arrangement
--format=grid|separate
- - 必填。自动批准所有工具操作(无确认提示)
--yolo - - 生成N个变体(1-8)
--count=N - - 自动打开生成的图片
--preview - - 应用艺术风格
--styles="style1,style2" - - 输出排列方式
--format=grid|separate
Common Sizes
常用尺寸
| Use Case | Dimensions | Notes |
|---|---|---|
| YouTube thumbnail | 1280x720 | |
| Blog featured image | 1200x630 | Social preview friendly |
| Square social | 1080x1080 | Instagram, LinkedIn |
| Twitter/X header | 1500x500 | Wide banner |
| Vertical story | 1080x1920 | |
| 使用场景 | 尺寸 | 说明 |
|---|---|---|
| YouTube缩略图 | 1280x720 | |
| 博客首图 | 1200x630 | 适配社交预览 |
| 方形社交图 | 1080x1080 | 适用于Instagram、LinkedIn |
| Twitter/X页眉 | 1500x500 | 宽幅横幅 |
| 竖版故事图 | 1080x1920 | |
Model Selection
模型选择
Default: (~$0.04/image)
gemini-2.5-flash-imageFor higher quality (4K, better reasoning):
bash
export NANOBANANA_MODEL=gemini-3-pro-image-preview默认模型:(约0.04美元/张)
gemini-2.5-flash-image如需更高质量(4K、更优推理能力):
bash
export NANOBANANA_MODEL=gemini-3-pro-image-previewBlog Featured Image Examples
博客首图示例
bash
undefinedbash
undefinedModern illustration style
现代插画风格
gemini --yolo "/generate 'modern flat illustration of developer coding at laptop, purple and blue gradient background, minimalist style, no text' --preview"
gemini --yolo "/generate 'modern flat illustration of developer coding at laptop, purple and blue gradient background, minimalist style, no text' --preview"
Professional photography style
专业摄影风格
gemini --yolo "/generate 'professional editorial photo of coffee cup next to laptop on wooden desk, morning sunlight, shallow depth of field, no text' --count=3"
gemini --yolo "/generate 'professional editorial photo of coffee cup next to laptop on wooden desk, morning sunlight, shallow depth of field, no text' --count=3"
Tech/abstract
科技/抽象风格
gemini --yolo "/generate 'abstract visualization of neural network connections, dark background with glowing blue nodes, futuristic style' --preview"
undefinedgemini --yolo "/generate 'abstract visualization of neural network connections, dark background with glowing blue nodes, futuristic style' --preview"
undefinedIcon Generation
图标生成示例
bash
gemini --yolo "/icon 'minimalist app logo for productivity tool' --sizes='64,128,256,512' --type='app-icon' --corners='rounded'"bash
gemini --yolo "/icon 'minimalist app logo for productivity tool' --sizes='64,128,256,512' --type='app-icon' --corners='rounded'"Diagram Generation
图表生成示例
bash
gemini --yolo "/diagram 'user authentication flow with OAuth' --type='flowchart' --style='modern'"bash
gemini --yolo "/diagram 'user authentication flow with OAuth' --type='flowchart' --style='modern'"Output Location
输出位置
All generated images are saved to in the current directory.
./nanobanana-output/所有生成的图片都会保存到当前目录下的文件夹中。
./nanobanana-output/Presenting Results
结果展示
After generation completes:
- List contents of to find generated files
./nanobanana-output/ - Present the most recent image(s) to the user
- Offer to regenerate with variations if needed
生成完成后:
- 列出目录下的内容,找到生成的文件
./nanobanana-output/ - 向用户展示最新的图片
- 若用户需要,提供变体重新生成服务
Refinements and Iterations
优化与迭代
When the user asks for changes:
- "Try again" / "Give me options": Regenerate with
--count=3 - "Make it more [adjective]": Adjust prompt and regenerate
- "Edit this one": Use
gemini --yolo "/edit nanobanana-output/filename.png 'adjustment'" - "Different style": Add to the command
--styles="requested_style"
当用户要求修改时:
- “再试一次”/“给我几个选项”:使用重新生成
--count=3 - “让它更[形容词]”:调整提示词后重新生成
- “编辑这张”:使用命令
gemini --yolo "/edit nanobanana-output/filename.png 'adjustment'" - “换个风格”:在命令中添加参数
--styles="requested_style"
Prompt Tips
提示词技巧
- Be specific: Include style, mood, colors, composition details
- Add "no text": If you don't want text rendered in the image
- Reference styles: "editorial photography", "flat illustration", "3D render", "watercolor"
- Specify aspect ratio context: "wide banner", "square thumbnail", "vertical story"
- 具体明确:包含风格、氛围、颜色、构图细节
- 添加“无文字”:若不希望图片中出现文字
- 参考风格术语:如“编辑摄影”、“扁平化插画”、“3D渲染”、“水彩画”
- 指定宽高比场景:如“宽幅横幅”、“方形缩略图”、“竖版故事图”
Troubleshooting
故障排除
| Problem | Solution |
|---|---|
| |
| Extension not found | Run install command from setup section |
| Quota exceeded | Wait for reset or switch to flash model |
| Image generation failed | Check prompt for policy violations, simplify request |
| Output directory missing | Will be created automatically on first run |
| 问题 | 解决方案 |
|---|---|
未设置 | 执行 |
| 找不到扩展 | 执行安装准备部分的安装命令 |
| 配额用尽 | 等待重置或切换到flash模型 |
| 图片生成失败 | 检查提示词是否违反政策,简化请求 |
| 输出目录缺失 | 首次运行时会自动创建 |