Swarmclaw openai-image-gen
Generate images via OpenAI Images API (GPT Image, DALL-E 3, DALL-E 2). Supports batch generation with random prompt sampler and HTML gallery output. Use when asked to generate images with OpenAI and an OPENAI_API_KEY is available.
install
source · Clone the upstream repo
git clone https://github.com/swarmclawai/swarmclaw
Claude Code · Install into ~/.claude/skills/
T=$(mktemp -d) && git clone --depth=1 https://github.com/swarmclawai/swarmclaw "$T" && mkdir -p ~/.claude/skills && cp -r "$T/skills/openai-image-gen" ~/.claude/skills/swarmclawai-swarmclaw-openai-image-gen && rm -rf "$T"
manifest:
skills/openai-image-gen/SKILL.mdsource content
OpenAI Image Gen
Generate images via the OpenAI Images API with an HTML gallery viewer.
Run
Note: Image generation can take longer than typical timeouts. Set a higher timeout when running via shell (e.g., 300 seconds).
python3 {baseDir}/scripts/gen.py
Useful Flags
# GPT image models with various options python3 {baseDir}/scripts/gen.py --count 16 --model gpt-image-1 python3 {baseDir}/scripts/gen.py --prompt "ultra-detailed studio photo of a lobster astronaut" --count 4 python3 {baseDir}/scripts/gen.py --size 1536x1024 --quality high --out-dir ./out/images python3 {baseDir}/scripts/gen.py --model gpt-image-1.5 --background transparent --output-format webp # DALL-E 3 (note: count is automatically limited to 1) python3 {baseDir}/scripts/gen.py --model dall-e-3 --quality hd --size 1792x1024 --style vivid python3 {baseDir}/scripts/gen.py --model dall-e-3 --style natural --prompt "serene mountain landscape" # DALL-E 2 python3 {baseDir}/scripts/gen.py --model dall-e-2 --size 512x512 --count 4
Model-Specific Parameters
Size
- GPT image models (
,gpt-image-1
,gpt-image-1-mini
):gpt-image-1.5
,1024x1024
(landscape),1536x1024
(portrait), or1024x1536
. Default:auto1024x1024 - dall-e-3:
,1024x1024
, or1792x1024
. Default:1024x17921024x1024 - dall-e-2:
,256x256
, or512x512
. Default:1024x10241024x1024
Quality
- GPT image models:
,auto
,high
, ormedium
. Default:lowhigh - dall-e-3:
orhd
. Default:standardstandard - dall-e-2:
onlystandard
Other Parameters
- GPT image models support
(--background
,transparent
,opaque
) andauto
(--output-format
,png
,jpeg
)webp - dall-e-3 supports
(--style
for hyper-real,vivid
for more natural looking)natural - dall-e-3 only supports
; the script automatically limits count to 1n=1
Output
- Image files (
,*.png
, or*.jpeg
depending on model and format)*.webp
(prompt-to-file mapping)prompts.json
(thumbnail gallery — open in browser to review)index.html