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…

INSTALLATION
npx skills add https://github.com/gargantuax/openskills --skill gpt-image-2
Run in your project or agent environment. Adjust flags if your CLI version differs.

SKILL.md

$27

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

BrowserAct

Let your agent run on any real-world website

Bypass CAPTCHA & anti-bot for free. Start local, scale to cloud.

Explore BrowserAct Skills →

Stop writing automation&scrapers

Install the CLI. Run your first Skill in 30 seconds. Scale when you're ready.

Start free
free · no credit card