image-generation
它能做什么
它教你的智能体使用图像工具制作图片,并在多轮对话中修改它们。适合希望通过描述想要的内容来创建或修改图片的人。
适用场景
- ✓当你要求根据描述绘制一张图片、插图或设计的时候。
- ✓当你想修改已保存的图片,例如更换背景或光线的时候。
- ✓当你想获得上一次生成图片的另一个版本的时候。
技能链接
https://github.com/HKUDS/nanobot/blob/main/nanobot/skills/image-generation/SKILL.md复制后粘贴给你的 AI(Claude、ChatGPT 或 Cursor),让它按照说明操作。
使用方法
最简单的方法:复制下面的消息,粘贴给你的 AI。它会读取这个技能并按说明操作。
可直接粘贴的消息
适用于 Claude Code、Codex 或 Cursor:在项目文件夹中运行,即可安装该技能。
下载 SKILL.md,放进智能体的技能文件夹。
可以这样问 AI
“你能用暖色调画一幅温馨的咖啡馆插画,然后把背景调亮吗?”
每周 5 个新技能,1 分钟读完。
工作原理
智能体根据你的请求编写详细的提示,并调用图像工具。生成的图片会保存为文件,智能体再把它们发回给你。
技术内容(原始 SKILL.md)
作者在 GitHub 上的英文原文。
Image Generation
Use the generate_image tool when the user asks you to create, render, draw, design, generate, or edit an image.
If the generate_image tool is not available in the current tool list, tell the user that image generation is not enabled for this nanobot instance.
When To Use
- Text-to-image: call
generate_imagewith a concreteprompt. - Image editing: pass the saved artifact path or user image path in
reference_images. - Iterative edits in the same conversation: prefer the most recent generated image artifact if the user says things like "make it brighter", "change the background", or "try another version".
- Ambiguous edits: ask a short clarifying question if multiple recent images could be the target.
- After generating images, call the
messagetool with the artifact paths in themediaparameter to deliver them to the user.
Prompt Rules
Write prompts with enough detail for image models:
- Subject and scene.
- Composition and camera or layout.
- Style, mood, lighting, and color palette.
- Text that must appear in the image, quoted exactly.
- Constraints such as "keep the same character", "preserve the logo", or "do not change the background".
Artifact Rules
The tool stores generated images as persistent artifacts under nanobot's media directory and returns structured metadata:
id: generated image id, such asimg_ab12cd34ef56.path: local file path for internal follow-up edits.mime: image MIME type.prompt,model, andsource_images: provenance for follow-up edits.
In normal user-facing replies, do not expose local filesystem paths. Keep the reply natural, for example "Done, I generated it." You may include the short image id when it helps the user refer to a specific image, but keep raw path internal unless the user explicitly asks for debug details or a local artifact reference. Never paste base64.
For follow-up edits, pass the prior artifact path to reference_images. If the user provides a new uploaded image, use that path as the reference instead.
Do not include internal replay markers such as [Message Time: ...], [image: /local/path], generate_image(...), or message(...) in user-facing replies.
Examples
Generate a new image:
generate_image(
prompt="A minimal app icon for nanobot: friendly robot head, rounded square, soft blue and white palette, clean vector style, no text",
aspect_ratio="1:1",
image_size="1K"
)
Edit the latest generated artifact:
generate_image(
prompt="Use the reference image. Keep the same robot and composition, but change the palette to warm orange and add a subtle sunrise background.",
reference_images=["/home/user/.nanobot/media/generated/2026-05-08/img_ab12cd34ef56.png"],
aspect_ratio="1:1",
image_size="1K"
)
常见问题
图像生成功能是否始终开启?
不是。该技能说明,如果图像工具未在此实例中启用,智能体必须告知你。
我可以编辑我上传的照片吗?
可以。你可以把已保存的图片或你自己的图片作为参考,用于编辑。
什么样的图像提示效果好?
该技能建议说明主体、构图、风格、光线、颜色,以及应出现的任何确切文字。
详情
热度
- GitHub 星标
- 50k
- 排名
- #3598
- 许可证
- MIT
- 更新时间
- 2026/11/2
评论
- …