Now liveThe Skillselion MCP - thousands of ranked skills, loaded into your agent mid-task. No install.Get it →
gargantuax avatar

Gpt Image 2

  • 16.8k installs
  • 4 repo stars
  • Updated April 22, 2026
  • gargantuax/openskills

GPT Image 2 is a skill providing complete coverage of OpenAI's image generation, editing, and Responses APIs with validation and streaming.

About

Full OpenAI-compatible GPT Image 2 coverage across images/generations, images/edits, and Responses API with image_generation tool. Handles text-to-image generation, mask edits, multi-image batches, streaming outputs, and mixed text+image Responses. Includes strict pre-flight validation of model constraints. Works with OpenAI API or any OpenAI-compatible gateway. Supports both Markdown and SRT output formats for transcript content.

  • Three API routes: text-to-image generations, image edits with masks, Responses API with streaming
  • Strict pre-flight validation of model size, aspect, and feature constraints
  • Multi-image batching, partial image streaming, and mixed text+image Responses flows

Gpt Image 2 by the numbers

  • 16,771 all-time installs (skills.sh)
  • +33 installs in the week ending Aug 5, 2026 (Skillselion tracking)
  • Ranked #79 of 1,335 Generative Media skills by installs in the Skillselion catalog
  • Security screen: LOW risk (skills.sh audit)
  • Data as of Aug 5, 2026 (Skillselion catalog sync)
At a glance

gpt-image-2 capabilities & compatibility

Capabilities
image generation · image editing · streaming · batch processing · api integration
Works with
openai
Use cases
image generation
From the docs

What gpt-image-2 says it does

Full OpenAI-compatible GPT Image 2 coverage across images/generations, images/edits, and responses with the image_generation tool.
SKILL.md
A single Python entrypoint that covers every GPT Image 2 route, with strict pre-flight validation of the model's size, aspect, and feature constraints.
SKILL.md
npx skills add https://github.com/gargantuax/openskills --skill gpt-image-2

Add your badge

Show developers this skill is listed on Skillselion. Paste this into your README.

Listed on Skillselion
Installs16.8k
repo stars4
Security audit3 / 3 scanners passed
Last updatedApril 22, 2026
Repositorygargantuax/openskills

How do you call GPT Image 2 from an agent?

Generate, edit, and stream images using OpenAI's GPT Image 2 API with advanced features like masking, batching, and streaming.

Who is it for?

Developers building image generation features; teams integrating OpenAI image APIs

Skip if: Projects not using OpenAI or OpenAI-compatible APIs

When should I use this skill?

The user asks to generate, edit, or stream GPT Image 2 images via OpenAI-compatible API inside an agent session.

What you get

Generated images, edited image files, streamed partial previews, and responses API image_generation tool outputs.

  • Generated image files
  • Edited image outputs
  • Streaming image streams

By the numbers

  • Covers 3 API routes: generations, edits, responses
  • Supports up to 3 partial images in streaming

Files

SKILL.mdMarkdownGitHub ↗

GPT Image 2

A single Python entrypoint that covers every GPT Image 2 route, with strict pre-flight validation of the model's size, aspect, and feature constraints.

Workflow

1. Open references/config.md to pick environment variables and defaults. 2. Open references/api-surface.md to choose between generations, edits, and responses. 3. Prefer OPENAI_BASE_URL=https://api.openai.com/v1 unless the user asks for a different OpenAI-compatible endpoint. 4. Use gpt-image-2 for generations and edits; use a text-capable Responses model such as gpt-5.4 for responses. 5. Run scripts/gpt_image.py with one of the three subcommands. 6. Add --dry-run first when the payload shape is the main risk. 7. Add --save-response <path> when the raw JSON body or SSE event stream needs to be kept for debugging.

Commands

Text-to-image through the public Images API:

python .\skills\gpt-image-2\scripts\gpt_image.py generations `
  --prompt "A bold product hero image for a developer tool homepage" `
  --output .\out\hero.png `
  --size 1536x1024 `
  --quality high `
  --format png

Multi-image batch with a filename pattern:

python .\skills\gpt-image-2\scripts\gpt_image.py generations `
  --prompt "A cinematic city skyline at night" `
  --output .\out\skyline-{index}.webp `
  --n 3 `
  --format webp `
  --compression 90

Image edits with two inputs plus a mask:

python .\skills\gpt-image-2\scripts\gpt_image.py edits `
  --prompt "Blend the two references into one clean marketing illustration" `
  --image .\refs\subject.png `
  --image .\refs\background.png `
  --mask .\refs\mask.png `
  --output .\out\edit-{index}.png `
  --image-field-style brackets `
  --n 2

Responses API with streaming and partial previews:

python .\skills\gpt-image-2\scripts\gpt_image.py responses `
  --input-text "Generate a poster for an AI developer summit" `
  --model gpt-5.4 `
  --output .\out\poster-{index}.png `
  --stream `
  --partial-images 2 `
  --save-response .\out\poster-events.json

Responses API edit with a local image plus a mask:

python .\skills\gpt-image-2\scripts\gpt_image.py responses `
  --input-text "Turn this product shot into a clean studio ad" `
  --model gpt-5.4 `
  --input-image .\refs\product.png `
  --mask .\refs\mask.png `
  --output .\out\studio.png `
  --action edit

Inspect the built request without sending it:

python .\skills\gpt-image-2\scripts\gpt_image.py generations `
  --prompt "A minimal cover image" `
  --output .\out\cover.png `
  --dry-run

Rules

  • Use generations for public text-to-image calls.
  • Use edits for multipart image edits and mask uploads.
  • Use responses for advanced flows: streaming, mixed text + image input, previous_response_id, tool_choice, action, and optional tool_model.
  • Process environment variables override .env; CLI flags override both.
  • Never print secrets.
  • --output takes either a single path or a pattern such as image-{index}.png for multi-image or streaming flows.
  • responses uses a top-level Responses model separate from the image model; default it to gpt-5.4 unless you need another text-capable model.
  • quality on Responses tool flows is passed through, but final behavior still depends on the hosted image tool.
  • On OpenAI GPT image models, omit response_format; image data already comes back as base64.
  • Fail fast on unsupported gpt-image-2 combinations: transparent background, invalid size, partial_images outside 0..3, or stream=true with n>1 on public Images routes.

Resources

  • Script: scripts/gpt_image.py
  • Config reference: references/config.md
  • API surface reference: references/api-surface.md

Related skills

FAQ

What are the three API routes?

generations for text-to-image, edits for multipart image editing with masks, and responses for advanced flows with streaming and mixed text+image input.

Do I need to handle constraints manually?

No - the script includes strict pre-flight validation of model size, aspect ratio, and feature constraints.

Is Gpt Image 2 safe to install?

skills.sh reports 3 of 3 security scanners passed. Review the Security Audits panel on this page before installing in production.

Generative Mediallmresearchautomation

This week in AI coding

Five minutes, every Monday - the tools, releases and tactics for developers.

unsubscribe anytime.