1.3 KiB
How agents make real images (photos, illustrations) with generate_image, and how they show inline in the transcript.
Generating images
generate_image makes a raster image from a prompt and saves it as a PNG in the task's media folder (<worktree>-media/, outside the worktree, deleted when the task closes). Embed the path it returns in your final message as  and the human sees it inline in the transcript; copy it into the worktree when the project itself uses it.
It runs one Codex turn on the Mac byre runs on, under byre's Codex home, and calls Codex's built-in image tool (OpenAI's image model), so:
- It needs Codex signed in there (the
setuparticle covers it); until then it fails with401 Unauthorized. - Each image counts against the ChatGPT plan's Codex usage, whichever vendor the calling agent runs on.
- One call takes a minute or two; give it a timeout of at least 3 minutes.
Codex agents (gpt-* models) also have the image tool built in. An image one makes is copied into the media folder and shown inline in the transcript by byre, with no Markdown needed.
Write the prompt as a short spec: subject, style or medium, composition, lighting, and any exact text in quotes. For a change, generate again with the one change stated; it can't edit an earlier image in place.