codex - 💡(How to fix) Fix image_gen returns unrelated educational infographic instead of requested UI mockup [1 comments, 2 participants]

Official PRs (…)
ON THIS PAGE

Recommended Tools

×6

Utilities matched from this issue’s tags and category — try them while you read without losing context.

GitHub issue graph ai analysis

Paste a GitHub issue URL. We fetch that issue, discover linked issues from bodies/comments/timeline, collect linked pull requests, and produce a structured English report.

The report is written in English Markdown for sharing and archival.

Helpful · Quick feedback

Loading…
GitHub stats
openai/codex#19219Fetched 2026-04-24 05:58:34
View on GitHub
Comments
1
Participants
2
Timeline
7
Reactions
0
Timeline (top)
labeled ×4closed ×1commented ×1subscribed ×1

Error Message

The image_gen tool should generate a UI mockup matching the requested SaaS admin console tab, or return a clear error if it cannot satisfy the request.

Root Cause

Notes:

  • The issue occurred with the built-in image_gen tool in Codex.
  • A direct Images API fallback was intentionally not used for the final workflow.
  • Other UI mockups in the same session were generated successfully, so the failure appears prompt/task-specific rather than a total outage.
  • The generated image was not saved into the project because it was unrelated to the requested UI mockup.
RAW_BUFFERClick to expand / collapse

What issue are you seeing?

When using Codex's built-in image_gen tool to generate a SaaS admin UI mockup, the tool repeatedly returns a completely unrelated educational infographic/poster instead of the requested dashboard screen.

The requested asset is a cropped tab content block for a software console UI. The prompt explicitly asks for a "software dashboard UI mockup", "SaaS admin console", "not a poster", "not an infographic", "not a map", and "not an illustration". Despite that, multiple attempts produced unrelated poster-like educational images, including medical/anatomy-style content.

This looks like the image generation tool is ignoring or losing the prompt semantics for this specific UI mockup request.

Here are the pictures I received after the problem occurred:

<img width="1402" height="1122" alt="Image" src="https://github.com/user-attachments/assets/bde56591-0ae1-4878-9773-b10cc6840c7b" /> <img width="1536" height="1024" alt="Image" src="https://github.com/user-attachments/assets/2937b9fc-5b7e-433a-803f-7e28b0f36804" />

What steps can reproduce the bug?

  1. Start Codex CLI in a local repository.
  2. Use the built-in image_gen tool.
  3. Ask it to generate a PNG UI mockup for a SaaS admin console tab named "Права и секреты" / "Permissions and secrets".
  4. Include explicit negative instructions such as:
  • "software dashboard UI mockup"
  • "not a poster"
  • "not an infographic"
  • "not a map"
  • "not a medical diagram"
  • "no decorative illustration"
  1. Repeat the request several times with simplified prompts and with an existing generated UI mockup shown as visual context.
  2. Observe that image_gen still returns unrelated poster/infographic content instead of the requested UI.

Example prompt excerpt: "Generate a clean enterprise SaaS admin console UI mockup, PNG, 16:9. This must be a software dashboard screen fragment only: no poster, no map, no photo, no illustration, no full app sidebar. Product: kodex staff console. Section: package catalog. Active tab: Permissions and secrets."

Expected behavior:

The image_gen tool should generate a UI mockup matching the requested SaaS admin console tab, or return a clear error if it cannot satisfy the request.

It should not silently return unrelated educational, medical, or poster-like content when the prompt explicitly requests a software dashboard UI and explicitly excludes those categories.

What is the expected behavior?

<img width="1672" height="941" alt="Image" src="https://github.com/user-attachments/assets/9a45c0d5-ffda-49f1-b3cb-9bb5e1c891f9" />

Additional information

Additional information:

Environment:

  • OS: Ubuntu 25.10 (questing)
  • Kernel: Linux 6.17.0-22-generic x86_64
  • Codex CLI: codex-cli 0.124.0
  • Node.js: v22.20.0
  • npm: 11.7.0
  • Python: 3.12.11
  • Git: 2.51.0
  • Date/time observed: 2026-04-24T02:07:52+04:00

Notes:

  • The issue occurred with the built-in image_gen tool in Codex.
  • A direct Images API fallback was intentionally not used for the final workflow.
  • Other UI mockups in the same session were generated successfully, so the failure appears prompt/task-specific rather than a total outage.
  • The generated image was not saved into the project because it was unrelated to the requested UI mockup.

extent analysis

TL;DR

The image_gen tool in Codex may be misinterpreting or ignoring specific prompt semantics, leading to the generation of unrelated images, and a workaround could involve refining the prompt to better match the expected UI mockup.

Guidance

  • Review the prompt structure and semantics to ensure they accurately reflect the desired UI mockup, focusing on explicit descriptions of the software dashboard UI and exclusion of unwanted content types.
  • Attempt to simplify or rephrase the prompt, potentially reducing the number of negative instructions to see if the tool better understands the request.
  • Consider providing a visual reference or example of a similar UI mockup to help guide the image_gen tool towards the correct output.
  • Verify that the issue persists across different prompt variations and Codex sessions to rule out transient errors.
  • If possible, compare the performance of the image_gen tool with a direct Images API fallback to determine if the issue is tool-specific.

Example

No specific code snippet can be provided without altering the original prompt or inventing new APIs, but an example of a refined prompt could be: "Generate a clean and minimalistic SaaS admin console UI mockup for the 'Permissions and secrets' tab, excluding any posters, infographics, maps, or illustrations, and focusing solely on the dashboard screen fragment."

Notes

The root cause of the issue seems to be related to how the image_gen tool interprets the prompt, possibly due to its AI-driven nature and the complexity of natural language processing. The effectiveness of any workaround may depend on the tool's capabilities and limitations in understanding specific prompt semantics.

Recommendation

Apply a workaround by refining the prompt to better match the expected UI mockup, as the issue appears to be prompt-specific rather than a tool outage, and upgrading to a potentially fixed version is not mentioned as an option in the provided context.

Vote matrix · Quick signals

Works
Did the solution work? Tap to confirm.
Easy Fix
Was it a quick fix?
Time Saver
Did it save you time?
Blocking
Was it severely blocking?
Common Issue
Are others likely hitting this too?
Flaky / Intermittent
Is it intermittent?
Verified / Reproducible
Can you reproduce it reliably?
Loading…

Still need to ship something?

×6

Another batch ranked right after the header list — different links, same matching logic.

Back to top recommendations

TRENDING

codex - 💡(How to fix) Fix image_gen returns unrelated educational infographic instead of requested UI mockup [1 comments, 2 participants]