generate_image
Generate a PNG image from a text prompt using the signed-in Codex desktop app. Returns the file path, dimensions, and image for pictures, icons, or logos.
Instructions
Generate an image with ChatGPT and save it as a PNG on disk. Returns the file path, the dimensions, and the image itself.
Use for any visual asset the user asks for: a picture, illustration, icon, logo, mockup or photo. Do not call it speculatively, and do not use it for diagrams or charts that text already conveys.
Not idempotent: the same prompt twice yields two different images and two files. Takes 15-60 seconds, and calls are serialized because they share one application window. Writes a new PNG every time, and overwrites an existing file if "filename" collides with one. With thread "new" it also adds a conversation to the user's ChatGPT sidebar.
It drives the already-signed-in Codex desktop app over the DevTools protocol, so it needs no API key and consumes no Codex agent quota. It refuses to run if the app is in Work mode, because that would spend Codex usage.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| prompt | Yes | Subject, style, palette, mood, composition. Be descriptive and specific. For transparency or text-in-image, say so explicitly in the prompt. | |
| thread | No | "new" (default) starts a fresh conversation: fully isolated, but each call adds a row to the user's sidebar and the model cannot see earlier generations. "reuse" posts into the conversation this tool last used, so you can iterate ("same image but blue"). Use "reuse" when refining, "new" for a fresh subject. | |
| filename | No | Output file name without the .png extension. Defaults to chatgpt-<timestamp>. | |
| output_dir | No | Directory to write into. Prefer an absolute path, or a path relative to this server's working directory. Defaults to <codeximg>/out. |