AI图像生成与编辑。支持文生图、图+文生图、风格转换。当用户要求画图、生成图片、编辑图片、图片风格转换时使用此 skill。支持多种比例(1:1、3:2、16:9、21:9 等)和分辨率(标准、2K、4K)。
数据来源:ClawHub。 在 ClawSkills 查看
选择你使用的 Agent
方法一:命令行安装(推荐)
推荐(无需提前安装 clawhub)
npx clawhub@latest --dir ~/.claude/skills install ai-image-gen或使用 clawhub CLI(需提前安装)
clawhub --dir ~/.claude/skills install ai-image-gen⚠️ 需要 Node.js 18+,没有 Node?请使用下方方法二直接下载 ZIP。 安装 Node.js →
方法二:手动下载安装(无需 Node)
下载 ZIP,解压后将文件夹放到以下路径,重启 Agent 即可:
安装路径
~/.claude/skills/ai-image-gen/💡解压后将文件夹放到上方路径,重启 Agent 即可生效
--- name: image-gen description: AI图像生成与编辑。支持文生图、图+文生图、风格转换。当用户要求画图、生成图片、编辑图片、图片风格转换时使用此 skill。支持多种比例(1:1、3:2、16:9、21:9 等)和分辨率(标准、2K、4K)。 ---
通过执行脚本调用 Gemini Flash Image API 生成图片。
脚本通过以下环境变量获取 API 配置:
IMAGE_GEN_API_KEY — API 密钥IMAGE_GEN_BASE_URL — API 基础地址(默认:https://code.newcli.com/gemini)执行脚本生成图片:
export IMAGE_GEN_API_KEY="your-api-key"
export IMAGE_GEN_BASE_URL="https://code.newcli.com/gemini"
python3 scripts/generate_image.py "你的提示词" --model gemini-3.1-flash-image-2k-16x9 --output output.png
prompt(必填):图片描述提示词--model, -m:模型名称,默认 gemini-3.1-flash-image-2k-16x9--output, -o:输出文件路径,默认当前目录 generated_image.png默认模型:gemini-3.1-flash-image-2k-16x9(2K 分辨率,16:9 横屏)
| 模型 ID | 比例 | 适用场景 | |---------|------|----------| | gemini-3.1-flash-image | 1:1 | 社交媒体头像 | | gemini-3.1-flash-image-3x2 | 3:2 | 横版照片 | | gemini-3.1-flash-image-2x3 | 2:3 | 竖版海报 | | gemini-3.1-flash-image-3x4 | 3:4 | 竖版海报 | | gemini-3.1-flash-image-4x3 | 4:3 | 传统比例 | | gemini-3.1-flash-image-4x5 | 4:5 | Instagram | | gemini-3.1-flash-image-5x4 | 5:4 | 传统横版 | | gemini-3.1-flash-image-9x16 | 9:16 | 手机壁纸/短视频 | | gemini-3.1-flash-image-16x9 | 16:9 | 电脑壁纸/视频 | | gemini-3.1-flash-image-21x9 | 21:9 | 超宽屏 |
| 模型 ID | 比例 | |---------|------| | gemini-3.1-flash-image-2k | 1:1 | | gemini-3.1-flash-image-2k-3x2 | 3:2 | | gemini-3.1-flash-image-2k-2x3 | 2:3 | | gemini-3.1-flash-image-2k-3x4 | 3:4 | | gemini-3.1-flash-image-2k-4x3 | 4:3 | | gemini-3.1-flash-image-2k-4x5 | 4:5 | | gemini-3.1-flash-image-2k-5x4 | 5:4 | | gemini-3.1-flash-image-2k-9x16 | 9:16 | | gemini-3.1-flash-image-2k-16x9 | 16:9 | | gemini-3.1-flash-image-2k-21x9 | 21:9 |
| 模型 ID | 比例 | |---------|------| | gemini-3.1-flash-image-4k | 1:1 | | gemini-3.1-flash-image-4k-3x2 | 3:2 | | gemini-3.1-flash-image-4k-2x3 | 2:3 | | gemini-3.1-flash-image-4k-3x4 | 3:4 | | gemini-3.1-flash-image-4k-4x3 | 4:3 | | gemini-3.1-flash-image-4k-4x5 | 4:5 | | gemini-3.1-flash-image-4k-5x4 | 5:4 | | gemini-3.1-flash-image-4k-9x16 | 9:16 | | gemini-3.1-flash-image-4k-16x9 | 16:9 |
scripts/generate_image.py 生成图片生成中国风后羿射日图:
python3 scripts/generate_image.py \
"一位英勇的古代射手后羿站在险峻的高山之巅,身披金色战甲,肌肉紧绷,拉开巨大的神弓,一支燃烧着神圣光芒的箭矢对准天空中炽热的太阳。天空中有多个太阳同时燃烧,火焰倾泻而下。背景是翻滚的云海和龟裂的大地,远山在热浪中扭曲。中国传统工笔重彩风格,水墨与金箔点缀,色彩以深红、金色、墨黑、靛蓝为主,画面气势磅礴,具有敦煌壁画的厚重感。16:9 宽幅构图。" \
--model gemini-3.1-flash-image-2k-16x9 \
--output houyi.png安装 AI Image Gen 后,可以对 AI 说这些话来触发它
Help me get started with AI Image Gen
Explains what AI Image Gen does, walks through the setup, and runs a quick demo based on your current project
Use AI Image Gen to aI image generation and editing
Invokes AI Image Gen with the right parameters and returns the result directly in the conversation
What can I do with AI Image Gen in my design & creative workflow?
Lists the top use cases for AI Image Gen, with example commands for each scenario
将技能文件夹放到 ~/.claude/skills/ai-image-gen/ 目录(个人级,所有项目可用),或 .claude/skills/ai-image-gen/(项目级)。重启 AI 客户端后,用 /ai-image-gen 主动调用,或让 AI 根据上下文自动发现并使用。
AI Image Gen 支持 Claude、Cursor、OpenClaw,可与这些 AI 平台无缝集成,扩展其能力。
AI Image Gen 可免费安装使用。请查阅仓库了解许可证信息。
AI图像生成与编辑。支持文生图、图+文生图、风格转换。当用户要求画图、生成图片、编辑图片、图片风格转换时使用此 skill。支持多种比例(1:1、3:2、16:9、21:9 等)和分辨率(标准、2K、4K)。
AI Image Gen 属于「Design & Creative」分类,该分类的技能帮助 AI 智能体在此领域执行专业任务。
Automate my design & creative tasks using AI Image Gen
Identifies repetitive steps in your workflow and sets up AI Image Gen to handle them automatically