gpt-image-skill

Generate and edit images using OpenAI GPT Image models via a Python script.

1.6k|245|Updated Jul 18, 2025
One-click install
npx skills add https://github.com/feiskyer/claude-code-settings --skill gpt-image-skill
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: gpt-image-skill
Source: https://github.com/feiskyer/claude-code-settings/tree/main/skills/gpt-image-skill
Command: npx skills add https://github.com/feiskyer/claude-code-settings --skill gpt-image-skill

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill requires python-dotenv, openai, Pillow, httpx.

What problem does it solve?

It lets you create or edit images directly from your AI coding session using OpenAI's GPT Image API, without writing API calls or handling base64 image data yourself.

Core Features & Use Cases

  • Text-to-Image Generation: Generate images from prompts with control over model (gpt-image-2, gpt-image-1.5, gpt-image-1, gpt-image-1-mini), size, quality, format, and background transparency.
  • Image Editing: Edit up to three reference images at once with natural-language instructions, such as adding elements or combining items into a new composition.
  • Use Case: Ask for a minimalist logo with a transparent background, and the skill runs the bundled Python script with the right flags and saves the PNG to your chosen filename.

Quick Start

Ask the assistant to generate an image with OpenAI, for example: use gpt image to create a watercolor painting of a cat reading a book in a cozy library.

Frequently Asked Questions about gpt-image-skill

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I generate an image with the OpenAI GPT Image API?

Run the bundled script with a prompt, for example: python3 gpt_image.py --prompt "a mountain landscape at sunset" --output image.png. You can also set size, quality, format, and model flags to control the output.

How do I edit an existing image with GPT Image?

Use the edit subcommand with one to three input images and a prompt describing the change, for example: python3 gpt_image.py edit --prompt "add a rainbow" --input photo.png --output edited.png.

Which GPT Image models and sizes are supported?

Supported models are gpt-image-2 (default), gpt-image-1.5, gpt-image-1, and gpt-image-1-mini. Sizes include 1024x1024 square, 1024x1536 portrait, 1536x1024 landscape, or auto.

Can I use a custom OpenAI-compatible endpoint or Azure OpenAI?

Yes. Set OPENAI_API_BASE in ~/.gpt-image.env or as an environment variable to point the client at a custom base URL such as Azure OpenAI or a proxy, alongside your OPENAI_API_KEY.

Why does the image generation script fail with an API key error?

The script exits if OPENAI_API_KEY is not set. Configure it in ~/.gpt-image.env or export it in your shell, and verify the key is valid for the chosen endpoint.

When should I not use this skill for image tasks?

Do not use it for generic image requests without an explicit OpenAI/GPT provider mention, and do not use it for diagrams such as architecture or flow charts, which should be drawn with Mermaid or code instead.