Guides

Codex Image Generation: Prompts, Edits, and Project Assets

Generate images with Codex, make focused edits, save assets into your project, and connect Dream Pixel Forge for image and video workflows.

By Aditya Bawankule8 min read
Original editorial image generated through Codex's built-in image tool for this guide. It illustrates a creative workflow, not the Codex interface.

Codex can generate images when an image-generation tool is available in the session. Ask for the image, describe where it will be used, and give a destination in your project. Then ask Codex to inspect the result, make a focused revision, and connect the chosen asset to your page.

This guide covers that practical workflow with copyable prompts, plus a Dream Pixel Forge connection for projects that need its image and video tools. The header was generated through the built-in tool during preparation of this article on September 10, 2026. The other prompts below are reusable briefs, not claims that every example was rendered.

Start with a tool check

Before changing settings or installing anything, ask Codex what it can actually call. An image-generation skill describes a workflow; the session still needs a working tool behind it. OpenAI's imagegen skill describes a built-in route and a separate CLI/API fallback. The built-in route does not require you to supply an OpenAI API key.

Check whether image generation is available in this session. If it is, use the built-in tool to create one image. If it is unavailable, tell me which capability is missing before installing anything or switching to a paid API.

This prevents a common detour: receiving a script when you wanted an actual image. It also makes the spending route explicit. An API script, a connected service, and a built-in tool have different setup and billing arrangements. Choose the route deliberately rather than assuming they are interchangeable.

Give Codex a visual brief and a file brief

A useful request has two parts. The visual brief defines subject, composition, light, palette, and exclusions. The file brief defines the destination, intended placement, crop, and whether an existing file may be replaced. Leaving either half vague creates extra work later.

Generate one editorial hero image for a ceramics workshop website.
Subject: an adult woman teaching pottery at a sunlit workbench.
Composition: landscape, subject on the right, quiet negative space on the left for HTML text.
Style: natural photography, cream walls, clay colors, soft window light, visible skin and fabric texture.
Avoid: lettering, logos, extra fingers, showroom perfection.
Save the selected image inside public/images/ceramics-workshop/.
Preserve the original master and dimensions. Tell me the saved path.
Do not replace an existing asset or edit the website yet.

Negative space is a layout decision. If the page puts its headline on the left, make that area visually quiet. If the mobile design stacks text above the image, the same blank area may become unnecessary. Decide the placement before asking for a second generation.

Keep editable headlines in the page rather than baking them into a hero photograph. That lets you change copy, translate it, and adjust its size without regenerating the artwork. A designed poster is a different task: there, exact text can be part of the image brief. Our GPT Image 2.5 prompting guide includes examples of both approaches.

Worked example: the header of this guide

The brief below produced the header above through the built-in tool. The image places the subject to the right and keeps the left wall mostly quiet. The laptop is seen from the back, so the illustration does not invent an application interface. The result also shows why you should review the actual composition: the laptop occupies some of the lower-left space, so an overlaid headline would fit better higher up.

Create a landscape 3:2 editorial photograph for a practical guide to generating website imagery with a coding assistant. Attractive adult South Asian woman aged 28, dark wavy shoulder-length hair, wearing a forest-green linen shirt, seated at a bright design studio desk, looking thoughtfully at a large art print held in her hands. Art print shows abstract coral and deep teal botanical shapes, no words. Position the woman on the right half of the image; leave the left third softly lit warm cream wall with subtle window shadows and generous negative space for a website headline added separately. Laptop seen only from the back, no visible screen or fabricated UI. Natural skin texture, realistic hands, soft morning window light, tasteful contemporary editorial photography, muted warm colors. No text, no logos, no watermark.

We saved the generated master and exported a full-size WebP for the article. The useful review questions were whether the face and hands remained visible, the print read clearly as artwork, and the scene worked without adding fake software controls. Those are concrete checks you can reuse for an editorial hero.

Use a real reference for a focused edit

Attach the image or point to its actual file, then describe the difference you want. Name what should stay fixed. Repeating the whole original brief can obscure the one change that matters.

Edit public/images/ceramics-workshop/hero.png.
Change only the woman's shirt from cream to muted forest green.
Preserve her face, hair, pose, hands, pottery, camera position, background, and light direction.
Keep the same dimensions. Save as hero-green.png beside the original.
Show both versions for comparison.

“Preserve” is an instruction to inspect against, not a guarantee of perfect pixel retention. Compare the face, fingers, edges, and objects after the edit. If the shirt color is right but the hands changed, the result still needs another decision. You may prefer the original with a smaller alteration.

For product work, call out the label, silhouette, closure, seams, and material as separate preservation requirements. “Keep the product identical” is a useful goal, but a specific list makes review easier. See our product photography guide for planning reference-based scenes.

Three more prompts for real project assets

A background that can sit behind readable text

Create a wide abstract background for a design agency landing page. Warm ivory base with restrained cobalt and coral paper shapes confined mainly to the lower-right corner. The upper-left half must remain quiet and pale so dark HTML copy is readable. Soft tactile shadows, clean editorial design, no words or logos. Save a new master in public/images/agency/.

Review this with the actual headline over it. A background can look balanced by itself and become distracting once navigation, buttons, and text sit on top. Ask for less detail near those elements if needed.

A coordinated set of blog illustrations

Plan three illustrations for an article about preparing an online shop: photographing a product, arranging a listing, and packing an order. Use the same adult woman, short dark bob, green shirt, terracotta apron, and warm cream studio throughout. Start with the first illustration only. After I approve its style, use it as the visual reference for the other two. No readable UI or invented brand logos.

Approving the first image establishes a concrete visual reference. Keep a short list of recurring traits alongside it. Reusing only a style adjective such as “editorial” leaves too much room for different line weight, lighting, color, and character design.

A game asset with a clear silhouette

Generate a single friendly copper clockwork owl as a game inventory asset. Three-quarter view, wings folded, entire body visible with a generous margin, readable silhouette at small sizes. Hand-painted storybook style, teal enamel accents, no lettering. Use a transparent background if the tool supports it. Save the native output and report whether it actually contains an alpha channel.

Test the asset at its intended display size. Tiny gears and feather detail can disappear in an inventory slot. If the background is a checkerboard painted into the image, it is not transparency; inspect the file rather than relying on appearance.

Ask for integration after choosing the image

Generating an asset and integrating it are separate review points. Once you like the image, give Codex the component or page that should use it and the expected desktop and mobile behavior.

Use the approved hero-green image in the ceramics workshop landing page. Follow the project's existing image component and loading conventions. Keep the full face and hands visible on desktop and mobile. Add descriptive alt text. Preserve the master, and create a high-quality web export without reducing its dimensions. Show the page at desktop and narrow mobile widths and report any crop problems.

The preview is where you catch a clipped face, a missing file, or a subject hidden behind the headline. Ask Codex to report what it actually inspected. If a local server did not start, that is not a successful visual check.

Also keep the image in the project. OpenAI's imagegen guidance notes that built-in outputs may initially live under the Codex image directory. A local preview can work while the website still references a file that will never be deployed. The final page should use a project asset path.

Connect Dream Pixel Forge when you need its tools

For a workflow using Dream Pixel Forge's saved brand context, reference uploads, or image and video generation, connect its MCP tools to Codex. This is a separate service connection and uses your Dream Pixel Forge credits. Start with the CLI setup page.

npx dreampixel-cli login
codex mcp add dpf -- npx -y dreampixel-cli mcp
codex mcp list

The first command authenticates the machine through a browser approval. The second registers the CLI's stdio proxy as an MCP server. The third checks that the server is configured. This combines Dream Pixel Forge's existing proxy with the command structure in OpenAI's MCP documentation; it is a setup recipe, not a claim that a new connection was exercised for this article.

After the tools load, ask for a bounded job:

Use Dream Pixel Forge to inspect my available models and credit costs, then plan one website hero using my saved brand context. Generate one concept with no paid retries. Inspect the result against the brief and report the output and any mismatches. Ask before generating additional versions.

The plan, output, and review should stay connected. If you need more control over commands or want to reuse the setup with another client, our image-generation MCP guide and CLI guide cover those paths.

Troubleshoot the result you actually received

What happenedWhat to ask next
Codex returned code instead of an image.Ask it to check for a callable image tool and produce an actual file.
It asked for an API key unexpectedly.Clarify that you want the built-in route, if available, before considering an API fallback.
The image works locally but is missing from the project.Copy the selected asset into the repo and update the page reference.
A small edit changed the subject.Return to the original reference, narrow the requested change, and inspect identity details.
The desktop hero looks good but mobile cuts off the face.Adjust the crop or use a separately composed mobile image.

A good handoff contains the selected file, its location, the prompt, and any observed limitation. That makes the next revision a concrete editing task instead of an attempt to recreate a forgotten conversation.

Tools for this guide

Frequently asked questions

How is Codex different from ChatGPT?

For this workflow, the useful distinction is project context: Codex can work with your repository, save generated assets, and edit the code that uses them. Check the tools available in your session before assuming image generation is enabled.

Can Codex create design?

With an image tool available, Codex can help create visual assets and integrate them into a project. Give it the intended placement, subject, composition, and file destination, then review the image and its rendered crop.