名称: nano-banana-pro
描述: 使用 Google 的 Nano Banana Pro (Gemini 3 Pro Image) API 生成和编辑图像。当用户要求生成、创建、编辑、修改、更改或更新图像时使用。当用户引用现有图像文件并要求以任何方式修改它时(例如,“修改此图像”、“更改背景”、“将 X 替换为 Y”)也使用。支持文本到图像生成和图像到图像编辑,并可配置分辨率(默认 1K,或 2K、4K 用于高分辨率)。请勿先读取图像文件 - 直接使用此技能并配合 --input-image 参数。
使用 Google 的 Nano Banana Pro API (Gemini 3 Pro Image) 生成新图像或编辑现有图像。
Google AI Studio (公开预览版):
POST https://generativelanguage.googleapis.com/v1beta/models/gemini-3-pro-image-preview:generateContent?key=${API_KEY}
Vertex AI (企业版):
POST https://${REGION}-aiplatform.googleapis.com/v1/projects/${PROJECT_ID}/locations/${REGION}/publishers/google/models/gemini-3-pro-image-preview:predict
gemini-3-pro-image-previewnanobanana-pro-001| 参数 | 值 | 描述 |
|---|---|---|
aspect_ratio |
1:1, 4:3, 3:4, 16:9, 9:16 |
输出宽高比 |
output_mime_type |
image/png, image/jpeg |
输出格式 |
reference_images |
数组 (最多 14 张) | 用于保持一致性的参考图像 |
reference_type |
CHARACTER, STYLE, SUBJECT |
参考图像的使用方式 |
person_generation |
ALLOW_ADULT, DONT_ALLOW, FILTER_SENSITIVE |
人物生成策略 |
image_size |
1K, 2K, 4K |
输出分辨率 |
upscale: true 原生放大至 4K。使用绝对路径运行脚本(请勿先切换到技能目录):
生成新图像:
uv run ~/.clawdbot/skills/nano-banana-pro/scripts/generate_image.py \
--prompt "你的图像描述" \
--filename "输出文件名.png" \
[--resolution 1K|2K|4K] \
[--api-key 密钥]
编辑现有图像:
uv run ~/.clawdbot/skills/nano-banana-pro/scripts/generate_image.py \
--prompt "编辑指令" \
--filename "输出文件名.png" \
--input-image "输入图像路径.png" \
[--resolution 1K|2K|4K]
使用参考图像(产品/风格/角色一致性):
uv run ~/.clawdbot/skills/nano-banana-pro/scripts/generate_image.py \
--prompt "你的描述" \
--filename "输出文件名.png" \
--reference-image "参考图像路径.jpg" \
--reference-type SUBJECT|STYLE|CHARACTER \
[--resolution 1K|2K|4K]
重要提示: 始终从用户的当前工作目录运行,以便图像保存在用户的工作位置,而不是技能目录中。
用户请求映射:
- 未提及 → 1K
- "低分辨率"、"1080"、"1080p"、"1K" → 1K
- "2K"、"2048"、"普通"、"中等分辨率" → 2K
- "高分辨率"、"高画质"、"hi-res"、"4K"、"超高清" → 4K
脚本按以下顺序检查 API 密钥:
1. --api-key 参数
2. GEMINI_API_KEY 环境变量
格式:{时间戳}-{描述性名称}.png
- 时间戳:yyyy-mm-dd-hh-mm-ss (24 小时制)
- 名称:描述性小写字母,用连字符连接
示例:
- 2025-11-23-14-23-05-japanese-garden.png
- 2025-11-23-15-30-12-sunset-mountains.png
你是一位专门研究 Nano Banana Pro 的专家级提示词工程师。将用户的基本想法和参考图像转化为高保真、描述性的提示词。
当提供用户想法和参考图像时,评估:
使用以下层次结构构建优化提示词:
清晰描述“谁”或“什么”正在做“什么”。
指定艺术媒介:
- 超写实摄影
- 油画
- 3D 渲染
- 极简矢量图
- 商业食品摄影
- 社论风格
明确指示如何使用上传的图像:
"保留参考图像中的产品包装作为核心元素"
"应用参考图像 A 中的温暖灯光美学"
灯光:
- 电影感轮廓光
- 柔和的漫射阳光
- 强烈的闪光灯
- 温暖的钨丝灯光
- 黄金时段的温暖光线
构图:
- 广角镜头
- 微距细节
- 鸟瞰视角
- 浅景深
- 产品作为核心元素
色彩理论:
- 单色蓝色调
- 高对比度的互补色
- 温暖的琥珀色调
- 暗色调色板
文本渲染:
对特定文本使用双引号:
"单词 'FUTURE' 以粗体、拉丝金属 3D 字体书写在中央"
当生成以产品为主角的图像时:
--reference-type SUBJECT 以保持产品一致性。"Milkaut Crematto 容器,带有蓝色标签和红色盖子,突出展示"
"产品容器作为联合主演的产品植入"
"产品容器处于清晰焦点"
"放置在...旁边"、"紧邻"、"突出排列"
超写实商业食品摄影,[产品名称] 容器突出展示在 [食品项目] 旁边,
[食品描述],[场景/背景],[灯光风格],[产品] 作为核心元素,
8k 照片级真实感细节
以英文提供优化后的提示词,无需额外评论。
uv run ~/.clawdbot/skills/nano-banana-pro/scripts/generate_image.py \
--prompt "Hyper-realistic commercial food photography with a Milkaut Crematto container prominently displayed next to a gourmet double smash burger with perfectly melted cheddar cheese cascading down juicy beef patties, artisan brioche bun, wisps of steam rising, dark moody background with dramatic rim lighting, the cream cheese container as hero product placement, 8k texture detail" \
--filename "2026-01-28-product-burger.png" \
--reference-image "product-photo.jpg" \
--reference-type SUBJECT \
--resolution 2K
uv run ~/.clawdbot/skills/nano-banana-pro/scripts/generate_image.py \
--prompt "Using the warm golden hour aesthetic from the reference, create a serene Japanese garden with cherry blossoms, koi pond reflecting soft pink petals, traditional wooden bridge, ethereal morning mist, 8k photorealistic detail" \
--filename "2026-01-28-japanese-garden.png" \
--reference-image "style-reference.jpg" \
--reference-type STYLE \
--resolution 2K
uv run ~/.clawdbot/skills/nano-banana-pro/scripts/generate_image.py \
--prompt "Change the background to a dramatic sunset over mountains, maintain the subject in sharp focus" \
--filename "2026-01-28-edited-sunset.png" \
--input-image "original.jpg" \
--resolution 2K