edit-image
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
ChineseEdit Image
编辑图片
Edit images using Nano Banana Pro ().
gemini-3-pro-image-preview使用Nano Banana Pro()编辑图片。
gemini-3-pro-image-previewWhen to Use
使用场景
Use this skill when the user asks to:
- Edit part of an image (inpainting)
- Extend an image beyond its borders (outpainting)
- Replace objects or regions in an image
- Add elements to an existing image
- Adapt an existing image for a different format or platform (social media, OG, Twitter card)
当用户提出以下需求时使用此Skill:
- 编辑图片的部分区域(inpaint)
- 扩展图片边界之外的内容(outpaint)
- 替换图片中的物体或区域
- 为现有图片添加元素
- 调整现有图片以适配不同格式或平台(社交媒体、OG、Twitter卡片)
How It Works
工作原理
Uses Gemini's multimodal capabilities to understand and edit images via natural language. The model takes the source image and a text prompt describing the desired edit, then generates a new image with the changes applied.
Semantic masking: Instead of requiring precise pixel masks, describe what to change in your prompt. The model understands context and can target specific regions.
Optional mask images: You can still provide a mask image (white = edit area) as a visual hint, but it's not required. Descriptive prompts often work better.
利用Gemini的多模态能力,通过自然语言理解并编辑图片。模型接收源图片和描述所需编辑内容的文本提示词,然后生成应用了修改后的新图片。
语义蒙版:无需精确的像素蒙版,只需在提示词中描述需要修改的内容即可。模型能够理解上下文并定位特定区域。
可选蒙版图片:你仍可以提供蒙版图片(白色区域=编辑区域)作为视觉提示,但这并非必需。描述性提示词通常效果更好。
Usage
使用方法
bash
bun run ${CLAUDE_PLUGIN_ROOT}/skills/edit-image/scripts/edit.ts <input-image> "edit prompt" [options]bash
bun run ${CLAUDE_PLUGIN_ROOT}/skills/edit-image/scripts/edit.ts <input-image> "edit prompt" [options]Options
选项
- - Optional mask image (white = edit area, black = keep)
--mask <path> - - Edit mode
--mode <inpaint|outpaint> - - Output format
--format <png|jpeg|webp> - - JPEG quality (1-100)
--quality <n> - - What to avoid in the edit
--negative <prompt> - - Number of variations
--count <n> - - Random seed
--seed <n> - - Output path
--output <path>
- - 可选的蒙版图片(白色=编辑区域,黑色=保留区域)
--mask <path> - - 编辑模式
--mode <inpaint|outpaint> - - 输出格式
--format <png|jpeg|webp> - - JPEG质量(1-100)
--quality <n> - - 编辑中需要避免的内容
--negative <prompt> - - 生成的变体数量
--count <n> - - 随机种子
--seed <n> - - 输出路径
--output <path>
Examples
示例
bash
undefinedbash
undefinedSimple edit with descriptive prompt (no mask needed)
Simple edit with descriptive prompt (no mask needed)
bun run ${CLAUDE_PLUGIN_ROOT}/skills/edit-image/scripts/edit.ts photo.jpg "change the background to a beach sunset"
bun run ${CLAUDE_PLUGIN_ROOT}/skills/edit-image/scripts/edit.ts photo.jpg "change the background to a beach sunset"
Edit with mask for precise control
Edit with mask for precise control
bun run ${CLAUDE_PLUGIN_ROOT}/skills/edit-image/scripts/edit.ts photo.jpg "add a sunset sky" --mask sky_mask.png --mode inpaint
bun run ${CLAUDE_PLUGIN_ROOT}/skills/edit-image/scripts/edit.ts photo.jpg "add a sunset sky" --mask sky_mask.png --mode inpaint
Outpaint to extend image
Outpaint to extend image
bun run ${CLAUDE_PLUGIN_ROOT}/skills/edit-image/scripts/edit.ts photo.jpg "extend the landscape" --mode outpaint
bun run ${CLAUDE_PLUGIN_ROOT}/skills/edit-image/scripts/edit.ts photo.jpg "extend the landscape" --mode outpaint
Edit with negative prompt
Edit with negative prompt
bun run ${CLAUDE_PLUGIN_ROOT}/skills/edit-image/scripts/edit.ts portrait.png "fix the teeth to look natural" --negative "gap in teeth, missing teeth"
bun run ${CLAUDE_PLUGIN_ROOT}/skills/edit-image/scripts/edit.ts portrait.png "fix the teeth to look natural" --negative "gap in teeth, missing teeth"
Replace object with multiple variations
Replace object with multiple variations
bun run ${CLAUDE_PLUGIN_ROOT}/skills/edit-image/scripts/edit.ts scene.jpg "replace the car with a bicycle" --count 3
undefinedbun run ${CLAUDE_PLUGIN_ROOT}/skills/edit-image/scripts/edit.ts scene.jpg "replace the car with a bicycle" --count 3
undefinedContext Discipline
上下文规范
Do not read generated images back into context. The script outputs only the file path. Ask the user to visually inspect the result. To inspect programmatically, optimize the image first (via the optimize-images skill) to avoid filling the context window with large uncompressed image data.
请勿将生成的图片重新读入上下文。 脚本仅输出文件路径。请让用户自行视觉检查结果。如果需要以编程方式检查,请先通过optimize-images skill优化图片,避免大尺寸未压缩图片数据填满上下文窗口。
Prompt Tips
提示词技巧
- Be specific: "Change only the sky to golden hour lighting" works better than "make it look better"
- Describe preservation: The tool automatically adds "keep everything else the same" but you can be more specific
- Use negative prompts: helps avoid unwanted artifacts
--negative "blurry, distorted" - Iterate: Generate a few variations with and pick the best one
--count 2
- 具体明确:“仅将天空改为黄金时段的光线效果”比“让它看起来更好”效果更佳
- 描述保留内容:工具会自动添加“保持其他所有内容不变”,但你可以更具体地说明
- 使用负面提示词:有助于避免不想要的瑕疵
--negative "blurry, distorted" - 多次迭代:使用生成几个变体,然后选择最佳的一个
--count 2
Model
模型
Uses - Nano Banana Pro, Google's professional image generation and editing model. No Vertex AI credentials required.
gemini-3-pro-image-previewLast verified: February 2026. If a newer generation exists, STOP and suggest a PR to. See the ask-gemini skill'sb-open-io/gemskillsfor current models and Google's officialreferences/gemini-api.mdskill for the canonical source.gemini-api-dev
使用——Nano Banana Pro,谷歌的专业图片生成与编辑模型。无需Vertex AI凭据。
gemini-3-pro-image-preview最后验证时间:2026年2月。如果有更新的模型版本,请停止使用并建议向提交PR。有关当前模型的信息,请查看ask-gemini skill的b-open-io/gemskills,或参考谷歌官方的references/gemini-api.mdskill作为权威来源。gemini-api-dev