nano-banana

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese

Nano 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

首次使用前准备

  1. Verify extension is installed:
    bash
    gemini extensions list | grep nanobanana
  2. If missing, install it:
    bash
    gemini extensions install https://github.com/gemini-cli-extensions/nanobanana
  3. Verify API key is set:
    bash
    [ -n "$GEMINI_API_KEY" ] && echo "API key configured" || echo "Missing GEMINI_API_KEY"
  1. 验证扩展是否已安装:
    bash
    gemini extensions list | grep nanobanana
  2. 若未安装,执行安装命令:
    bash
    gemini extensions install https://github.com/gemini-cli-extensions/nanobanana
  3. 验证API密钥是否已设置:
    bash
    [ -n "$GEMINI_API_KEY" ] && echo "API key configured" || echo "Missing GEMINI_API_KEY"

Command Selection

命令选择

User RequestCommand
"make me a blog header"
/generate
"create an app icon"
/icon
"draw a flowchart of..."
/diagram
"fix this old photo"
/restore
"remove the background"
/edit
"create a repeating texture"
/pattern
"make a comic strip"
/story
用户需求命令
"为我制作博客页眉"
/generate
"创建一个应用图标"
/icon
"绘制一个...的流程图"
/diagram
"修复这张旧照片"
/restore
"去除背景"
/edit
"创建重复纹理"
/pattern
"制作漫画条"
/story

Available Commands

可用命令

Note: Always use the
--yolo
flag to automatically approve all tool actions.
CommandUse Case
gemini --yolo "/generate 'prompt'"
Text-to-image generation
gemini --yolo "/edit file.png 'instruction'"
Modify existing image
gemini --yolo "/restore old_photo.jpg 'fix scratches'"
Repair damaged photos
gemini --yolo "/icon 'description'"
App icons, favicons, UI elements
gemini --yolo "/diagram 'description'"
Flowcharts, architecture diagrams
gemini --yolo "/pattern 'description'"
Seamless textures and patterns
gemini --yolo "/story 'description'"
Sequential/narrative images
gemini --yolo "/nanobanana prompt"
Natural language interface
注意: 请始终使用
--yolo
标志来自动批准所有工具操作。
命令使用场景
gemini --yolo "/generate 'prompt'"
文本转图片生成
gemini --yolo "/edit file.png 'instruction'"
修改现有图片
gemini --yolo "/restore old_photo.jpg 'fix scratches'"
修复损坏的照片
gemini --yolo "/icon 'description'"
应用图标、网站图标、UI元素
gemini --yolo "/diagram 'description'"
流程图、架构图
gemini --yolo "/pattern 'description'"
无缝纹理和图案
gemini --yolo "/story 'description'"
序列/叙事图片
gemini --yolo "/nanobanana prompt"
自然语言界面

Common Options

常用选项

  • --yolo
    - Required. Auto-approve all tool actions (no confirmation prompts)
  • --count=N
    - Generate N variations (1-8)
  • --preview
    - Auto-open generated images
  • --styles="style1,style2"
    - Apply artistic styles
  • --format=grid|separate
    - Output arrangement
  • --yolo
    - 必填。自动批准所有工具操作(无确认提示)
  • --count=N
    - 生成N个变体(1-8)
  • --preview
    - 自动打开生成的图片
  • --styles="style1,style2"
    - 应用艺术风格
  • --format=grid|separate
    - 输出排列方式

Common Sizes

常用尺寸

Use CaseDimensionsNotes
YouTube thumbnail1280x720
--aspect=16:9
Blog featured image1200x630Social preview friendly
Square social1080x1080Instagram, LinkedIn
Twitter/X header1500x500Wide banner
Vertical story1080x1920
--aspect=9:16
使用场景尺寸说明
YouTube缩略图1280x720
--aspect=16:9
博客首图1200x630适配社交预览
方形社交图1080x1080适用于Instagram、LinkedIn
Twitter/X页眉1500x500宽幅横幅
竖版故事图1080x1920
--aspect=9:16

Model Selection

模型选择

Default:
gemini-2.5-flash-image
(~$0.04/image)
For higher quality (4K, better reasoning):
bash
export NANOBANANA_MODEL=gemini-3-pro-image-preview
默认模型:
gemini-2.5-flash-image
(约0.04美元/张)
如需更高质量(4K、更优推理能力):
bash
export NANOBANANA_MODEL=gemini-3-pro-image-preview

Blog Featured Image Examples

博客首图示例

bash
undefined
bash
undefined

Modern 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"
undefined
gemini --yolo "/generate 'abstract visualization of neural network connections, dark background with glowing blue nodes, futuristic style' --preview"
undefined

Icon 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
./nanobanana-output/
in the current directory.
所有生成的图片都会保存到当前目录下的
./nanobanana-output/
文件夹中。

Presenting Results

结果展示

After generation completes:
  1. List contents of
    ./nanobanana-output/
    to find generated files
  2. Present the most recent image(s) to the user
  3. Offer to regenerate with variations if needed
生成完成后:
  1. 列出
    ./nanobanana-output/
    目录下的内容,找到生成的文件
  2. 向用户展示最新的图片
  3. 若用户需要,提供变体重新生成服务

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
    --styles="requested_style"
    to the command
当用户要求修改时:
  • “再试一次”/“给我几个选项”:使用
    --count=3
    重新生成
  • “让它更[形容词]”:调整提示词后重新生成
  • “编辑这张”:使用
    gemini --yolo "/edit nanobanana-output/filename.png 'adjustment'"
    命令
  • “换个风格”:在命令中添加
    --styles="requested_style"
    参数

Prompt Tips

提示词技巧

  1. Be specific: Include style, mood, colors, composition details
  2. Add "no text": If you don't want text rendered in the image
  3. Reference styles: "editorial photography", "flat illustration", "3D render", "watercolor"
  4. Specify aspect ratio context: "wide banner", "square thumbnail", "vertical story"
  1. 具体明确:包含风格、氛围、颜色、构图细节
  2. 添加“无文字”:若不希望图片中出现文字
  3. 参考风格术语:如“编辑摄影”、“扁平化插画”、“3D渲染”、“水彩画”
  4. 指定宽高比场景:如“宽幅横幅”、“方形缩略图”、“竖版故事图”

Troubleshooting

故障排除

ProblemSolution
GEMINI_API_KEY
not set
export GEMINI_API_KEY="your-key"
Extension not foundRun install command from setup section
Quota exceededWait for reset or switch to flash model
Image generation failedCheck prompt for policy violations, simplify request
Output directory missingWill be created automatically on first run
问题解决方案
未设置
GEMINI_API_KEY
执行
export GEMINI_API_KEY="your-key"
找不到扩展执行安装准备部分的安装命令
配额用尽等待重置或切换到flash模型
图片生成失败检查提示词是否违反政策,简化请求
输出目录缺失首次运行时会自动创建