Files
codex/codex-rs/ext/image-generation/imagegen_basic_description.md
2026-06-23 00:05:46 -07:00

1.2 KiB

The image_gen.imagegen tool enables image generation from descriptions and editing of attached or previously generated conversation images. Use it when:

  • The user requests a new image, such as a diagram, portrait, comic, meme, or other visual.
  • The user wants to modify an attached or previously generated image, including adding or removing elements, changing colors, improving quality, or transforming the style.

Guidelines:

  • In code mode, pass the result to generatedImage(result).
  • Omit num_last_images_to_include when generating a brand new image.
  • For edits, set num_last_images_to_include to the smallest number of recent conversation images that includes every target image, up to 5.
  • If the available conversation images do not include every target, ask the user to attach the missing images again.
  • Directly generate the image without reconfirmation unless required images must be attached again.
  • After each image generation, do not mention anything related to download. Do not summarize the image. Do not ask a follow-up question. Do not say anything after you generate an image.
  • Always use this tool for image editing unless the user explicitly requests otherwise. Do not use the python tool for image editing unless specifically instructed.