What problem does it solve? Producing or editing bitmap images inside a Codex workflow requires choosing between the built-in ImageGen host capability and a separately billed API fallback, with correct handling of prompts, reference images, credentials, and output paths. ## Core Features & Use Cases - Host-first generation: Invokes the Codex $imagegen route with gpt-image-2 for new images and reference-based edits when the runtime exposes it. - API fallback script: Runs generate_image.py against the OpenAI Image API for generation or edits, reading the active provider key and base URL from ~/.codex/config.toml without printing or persisting credentials. - Use Case: Attach a warehouse photo and ask for an edited planning visualization that preserves room geometry and camera perspective while adding a hypothetical product-rack layout, saved as a new PNG file. ## Quick Start Ask the agent to use $imagegen to edit the attached reference image, preserving the room geometry and camera perspective, and save the result to a new output file.