gargantuax/openskills

gpt-image-2

Full OpenAI-compatible GPT Image 2 coverage across images/generations, images/edits, and responses with the image_generation tool. Use when the one-shot image helper is not enough - text-to-image, mask edits, multi-image batches, streaming, partial_images, and mixed text+image Responses flows. Reads .env and respects process environment variables; works with any OpenAI-compatible gateway.

All-time #1076 First seen Apr 22, 2026
8-week activity · all time api

Installation

$ npx skills add gargantuax/openskills --skill gpt-image-2

Summary

  • Full OpenAI-compatible GPT Image 2 API coverage with text-to-image, edits, and streaming responses.
  • Three subcommands cover all routes: generations for text-to-image, edits for mask-based image manipulation, and responses for streaming and mixed text+image flows Strict pre-flight validation enforces model constraints on size, aspect ratio, and feature combinations; includes --dry-run mode to inspect payloads before sending Supports multi-image batches, partial image previews, SSE streaming, and OpenAI-compatible gateways via environment variables or CLI flags Output patterns like image-{index}.png handle both single and batch workflows; raw JSON responses can be saved for debugging

Similar popular skills

Related neighbors and high-traction skills in the same topics — useful to compare before installing.

Security audits

Partner security reviews for this skill.

agent-trust-hub SAFE

Analyzed Apr 24, 2026

This skill is a Python-based utility for interacting with OpenAI-compatible Image APIs (GPT Image 2). It provides subcommands for image generation, multipart edits, and streaming responses using only the Python standard library. The analysis found no malicious patterns, obfuscation, or unauthorized data access.

snyk LOW

Analyzed Apr 24, 2026

No issues detected.

socket Score 0.9000 · 0 alerts

Analyzed Apr 24, 2026

  • license 1
  • maintenance 1
  • quality 0.9
  • supply chain 0.98
  • vulnerability 1

0 alerts

Also in this package

Other skills from gargantuax/openskills.

npx skills add gargantuax/openskills

Browse all from gargantuax/openskills

More details

Agent compatibility

Declared targets from SKILL.md / docs. Unmarked agents are not listed — the skill may still install via the CLI.

Claude Code Not declared
Cursor Not declared
Codex Not declared
GitHub Copilot Not declared
Windsurf Not declared
Gemini CLI Not declared
Cline Not declared
OpenCode Not declared

Repository health

Stars 5
License LICENSE
Default branch main
Open issues 1
Status Active

Package contents

Files included with this skill beyond the listing page.

  • skill md SKILL.md 4,345 B
  • docs README.md 6,113 B
  • docs SUMMARY.md 410 B

History

  1. First seen on skills.sh
  2. First recorded snapshot · 16,820 installs

Videos

Tutorials, guides, and showcases specifically about this skill.

SKILL.md

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](./references/config.md) to pick environment variables and defaults.
  2. Open [references/api-surface.md](./references/api-surface.md) to choose between generations, edits, and responses.
  3. Prefer OPENAIBASEURL=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, previousresponseid, toolchoice, action, and optional toolmodel.
  • 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/gptimage.py](./scripts/gptimage.py)
  • Config reference: [references/config.md](./references/config.md)
  • API surface reference: [references/api-surface.md](./references/api-surface.md)