Skip to content

feat(codex): support image references for Responses imagegen and add playground UI#1024

Open
0x0079 wants to merge 3 commits into
mainfrom
codex/update-imagegen-support-for-references
Open

feat(codex): support image references for Responses imagegen and add playground UI#1024
0x0079 wants to merge 3 commits into
mainfrom
codex/update-imagegen-support-for-references

Conversation

@0x0079

@0x0079 0x0079 commented May 22, 2026

Copy link
Copy Markdown
Collaborator

Motivation

  • Add support for sending reference images to the Responses-based image generation flow so Codex-backed imagegen can accept image references in addition to text prompts.
  • Improve the Playground UX so users can provide reference image URLs when experimenting with image generation.
  • Keep the change additive and backward-compatible so existing imagegen calls without references continue to work.

Description

  • Update buildImageGenerationResponsesRequest to append input_image content items (with image_url) after the prompt when reference URLs are present in the ImageGenerateParams payload.
  • Add helpers extractImageReferencesFromImageGenerateRequest and normalizeStringSlice to parse input_image_refs, image_urls, or reference_images arrays from the image generation request body and normalize them safely.
  • Update the Playground at frontend/src/pages/scenario/PlaygroundPage.tsx to add imageRefs state, a multiline text input for one-URL-per-line references, and forward references via extra_body.input_image_refs in client.images.generate(...).
  • Formatting and minor housekeeping applied (gofmt).

Testing

  • Ran gofmt -w internal/client/codex_client.go successfully.
  • Ran frontend lint with npm --prefix frontend run -s lint -- frontend/src/pages/scenario/PlaygroundPage.tsx, which completed successfully but reported unrelated pre-existing warnings.
  • Attempted go test ./internal/client -run TestCodex -count=1, which failed in this environment due to a missing local replacement module (libs/anthropic-sdk-go) unrelated to the changes, so unit tests could not be fully executed here.

Codex Task

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant