origin-image-gen

Generates image assets via Codex image_gen with prompt assembly, execution, and artifact collection.

Updated Dec 9, 2025
One-click install
npx skills add https://github.com/Aki2022/skills --skill origin-image-gen-aki2022
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: origin-image-gen
Source: https://github.com/Aki2022/skills/tree/main/origin-image-gen
Command: npx skills add https://github.com/Aki2022/skills --skill origin-image-gen-aki2022

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes scripts (resource) and references (resource) components.

What problem does it solve? Image generation with Codex image_gen often fails silently: prompts say "save as X" but files land elsewhere, stale outputs masquerade as success, parallel sessions grab each other's images, and stdin hangs block execution. This Skill wraps the entire flow—prompt assembly, execution, collection, and completion judgment—into one self-contained entry point so callers never handle these traps themselves. ## Core Features & Use Cases - Fixed 10-field prompt shell: Assembles prompts in a strict labeled order (Use case, Asset type, Style references, Style, House structure, Composition, Content, Color palette, Constraints, Avoid) following the official schema. - Safe-mode execution: Runs codex exec with workspace-write sandbox and network access, never using the forbidden full-bypass flag, and auto-adds --skip-git-repo-check outside git repos. - Deterministic collection: Recovers generated images by session id from generated_images directories, stashes old outputs to .stale, and fails with exit 1 rather than filling shortfalls. - Use Case: A factory skill (e.g., origin-web-design) needs three brand-consistent illustrations; it passes a fields.json with brand style values and three --out paths, and receives verified artifact paths or a clear failure code. ## Quick Start Ask the AI to generate three illustrations by writing a fields.json with the ten prompt fields and running scripts/image_gen.py with --fields and three --out paths.

Frequently Asked Questions about origin-image-gen

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I generate images with Codex image_gen from a script?

Write a fields.json containing the ten prompt fields (Use case through Avoid), then run scripts/image_gen.py with --fields and one --out path per desired image. The script assembles the prompt, runs codex exec in safe mode, collects outputs by session id, and returns exit 0 only when all images are recovered.

Why are my generated images not in the output folder I specified?

Codex image_gen always saves to <CODEX_HOME>/generated_images/<session-id>/ regardless of prompt instructions like "save as X". The collect_codex_images.py script parses the session id from the run log and copies files to your --out paths; never trust in-prompt save instructions.

Does image generation work without the dangerously-bypass flag?

Yes. The skill uses --sandbox workspace-write with network access enabled, which is sufficient for image_gen. The --dangerously-bypass-approvals-and-sandbox flag is forbidden and checked for, since AI classifiers hard-block it.

What do exit codes 1 and 2 mean in image_gen.py?

Exit 2 means input problems like missing fields.json keys or invalid JSON, so generation never started and you can fix and retry. Exit 1 means generation ran but collection failed or counts fell short; do not use any artifacts and inspect run.log.

How do I keep style consistent across many generated images?

Reuse the Style, House structure, and Color palette field values verbatim across all images, and pass human-approved anchor images via --anchor for edit-mode reference. Run the first image serially as a smoke test before parallelizing the rest.

When should I not use this image generation skill?

Do not use it for searching or selecting existing images, deciding brand styles or color palettes, or evaluating output quality. Those belong to brand repositories, media-specific factory skills, and the origin-output-eval skill respectively.