OpenAI Image Generation (Panels + Portraits)
Use this skill whenever the game rules require frequent image generation (scene panels, action shots, character portraits) and you need to save the image to the repo and embed it into Markdown.
Quickstart
Generate a new image from text:
- •
python3 .codex/skills/openai-image-gen/scripts/generate_image.py --prompt "..." --out "codex/worlds/<World>/campaigns/<Campaign>/assets/001_establishing.png"
Generate a scene panel that keeps characters consistent (auto-resolves their lore reference images and uses the edits endpoint):
- •
python3 .codex/skills/openai-image-gen/scripts/generate_panel.py --world <World> --character "Zorn" --character "Klik" --prompt "..." --out "codex/worlds/<World>/campaigns/<Campaign>/assets/010_squad_encounter.png"
Generate using reference images (for visual continuity) via the edits endpoint:
- •
python3 .codex/skills/openai-image-gen/scripts/generate_image.py --prompt "..." --input-image "path/to/ref1.png" --input-image "path/to/ref2.png" --out "codex/worlds/<World>/campaigns/<Campaign>/assets/002_action.png"
Embedding into logs (Obsidian-friendly)
From campaign_logs/*.md, embed panels like:
- •

Prompting rules (to keep the world consistent)
- •Use the world’s
ART_STYLE.md“deconstructed style” keywords. - •Prefer concrete, visual descriptions (lighting, materials, camera, mood).
- •For known entities: describe their consistent features + pass their existing images as
--input-image.
Environment
- •Reads
OPENAI_API_KEYfrom the environment. - •If not present, tries to load it from a repo
.envfile (simpleKEY=VALUEparsing).
Scripts
- •
scripts/generate_image.py: Create an image usinggpt-image-1.5(fallback togpt-image-1) and write it to disk. - •
scripts/generate_panel.py: Wrapper that resolves lore reference images (characters) and callsgenerate_image.pywith--input-imagefor visual consistency. - •
scripts/verify_markdown_images.py: Verify that all image links in a Markdown file exist on disk.