AI Agent Hub
Back to skills
GPT-image2 Image Generation icon

GPT-image2 Image Generation

Design & Media Updated 2026.08.30

Paste the following prompt into your AI chat to install this skill:

Please follow https://skillhub.cn/install/skillhub.md to install @redfox-data/image-gen-redfox.

About this skill

Problem

When you want to move image generation from a web UI into scripts, pipelines, or batch jobs, calling OpenAI's gpt-image-2 directly means handling authentication, task submission, polling, and file output. This skill condenses that flow into a local script: provide a prompt to generate an image, or use a reference image for editing. It is useful for terminal-based prototyping, asset variants, and automated image generation.

How It Works

  • Text-to-image: use prompt to describe the scene and output PNG, JPEG, or WebP.
  • Image-to-image: pass a reference image with --image, then use --fidelity high/low to decide whether to preserve detail or allow larger changes.
  • Parameterized output: supports whitelisted sizes, up to 10 images per run, --bg transparent for transparent backgrounds, and --compression for quality control.
  • Task control: use --no-download to submit without waiting, and --task-id to inspect existing tasks, which helps integrate generation into longer workflows.

The script submits the request, waits for completion, and saves the result to the configured output directory.

Boundaries

  • Use only the listed fast and high-resolution sizes; custom resolutions may be slow or fail.
  • prompt is limited to 500 characters; reference images are currently PNG, JPEG, or WebP.
  • Transparent output requires PNG or WebP; JPEG does not support transparency.
  • Generation usually takes about 10–30 seconds per image, with longer waits for complex scenes or batch jobs.

Use Cases

  • Generate multiple product concept images from a prompt in a terminal script and save them to a directory.
  • Edit a reference image with image-to-image mode, using fidelity to control how much detail is preserved.
  • Create transparent-background assets for icons, stickers, or UI graphics using PNG or WebP output.
  • Submit image generation jobs in automation without blocking, then query results later by task ID.

Best For

  • Frontend engineers who need to embed image generation in local scripts or pipelines
  • UI designers who batch-produce transparent-background icons and assets
  • Independent developers who want rapid style variants from reference images
  • Technical operators who maintain automated image jobs and track task results