All skills
openai avatar

/imagegen

@0ebe69a official
by openaiopenai/skills28k stars
1,891

Generate or edit raster images when the task benefits from AI-created bitmap visuals such as photos, illustrations, textures, sprites, mockups, or transparent-background cutouts. Use when Codex should create a brand-new image, transform an existing image, or derive visual variants from references, and the output should be a bitmap asset rather than repo-native code or vector. Do not use when the task is better handled by editing existing SVG/vector/code-native assets, extending an established icon or logo system, or building the visual directly in HTML/CSS/canvas.

Use this Skill: https://skilld.dev/gh/openai/skills/imagegen

This session only. Nothing lands on disk.

referencesimage-api.md

≈625 tokens on demand. Your agent reads this file only when SKILL.md points to it.

Image API quick reference

This file is for the fallback CLI mode only. Use it only after the user explicitly asks to use scripts/image_gen.py instead of the built-in image_gen tool.

These parameters describe the Image API and bundled CLI fallback surface. Do not assume they are normal arguments on the built-in image_gen tool.

Scope

  • This fallback CLI is intended for GPT Image models (gpt-image-1.5, gpt-image-1, and gpt-image-1-mini).
  • The built-in image_gen tool and the fallback CLI do not expose the same controls.

Endpoints

  • Generate: POST /v1/images/generations (client.images.generate(...))
  • Edit: POST /v1/images/edits (client.images.edit(...))

Core parameters for GPT Image models

  • prompt: text prompt
  • model: image model
  • n: number of images (1-10)
  • size: 1024x1024, 1536x1024, 1024x1536, or auto
  • quality: low, medium, high, or auto
  • background: output transparency behavior (transparent, opaque, or auto) for generated output; this is not the same thing as the prompt's visual scene/backdrop
  • output_format: png (default), jpeg, webp
  • output_compression: 0-100 (jpeg/webp only)
  • moderation: auto (default) or low

Edit-specific parameters

  • image: one or more input images. For GPT Image models, you can provide up to 16 images.
  • mask: optional mask image
  • input_fidelity: low (default) or high

Model-specific note for input_fidelity:

  • gpt-image-1 and gpt-image-1-mini preserve all input images, but the first image gets richer textures and finer details.
  • gpt-image-1.5 preserves the first 5 input images with higher fidelity.

Output

  • data[] list with b64_json per image
  • The bundled scripts/image_gen.py CLI decodes b64_json and writes output files for you.

Limits and notes

  • Input images and masks must be under 50MB.
  • Use the edits endpoint when the user requests changes to an existing image.
  • Masking is prompt-guided; exact shapes are not guaranteed.
  • Large sizes and high quality increase latency and cost.
  • High input_fidelity can materially increase input token usage.
  • If a request fails because a specific option is unsupported by the selected GPT Image model, retry manually without that option.

Important boundary

  • quality, input_fidelity, explicit masks, background, output_format, and related parameters are fallback-only execution controls.
  • Do not assume they are built-in image_gen tool arguments.

Source: SKILL.md on GitHub

1 warning16d5 checks · Risk SAFE
  • Gen Agent Trust Hub16d

    This skill provides capabilities for image generation and editing using a built-in tool or an explicit CLI fallback. A review of the files indicates that standard practices are followed, including secure handling of API keys via environment variables and path sanitization to avoid path traversal concerns.

  • Socket16d

    No alerts

  • Snyk16d

    Risk: LOW · No issues

  • Runlayer7mo

    6/9 files flagged

  • ZeroLeaks5mo

    Score: 93/100 · 2 sections analyzed

Signed by skilld at 0ebe69a. This ties the file your Agent reads to that commit on GitHub. It does not review the instructions.

Last checked against GitHub 2 months ago.

Activeupdated 6 months ago
  • image-generation
  • ai-image
  • openai
  • asset-creation
  • photo-mockup
  • illustration
  • editing
  • texture
  • sprite

README badge

README badge for openai/skills/imagegen

Generates or edits bitmap images for projects using a built-in tool by default, with a fallback CLI mode available on request. Targets product mockups, website assets, UI mockups, game sprites, concept art, and image editing tasks like background removal or object replacement. Does not handle vector graphics, icon systems, or code-native visual assets.

Generated from the current SKILL.md.

Does this skill work with local image files?
Yes. For editing local files with the built-in tool, first load the image with the `view_image` tool so it appears in conversation context, then proceed with the edit. For direct file-path control and advanced parameters, use the explicit CLI fallback mode (which requires OPENAI_API_KEY) only when explicitly requested.
What's the difference between the built-in tool and the CLI fallback?
The built-in `image_gen` tool is the default for normal generation and editing; it does not require an API key. The CLI fallback (`scripts/image_gen.py`) offers subcommands like `generate-batch` and explicit parameters like masks and input fidelity, but only use it if you explicitly ask for the CLI path and set OPENAI_API_KEY.
Where are generated images saved by default?
Generated images are saved under `$CODEX_HOME/generated_images/` by default. For project-bound assets, they must be moved or copied into the workspace before finishing; do not leave project-referenced assets only at the default path.
Can I generate multiple image variants in one request?
Yes. In built-in mode, issue one `image_gen` call per variant. In explicit CLI mode, use the `generate-batch` subcommand if you need to generate many prompts at once.
Should I use this skill for SVG icons or logos that match existing repo code?
No. For icons, logos, or UI graphics that should match existing SVG/vector/code-native assets in the repo, edit those directly instead. Use this skill when you need raster output like photos, illustrations, sprites, mockups, or transparent-background cutouts.

Generated from the current SKILL.md. These answers refresh after source changes.