Image generation from codex
What feature would you like to see?
I am building new tools every day - and I don't think in the past decade or so I've ever needed to write a program and not needed a visual asset of some sort. Even a command line tool you want a nice banner on the readme.md you create... most apps need an icon or something - and once we get to a UI, especially a web ui - nowadays it should be full of hero images, icons, menus, borders, backgrounds, textures etc etc.
it's weird that codex can write the code, test it, deploy it, add commit messages etc - basically the entire dev platform _apart from adding creating visual assets_.
And if you think of what you have to do by hand to do it - even a simple banner image on a readme - you have to come up with an appropriate prompt and resolution - go to the chat ui - type it in, wait for an image, download it - move it to the right directory and rename it - change the readme to point to the file, and then add and commit it.
Seems like something an automated tool would be good at!!
I actually have a generate_image script that codex calls, but it uses mflux + krea - it works fine but it's slow and not as high quality as the native chatgpt image generation would be.
PLEASE PLEASE PLEASE add image generation using your image models to the tool.
Additional information
even worse than not having image generation - if you ask for an image - it goes off and produces some terrible thing created from code or svg or something.
also - the really nice to have would be image understanding as well - you want to be able to say "make a website to do blah - make it highly graphical with images on all the selectors, an appropriate background image and a hero image all in the same style... then take a screenshot with playwright - and have a look and verify that it's attractive and cohesive and everything is in the right place - if it isn't - fix it"
24 Comments
+1 on this.
As a private solo developer for my company, Codex has been a huge productivity boost for all the “small but constant” tasks — writing unit tests, CI tweaks, etc. The speed really adds up.
The biggest remaining obstacle for me is visual assets. Most images found online are copyright-restricted and not safe to drop into repos or products. Being able to generate original, license-safe images directly from the Codex CLI would be a massive win.
If Codex could generate icons, banners, UI assets, backgrounds, etc.…it would close one of the last gaps in the “end-to-end dev agent” story.
Right now, jumping out to ChatGPT UI or third-party tools breaks flow and automation. First-class image generation in Codex would be incredibly valuable, especially for solo devs and small teams shipping fast.
Strongly supporting this feature.
I agree that this would be a cool integration feature.
As a short-term workaround, you can prompt Codex to use the OpenAI API to call the image generator directly. This requires you to use an OpenAI API Key for image generation, but it works quite well.
It does work. But, I won't be able to use the image gen under Pro plan that I already have.
Is there a way to agnatically use image gen in any codex surfaces?
+1
+1, since the API based use budget not subscription capabilities 😄
+1
This would be great
give me
it is an experimental feature but not working now - see for example https://github.com/openai/codex/pull/15223
The pr you’re referencing doesn’t introduce image generation through your account, looks like it’s just plumbing for the image generation skill that already exists, but does open the door for a different pull request to implement image generation with your account
Imagegen skill already mention image_gen tool in codex. But this tool is not enabled as for now.
built this so you can use chatgpt.com pro from codex cli and i've added support for image generation and download via chatgpt.com, you should be able to download and attach it to your prompts
https://github.com/agentify-sh/desktop
@deksden If you want to generate images from CODEX, I built an MCP here : https://mypostfactory.com/mcp
Nano Banana behind the scene
There is a tool (among other tools) to only generate images, even with references images (up to 3)
You need a My Post Factory account, and credits on the platform of course (image generation not free for me neither...)
any news about image_gen for Pro subscription?
This is now supported if you're logged in with a ChatGPT account! It uses gpt-image-1.5 to generate images.
amazing work @etraut-openai !
Hi there,
I am not sure about the exact solutions. How to invoke it? With the imagegen skill or install additional plugins?
Wish for a more concrete explanation!
You should be able to enable the experimental feature flag for image generation. You can ask codex to do this for you. From there you should be able to generate images just by asking codex.
I couldn't figure it out either, kept trying to use the api. I asked claude code to enable it within codex and it worked.
You can enable it either in ~/.codex/config.toml by adding:
Or via the CLI with
codex features enable image_generation.Then restart the Codex session so the image generation tool becomes available.
Does it use GPT Image 2 now?
seems to be broken for me even after enabling it in the config and restarting codex, it says "The built-in image tool is not exposed in this session"
It works for me pretty reliably as of code v0.137.0
Question for anybody that knows, I'm assuming this uses image generation credits right? Not the 5hr token limits.
I've been able to use the image gen directly from chatgpt sub via https://github.com/agentify-sh/desktop
“Generate three UI concept images, save the images as artifacts, and return the local file paths.”