设计与多媒体

gpt-image-2

gargantuax/openskills

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.

  • 1.7万 次安装
  • 7 星标
  • 收录于

安装命令

npx skills add https://github.com/gargantuax/openskills --skill gpt-image-2

要点

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

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 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: