Image Generation (imagegen)
@openaiOpenAI's imagegen skill: generate or edit raster images (photos, mockups, sprites, cutouts) with GPT Image models via a bundled Python CLI.
Low risk: a single CLI that only calls the OpenAI Image API with your own key and writes images locally without overwriting by default.
Install Image Generation (imagegen) in Google Antigravity
Antigravity loads skills from .agents/skills/ in your project or ~/.gemini/config/skills/ for all projects (official docs). Full guide
Install the "Image Generation (imagegen)" skill for Google Antigravity. Follow the steps at https://www.antigravityskills.org/install/image-generation.md (source: https://github.com/openai/skills/tree/main/skills/.system/imagegen). Before running anything, show me what you will download and whether it includes scripts, and wait for my OK. Install it into this project (.agents/skills/) unless I say global. When done, check that Antigravity lists it as an installed skill.
The agent reads the install file, shows you what it will download and waits for your OK.
Option 2: install it yourself
- 1. Clone the source repository
git clone --depth 1 https://github.com/openai/skills /tmp/openai-skills
Clone the repository to a temporary folder so you can copy the skill folder out of it.
- 2. Copy into your workspace (this project only)
mkdir -p .agents/skills && cp -r /tmp/openai-skills/skills/.system/imagegen .agents/skills/imagegen
Run this from your project root. Antigravity reads workspace skills from <project>/.agents/skills/<folder>/.
- 3. Or copy globally (all projects)
mkdir -p ~/.gemini/config/skills && cp -r /tmp/openai-skills/skills/.system/imagegen ~/.gemini/config/skills/imagegen
Use this instead of the workspace step if you want the skill available in every project. Antigravity reads global skills from ~/.gemini/config/skills/<folder>/.
- 4. Install the Python dependency
pip install openai
The SKILL.md prefers uv pip install openai; pillow is optional (downscaling only). Then export OPENAI_API_KEY in your shell; never paste the key into the chat.
- 5. Check that Antigravity sees it
Start a new agent session and ask "What skills do you have?" (in the Antigravity CLI you can also run /skills). imagegen should be listed.
The openai/skills README does not mention Antigravity; these steps are the standard Antigravity skill folders. Antigravity has no Codex image_gen tool, so ask the agent to use the CLI fallback explicitly.
Using Claude Code, Cursor or Codex? See other assistants below.
What is Image Generation (imagegen)?
How to use Image Generation (imagegen)?
Key features of Image Generation (imagegen)
- ✓Two modes: built-in image_gen tool (Codex only) or the bundled scripts/image_gen.py CLI fallback (any agent)
- ✓CLI subcommands generate, edit and generate-batch (JSONL file, up to 500 jobs, retries with backoff up to 60 s)
- ✓Edits with up to 16 input images and an optional mask (references/image-api.md), plus --input-fidelity low|high
- ✓16 use-case slugs (product-mockup, ui-mockup, logo-brand, background-extraction, style-transfer, compositing and more) with one shared prompt schema
- ✓--dry-run prints the API payload without a network call, an API key or the openai package
- ✓Refuses to overwrite an existing file unless --force is passed; optional downscaled -web copies with --downscale-max-dim (needs pillow)
When to use Image Generation (imagegen)
- 1Create a hero image or product mockup for a landing page
- 2Generate game sprites or textures as project assets
- 3Replace the background of a product photo while keeping the product unchanged
- 4Produce a transparent-background cutout
- 5Batch-generate many asset variants from a JSONL prompt file
Installation & Setup Guide
Agent Rules / Prompt SetupFollow these steps (taken from the project's own docs) to configure Image Generation (imagegen) in your development environment.
Source: openai/skills README, "Installing a skill": skills in skills/.system, including imagegen, are installed automatically in the latest version of Codex. The skill-installer SKILL.md adds that .system skills are preinstalled in $CODEX_HOME/skills (default ~/.codex/skills).
git clone --depth 1 https://github.com/openai/skills /tmp/openai-skills && mkdir -p ~/.claude/skills && cp -r /tmp/openai-skills/skills/.system/imagegen ~/.claude/skills/imagegen
Not documented by the repo. Source for the path: Claude Code skills docs (https://code.claude.com/docs/en/skills), which read personal skills from ~/.claude/skills/ and project skills from .claude/skills/. Set OPENAI_API_KEY and ask for the CLI fallback when generating.
The openai/skills README and the skill folder say nothing about Cursor, so we do not list a Cursor command.
Usage Example & Verification
1) README example (SKILL.md, Generation example): Use case: product-mockup Asset type: landing page hero Primary request: a minimal hero image of a ceramic coffee mug Style/medium: clean product photography Constraints: no logos, no text, no watermark -> What happens: outside Codex, after you ask for the CLI fallback, the agent runs image_gen.py generate with this spec as the prompt and saves a 1024x1024 PNG under output/imagegen/. 2) README example (SKILL.md, Edit example): Use case: precise-object-edit Primary request: replace only the background with a warm sunset gradient Constraints: change only the background; keep the product and its edges unchanged -> What happens: the agent runs image_gen.py edit --image <your file> and writes a new file; the original is kept because the CLI will not overwrite without --force. 3) Our example: "Use the imagegen CLI fallback with --dry-run to show me the payload for a transparent 1024x1024 PNG game coin icon." -> What happens: the script prints the request JSON and the output path only; nothing is sent to OpenAI and no image is created.
Ask "What skills do you have?" in Antigravity (Antigravity CLI: /skills) and look for imagegen, then ask: "Run the imagegen CLI with --dry-run for a test prompt." A working setup prints the payload and the computed output path without contacting OpenAI.
Security Review
Static reviewLow risk: a single CLI that only calls the OpenAI Image API with your own key and writes images locally without overwriting by default.
Full review: scope, findings, risks
The skill is instructions plus one script, scripts/image_gen.py. The script imports only standard-library modules and the openai SDK (and pillow when downscaling) and contains no subprocess, os.system, eval or exec calls. It reads OPENAI_API_KEY from the environment and sends requests to the OpenAI Image API endpoints listed in references/image-api.md (/v1/images/generations and /v1/images/edits). Output images are base64-decoded and written to the paths given by --out or --out-dir; _decode_and_write and _decode_write_and_downscale stop with an error if a file already exists unless --force is passed. SKILL.md instructs the agent never to modify image_gen.py, never to switch to the CLI automatically, and never to ask for the key in chat. references/codex-network.md explains enabling network access in Codex and notes that reducing approvals increases risk in untrusted repositories.
Operational Notes & Known Limitations
Known Limitations
- •The preferred built-in image_gen tool exists only in Codex; in Antigravity, Claude Code or Cursor you must explicitly ask for the CLI fallback (the SKILL.md forbids switching automatically)
- •The CLI fallback needs OPENAI_API_KEY, network access and the openai Python package (pillow only for downscaling); usage is billed to your OpenAI account
- •Only GPT Image models are accepted (the script rejects any model name not starting with gpt-image-; default gpt-image-1.5)
- •Transparent backgrounds need PNG or WebP output; the script stops with an error for JPEG (we read this in image_gen.py)
- •Paths in references/cli.md assume Codex ($CODEX_HOME/skills/.system/imagegen); adjust them to where you copied the folder
- •The openai/skills README marks the whole repository as deprecated in favour of openai/plugins; this skill folder still exists at the reviewed commit
Frequently Asked Questions
Is the Image Generation (imagegen) skill safe?
In our static review of commit 49f948f, scripts/image_gen.py only imports the standard library, the openai SDK and (for downscaling) pillow, with no subprocess, eval or exec calls. It reads OPENAI_API_KEY from the environment, sends prompts and input images to OpenAI, and writes images only to the paths you give it, refusing to overwrite without --force.
How do I install imagegen in Antigravity?
Clone https://github.com/openai/skills, copy skills/.system/imagegen into .agents/skills/imagegen (one project) or ~/.gemini/config/skills/imagegen (all projects), pip install openai, export OPENAI_API_KEY and check by asking "What skills do you have?" (Antigravity CLI: /skills). Or paste the one-line agent prompt above.
Does it work without an OpenAI API key?
Only inside Codex, where the built-in image_gen tool is used. Everywhere else it needs OPENAI_API_KEY; --dry-run works without a key but creates no image.
Which models and sizes does it support?
GPT Image models only (default gpt-image-1.5; gpt-image-1 and gpt-image-1-mini are named), sizes 1024x1024, 1536x1024, 1024x1536 or auto, quality low, medium, high or auto.
Supported Platforms
Keep exploring this topic
Browse the full Antigravity skills directory for more source-linked skills with install steps and static safety reviews.
Related Skills
Pollinations AI
@pollinations
Official Pollinations skill for the polli CLI: generate images, text, audio, video and 3D, transcribe speech and check your Pollen balance.
Photo Retouching (fal.ai)
@fal-ai-community
fal.ai's official fal-recipes skill: restore and clean up photos (deblur, denoise, dehaze, fix faces, restore scans) through the genmedia CLI.
ComfyUI
@Comfy-Org
Comfy-Org's official comfy skills: teach your agent to drive ComfyUI (local or Comfy Cloud) through comfy-cli to make images, video, audio and 3D.
Popular Skills
View All →Agent Manager
@sickn33
Manage multiple local CLI agents via tmux sessions.
Systematic Debugging
@sickn33
Debug systematically, not randomly. Find and fix bugs methodically.
Browser Automation (Playwright)
@sickn33
Expert browser automation for cleaning scraping and reliable testing.