imagegen

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese

Image Generation Skill

图像生成Skill

This skill enables AI-powered image generation, editing, and asset creation using Google Gemini (Gemini) and OpenAI GPT-Image.
本Skill支持借助Google Gemini(Gemini)和OpenAI GPT-Image实现AI驱动的图像生成、编辑及资产创建。

When to Use

使用场景

Activate this skill when the user wants to:
  • Generate images from text descriptions
  • Edit or modify existing images
  • Create project assets (icons, favicons, social images)
  • Generate design inspiration (moodboards)
  • Create consistent character designs
  • Compare different AI image providers
当用户有以下需求时,可激活本Skill:
  • 根据文本描述生成图像
  • 编辑或修改现有图像
  • 创建项目资产(图标、网站图标、社交平台配图)
  • 生成设计灵感(情绪板)
  • 创建风格统一的角色设计
  • 对比不同AI图像生成服务商

Available Commands

可用命令

CommandUse For
/imagegen:generate
Generate images from prompts
/imagegen:edit
Edit existing images
/imagegen:iterate
Refine images through multiple steps
/imagegen:compare
Compare Google vs OpenAI
/imagegen:assets
Generate project assets
/imagegen:moodboard
Create design inspiration sets
/imagegen:character
Create consistent character sheets
/imagegen:config
Configure defaults
命令用途
/imagegen:generate
根据提示词生成图像
/imagegen:edit
编辑现有图像
/imagegen:iterate
通过多步骤优化图像
/imagegen:compare
对比Google与OpenAI的生成效果
/imagegen:assets
生成项目资产
/imagegen:moodboard
创建设计灵感集合
/imagegen:character
创建风格统一的角色设定图
/imagegen:config
配置默认参数

Delegation

任务委派

For complex image generation tasks, delegate to the
image-generator
subagent which has access to all generation scripts and can handle multi-step workflows.
对于复杂的图像生成任务,可委派给
image-generator
子Agent,该子Agent可访问所有生成脚本,能处理多步骤工作流。

Quick Reference

快速参考

Providers

服务商

Google Gemini (Gemini)
  • Models:
    gemini-2.5-flash-image
    ,
    gemini-3-pro-image-preview
  • Best for: Character consistency, multi-turn iteration, style variety
  • API Key:
    GEMINI_API_KEY
    or
    GOOGLE_API_KEY
OpenAI GPT-Image
  • Models:
    gpt-image-1.5
    ,
    gpt-image-1
    ,
    gpt-image-1-mini
  • Best for: Text in images, transparent backgrounds, precise edits
  • API Key:
    OPENAI_API_KEY
Google Gemini (Gemini)
  • 模型:
    gemini-2.5-flash-image
    ,
    gemini-3-pro-image-preview
  • 优势:角色风格一致性、多轮迭代、风格多样性
  • API密钥:
    GEMINI_API_KEY
    GOOGLE_API_KEY
OpenAI GPT-Image
  • 模型:
    gpt-image-1.5
    ,
    gpt-image-1
    ,
    gpt-image-1-mini
  • 优势:图像中添加文字、透明背景、精准编辑
  • API密钥:
    OPENAI_API_KEY

Common Sizes/Aspect Ratios

常见尺寸/宽高比

FormatGoogleOpenAI
Square1:11024x1024
Landscape16:91536x1024
Portrait9:161024x1536
Wide21:9-
格式GoogleOpenAI
方形1:11024x1024
横版16:91536x1024
竖版9:161024x1536
宽屏21:9-

Example Interactions

交互示例

User: "Generate an image of a sunset over mountains" Action: Use
/imagegen:generate --prompt "A sunset over mountains"
User: "Create app icons for my project" Action: Use
/imagegen:assets --type icons --prompt "[ask for description]"
User: "Edit this image to add rain" Action: Use
/imagegen:edit --image [path] --prompt "Add rain falling"
User: "I want to iterate on this design" Action: Use
/imagegen:iterate --image [path] --prompt "[refinement]"
User: "Which provider would be better for logos?" Action: Explain Google is better for style variety, OpenAI for text, and suggest
/imagegen:compare
to test both.
用户:“生成一张山脉日落的图像” 操作:使用
/imagegen:generate --prompt "A sunset over mountains"
用户:“为我的项目创建应用图标” 操作:使用
/imagegen:assets --type icons --prompt "[询问具体描述]"
用户:“编辑这张图片,添加下雨效果” 操作:使用
/imagegen:edit --image [路径] --prompt "Add rain falling"
用户:“我想优化这个设计” 操作:使用
/imagegen:iterate --image [路径] --prompt "[优化需求]"
用户:“哪个服务商更适合生成logo?” 操作:说明Google更适合风格多样性,OpenAI更适合添加文字,并建议使用
/imagegen:compare
来测试两者效果。

Prerequisites Check

前置检查

Before generating, verify:
  1. Required Python packages:
    google-genai
    ,
    openai
    ,
    Pillow
    (for resizing)
  2. API keys set in environment
  3. Output directory accessible
bash
undefined
生成图像前,请确认:
  1. 已安装必要的Python包:
    google-genai
    ,
    openai
    ,
    Pillow
    (用于调整尺寸)
  2. 已在环境变量中配置API密钥
  3. 输出目录可访问
bash
undefined

Install packages

安装依赖包

pip install google-genai openai Pillow
pip install google-genai openai Pillow

Set API keys (user's responsibility)

设置API密钥(由用户自行负责)

export GEMINI_API_KEY=your_key export OPENAI_API_KEY=your_key
undefined
export GEMINI_API_KEY=your_key export OPENAI_API_KEY=your_key
undefined

Prompt Tips

提示词技巧

Help users craft effective prompts:
  • Be descriptive but concise
  • Specify style (photorealistic, watercolor, minimalist)
  • Include lighting (golden hour, dramatic, soft)
  • Mention composition (close-up, wide shot, centered)
  • For characters, include distinctive features
  • For logos, specify simplicity level
帮助用户编写有效的提示词:
  • 描述清晰且简洁
  • 指定风格(写实、水彩、极简)
  • 说明光线效果(黄金时刻、戏剧性光影、柔和光线)
  • 提及构图(特写、广角、居中构图)
  • 角色类提示词需包含独特特征
  • Logo类提示词需指定简洁程度