Skip to main content
skill CX Codex

openai-image-gen · steipete — Claude Code skill: batch images and gallery

openai-image-gen — a skill for Claude Code, Codex, Cursor, GitHub Copilot, Gemini CLI, and OpenCode: calls the OpenAI Images API, renders a batch of images from structured prompts, and builds an HTML gallery.

MIT 1 installs ★ 7,554 updated 2026-10-20

Install into Claude Code · Skills CLI (Vercel) All methods and platforms ↓
npx skills add steipete/agent-scripts --skill openai-image-gen -a claude-code
Open on GitHub

What openai-image-gen does

The skill executes gen.py with Python 3, hits the OpenAI Images API, and writes output to ~/Projects/tmp/openai-image-gen-*/ when that path exists, falling back to ./tmp/.

Each run produces *.png files, a prompts.json mapping prompts to filenames, and an index.html thumbnail gallery. The flags --count, --model, --size, --quality, and --out-dir control batch size, model choice, resolution, and output location.

OPENAI_API_KEY must be set in the environment before the script runs.

What it helps with

  • generate a batch of images from a single prompt
  • compare how different prompt wordings affect output
  • get an HTML gallery without writing markup by hand
  • keep a prompt-to-file log in prompts.json for later processing
  • render at a custom resolution with the --size flag

Example prompts for the agent

  • Generate 16 images with model gpt-image-1.5 and open the gallery
  • Create 4 images for the prompt 'ultra-detailed studio photo of a lobster astronaut' and save to ./out/images
  • Run gen.py with --size 1536x1024 --quality high and show me index.html

How to install openai-image-gen

1Skills CLI (Vercel)

npx skills add steipete/agent-scripts --skill openai-image-gen -a claude-code

2Manually: put the files in place

~/.claude/skills/openai-image-gen/SKILL.md

Copy the whole skill folder; for one project use .claude/skills/openai-image-gen/

Step by step, with commands for each platform: How to install skills in Claude Code: five ways

Questions about openai-image-gen

How do I install openai-image-gen in Claude Code?

Run npx skills add steipete/agent-scripts --skill openai-image-gen -a claude-code. The skill file will then be available at ~/.claude/skills/openai-image-gen/SKILL.md.

What does openai-image-gen do?

It generates images through the OpenAI Images API — either from a prompt you supply or from structured prompts it builds itself — and outputs *.png files plus an index.html gallery.

What does openai-image-gen require to run?

Python 3 and the OPENAI_API_KEY environment variable. The gen.py script will not start without the key present.

Source text

SKILL.md · MIT
---
name: openai-image-gen
description: "OpenAI Images API: batches, prompt sampler, gallery."
---

# OpenAI Image Gen

Generate a handful of “random but structured” prompts and render them via OpenAI Images API.

## Setup

- Needs env: `OPENAI_API_KEY`

## Run

From any directory (outputs to `~/Projects/tmp/...` when present; else `./tmp/...`):

```bash
python3 ~/Projects/agent-scripts/skills/openai-image-gen/scripts/gen.py
open ~/Projects/tmp/openai-image-gen-*/index.html
```

Useful flags:

```bash
python3 ~/Projects/agent-scripts/skills/openai-image-gen/scripts/gen.py --count 16 --model gpt-image-1.5
python3 ~/Projects/agent-scripts/skills/openai-image-gen/scripts/gen.py --prompt "ultra-detailed studio photo of a lobster astronaut" --count 4
python3 ~/Projects/agent-scripts/skills/openai-image-gen/scripts/gen.py --size 1536x1024 --quality high --out-dir ./out/images
```

## Output

- `*.png` images
- `prompts.json` (prompt ↔ file mapping)
- `index.html` (thumbnail gallery)

© steipete · MIT · steipete/agent-scripts

Similar skills

All skills for AI and ML →

openai-image-gen by other authors comes first.

From the same set20

The whole set →
discord-clawd discord-clawd — a skill to send questions to a Discord-backed agent via OpenClaw relay. Not for archive search—use it to communicate directly with a live session. CX Codex +1 122installs openclaw-relay openclaw-relay is a Claude Code skill that routes prompts and messages to OpenClaw sessions via local acpx or SSH, resolving targets from named aliases in config/session_aliases.json. CX Codex +1 120installs mac-maintenance mac-maintenance automates macOS maintenance by upgrading Homebrew packages, pulling clean git repositories, and emptying the Trash. CX Codex +1 117installs cloudflare-registrar A skill to check domain availability in Cloudflare Registrar, retrieve pricing, and register domains from your code editor. Use it when you register domains regularly and want to skip the dashboard. CX Codex +1 108installs codex-debugging codex-debugging guides debugging across the codex-rs repository. Essential when investigating runtime bugs, CLI behavior, or config parsing issues. CX Codex +1 108installs github-project-triage The github-project-triage Claude Code skill reviews open GitHub issues and pull requests when prompted with “triage.” It surfaces blockers, checks, risks, and a next action for each item. CX Codex +1 105installs obsidian A skill for Claude Code searches, reads, and edits local Obsidian vaults. It handles requests involving notes, backlinks, Bases, and Canvas. CX Codex +1 104installs beeper beeper is a Claude Code skill that searches local Beeper history. It resolves vague contact clues across iMessage and WhatsApp bridges. CX Codex +1 104installs

Project sponsors

Companies that keep this analytics open