Generate images via the local Codex CLI
codex_generate_imageGenerate images from text prompts with your local Codex CLI, save files to a workspace, and display previews inline. Supports custom sizes, counts, and quality for draft or final assets.
Instructions
Generate images with the local Codex CLI. The prompt is passed through as written. Returns the saved file paths and shows the images inline, downscaling a preview when a file is too large to inline. Defaults to a fast low-quality 1024x1024 draft; raise quality for final assets.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| open | No | Open the generated images in the user's default image viewer. Default true, because MCP clients do not render tool-result images into the chat. | |
| size | No | Pixel size, e.g. "1024x1024" (fastest, the default), "1536x1024" landscape, "1024x1536" portrait, "2048x2048", "3840x2160". | |
| count | No | How many images. Default 1. | |
| prompt | Yes | What the image should depict. | |
| quality | No | Generation quality. Default "low" - fastest, good for drafts. Use "high" for final assets. | |
| workspace | No | Workspace folder name. Defaults to a new folder. | |
| timeout_sec | No | Seconds before Codex is killed. |