Generates images with the OpenAI Images API (gpt-image-1 and variants), with batch runs, a prompt sampler, and an auto-generated HTML gallery to compare outputs. Use when producing several image variants or comparing prompts side by side.
Installs into .claude/skills of the current project.
Sponsors
SSkills DirectorySkills Directory
Know which skills are safe — weekly.
SSkills DirectorySkills Directory
Is that skill safe to install?
Are you the author of Openai Image Gen?
Add the live security badge to your README. It updates with every re-scan.
[](https://www.skillsdirectory.com/skills/mouadja02-openai-image-gen)
---
name: openai-image-gen
description: >-
Generates images with the OpenAI Images API (gpt-image-1 and variants), with batch runs, a prompt
sampler, and an auto-generated HTML gallery to compare outputs. Use when producing several image
variants or comparing prompts side by side.
source: "https://github.com/steipete/agent-scripts"
attribution: "steipete/agent-scripts by Peter Steinberger"
version: "1.0.0"
license: MIT
---
# OpenAI Image Gen
> **Attribution:** Sourced from [steipete/agent-scripts](https://github.com/steipete/agent-scripts) by [Peter Steinberger](https://github.com/steipete).
## When to Use
- Generating images via OpenAI Images API (gpt-image-1)
- Running batch image generation with auto-generated HTML gallery
- Comparing prompt variations side by side
Generate images via OpenAI Images API with batch support and an auto-generated HTML gallery.
## Setup
- Requires `OPENAI_API_KEY` environment variable.
- Requires Python 3 and the `openai` package.
## Usage
```bash
# Basic run (generates random structured prompts)
python3 gen.py
# Custom count
python3 gen.py --count 16
# Custom model
python3 gen.py --model gpt-image-1.5
# Custom prompt
python3 gen.py --prompt "ultra-detailed studio photo of a lobster astronaut" --count 4
# Custom size and quality
python3 gen.py --size 1536x1024 --quality high --out-dir ./out/images
```
## Output
- `*.png` images in the output directory
- `prompts.json` (prompt ↔ file mapping)
- `index.html` (thumbnail gallery for quick review)
```bash
# Open gallery
open ~/tmp/openai-image-gen-*/index.html
```
## Common Options
| Flag | Description |
|------|-------------|
| `--count N` | Number of images to generate |
| `--model MODEL` | Model to use (e.g., `gpt-image-1`, `gpt-image-1.5`) |
| `--prompt TEXT` | Custom prompt (overrides random generation) |
| `--size WxH` | Image size (e.g., `1024x1024`, `1536x1024`) |
| `--quality LEVEL` | Quality level (`standard`, `high`) |
| `--out-dir PATH` | Output directory |