Gpt image skill
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.From its SKILL.md
npx -y skills add feiskyer/claude-code-settings --skill gpt-image-skillAssembled from the repository path, not quoted from the project. Check it against their README if it does not work.
2 things to look at
- reads credentialsReads from 3 credential sources: `~/.gpt-image.env` and 2 more.
- runs commandsInstructs the agent to run 3 commands, including `python3 -m pip install -r ${CLAUDE_SKILL_DIR}/requirements.txt` and 2 more.
SKILL.md
5.4 KB, ~1.3k tokens by cl100k_base, as published. Nobody here has run it
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
Quality (--quality)
auto(default) — Model decides optimal qualityhigh— Higher detail, slowermedium— Balancedlow— Fastest
Output Format (--format)
png(default) — Losslessjpeg— Smaller file sizewebp— Modern format, good compression
Background (--background)
auto(default) — Model decidestransparent— Transparent background (png/webp only)opaque— Solid background
Other Options
--n <count>— Number of images to generate (default: 1)--output <filename>— Output filename (default: auto-generated)
Examples
Generate a simple image
python3 ${CLAUDE_SKILL_DIR}/gpt_image.py --prompt "A serene mountain landscape at sunset with a lake"
Generate with specific size and output
python3 ${CLAUDE_SKILL_DIR}/gpt_image.py \
--prompt "Modern minimalist logo for a tech startup" \
--size 1024x1024 \
--quality high \
--output "logo.png"
Generate landscape image
python3 ${CLAUDE_SKILL_DIR}/gpt_image.py \
--prompt "Futuristic cityscape with flying cars" \
--size 1536x1024 \
--output "cityscape.png"
Generate with transparent background
python3 ${CLAUDE_SKILL_DIR}/gpt_image.py \
--prompt "A cute cartoon cat mascot" \
--background transparent \
--format png \
--output "mascot.png"
Generate multiple images
python3 ${CLAUDE_SKILL_DIR}/gpt_image.py \
--prompt "Abstract art in the style of Kandinsky" \
--n 3 \
--output "art.png"
Edit existing images
python3 ${CLAUDE_SKILL_DIR}/gpt_image.py edit \
--prompt "Add a rainbow in the sky" \
--input photo.png \
--output "photo-with-rainbow.png"
Combine multiple reference images
python3 ${CLAUDE_SKILL_DIR}/gpt_image.py edit \
--prompt "Create a gift basket containing all items shown" \
--input item1.png item2.png item3.png \
--output "gift-basket.png"
Use a different model
python3 ${CLAUDE_SKILL_DIR}/gpt_image.py \
--prompt "Detailed portrait of a cat in watercolor style" \
--model gpt-image-1 \
--output "cat-portrait.png"
Error Handling
If the script fails:
- Check that
OPENAI_API_KEYis exported - If using a custom endpoint, verify
OPENAI_API_BASEis correct - Verify input image files exist and are readable (for editing)
- Ensure the output directory is writable
- Check that the model name is valid
Best Practices
- Be descriptive in prompts — include style, mood, colors, composition details
- For logos/icons, use square size (1024x1024) with transparent background
- For social media, use portrait (1024x1536) for stories or square for posts
- For wallpapers/headers, use landscape (1536x1024)
- Use
highquality for final output,autofor quick iterations - GPT Image models excel at text rendering — include text in prompts when needed
- For editing, provide clear instructions about what to change and what to keep
What ships with it: 3 files
6.8 KB alongside SKILL.md, 1 of them executable
evals/
- evals.json926 B
- gpt_image.pyruns5.8 KB
- requirements.txt34 B
Gives 0 of the 12 instructions most context ai engineering skills give in ~1.3k tokens
Counted across 1,328 of the 2,349 authors here whose files we hold, read 2026-09-06
- Dispatch a fresh subagent for each taskin 76 of 1328, across 59 files
- Perform spec compliance review before code quality reviewin 44 of 1328, across 34 files
- Dispatch a final code reviewer after all tasksin 38 of 1328, across 26 files
- Answer subagent questions before allowing implementationin 36 of 1328, across 26 files
- Use the least powerful model capable of the taskin 33 of 1328, across 26 files
- Create a TodoWrite list for all tasksin 32 of 1328, across 22 files
- Perform a task review after each implementationin 31 of 1328, across 24 files
- Extract all tasks and context from the planin 29 of 1328, across 20 files
- Provide full task text to subagentsin 28 of 1328, across 20 files
- Use git worktrees for isolated workspacesin 25 of 1328, across 20 files
- Specify the model explicitly when dispatching a subagentin 23 of 1328, across 18 files
- Execute all tasks from the plan without stoppingin 21 of 1328, across 16 files
Said here and by no other author read
- Ask user for prompt and image details
- Run the python script with specified arguments
- Show the user the saved image path
Grouped from the skills themselves: near-identical wordings counted once, and counted by distinct author, so one author publishing three of these counts once. Length counted with cl100k_base; the agent that loads this file may tokenize it differently.