Gpt Image Skill
Generate or edit images using OpenAI GPT Image API (gpt-image-2, gpt-image-1, etc).
Install
npx skills add feiskyer/claude-code-settings --skill gpt-image-skill -g -a claude-code -y- Repository
- feiskyer/claude-code-settings1.7k
- Category
- Media
- Updated
- 1mo ago
- License
- MIT
- Context cost
- Lightabout 1,233 tokens
- Runs scripts
- Yes, review before use
What it does
Generate or edit images using OpenAI GPT Image API (gpt-image-2, gpt-image-1, etc). Use ONLY when the user explicitly names OpenAI or GPT as the provider: "gpt image", "openai image", "generate image with openai", "用 openai 画图", "用 GPT 生成图片". For generic image requests without a provider, use nanobanana-skill instead. Do NOT use for diagrams (架构图/流程图), draw those with Mermaid or code.
GPT Image Skill
Generate or edit images using OpenAI's GPT Image models through a bundled Python script.
Requirements
- OPENAI_API_KEY: Must be configured in
~/.gpt-image.envorexport OPENAI_API_KEY=<your-key> - OPENAI_API_BASE (optional): Custom API base URL for compatible endpoints (e.g. Azure OpenAI, proxies). Set in
~/.gpt-image.envor export it. - Python3 with dependencies: openai, Pillow. Install via
python3 -m pip install -r ${CLAUDE_SKILL_DIR}/requirements.txtif not installed yet. - Executable:
${CLAUDE_SKILL_DIR}/gpt_image.py
Instructions
For image generation
-
Ask the user for:
- What they want to create (the prompt)
- Desired size (optional, defaults to 1024x1024)
- Output filename (optional, auto-generates UUID-based name if not specified)
- Model preference (optional, defaults to gpt-image-2)
- Quality (optional, defaults to auto)
- Number of images (optional, defaults to 1)
-
Run the script:
python3 ${CLAUDE_SKILL_DIR}/gpt_image.py --prompt "description of image" --output "filename.png" -
Show the user the saved image path when complete.
For image editing
-
Ask the user for:
- Input image file(s) to edit (up to 3)
- What changes they want (the prompt)
- Output filename (optional)
-
Run with input images:
python3 ${CLAUDE_SKILL_DIR}/gpt_image.py edit --prompt "editing instructions" --input image1.png image2.png --output "edited.png"
Available Options
Models (--model)
gpt-image-2(default), Latest model with strong instruction following, text rendering, and broad world knowledgegpt-image-1.5, Mid-tier modelgpt-image-1, First-generation GPT image modelgpt-image-1-mini, Lightweight, faster generation
Sizes (--size)
1024x1024(default), Square1024x1536, Portrait (2:3)1536x1024, Landscape (3:2)auto, Let the model decide


