feat(image-gen): support Codex image editing #1
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "feat/openai-codex-image-editing"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
What does this PR do?
Adds image-to-image / editing support to the OpenAI Codex-authenticated image backend.
Hermes already accepts
image_urlandreference_image_urlsat the image-generation provider boundary, but theopenai-codexprovider advertised text-only capability and rejected image inputs. This PR keeps the existing Codex Responsesimage_generationtool path and attaches source/reference images as Responsesinput_imagecontent parts. Public URLs and existing data URLs pass through directly; local file paths are inlined asdata:image/...;base64,...URLs so the Codex backend can read them.This makes the Codex-auth backend match the regular OpenAI
gpt-image-2provider's editing capability while preserving the existing text-to-image behavior when no image inputs are supplied.Related Issue
N/A — no issue linked.
Type of Change
Changes Made
plugins/image_gen/openai-codex/__init__.pymodalities: ["text", "image"]withmax_reference_images: 16.image_urlandreference_image_urlsinstead of returningmodality_unsupported.input_textplus oneinput_imagepart per source/reference.modality: "image".tests/plugins/image_gen/test_openai_codex_provider.pywebsite/docs/user-guide/features/image-generation.mdHow to Test
OpenAICodexImageGenProvider.generate(...)with a localimage_urlpath.success: true,provider: "openai-codex", andmodality: "image".Checklist
Code
fix(scope):,feat(scope):, etc.)pytest tests/ -qand all tests pass — not checked because this branch was validated with the canonical affected-suite runs below; currentmainis already green and this branch only touches the Codex image-provider pathDocumentation & Housekeeping
docs/, docstrings) —website/docs/user-guide/features/image-generation.mdcli-config.yaml.exampleif I added/changed config keys — N/A, no config keys changedCONTRIBUTING.mdorAGENTS.mdif I changed architecture or workflows — N/A, no architecture/workflow changeopenai-codexFor New Skills
N/A — this PR does not add a skill.
Screenshots / Logs
Branch state after rebasing onto current
main:Changed files:
Validation performed after rebase:
TDD red run before implementation:
Live Codex OAuth smoke test against the modified provider:
The live output was a real PNG generated from a local input image; visual inspection confirmed the edit preserved the simple bordered composition and changed the target circle from blue to green.
7f03eb662a0b500ddd0cView command line instructions
Checkout
From your project repository, check out a new branch and test the changes.Merge
Merge the changes and update on Forgejo.Warning: The "Autodetect manual merge" setting is not enabled for this repository, you will have to mark this pull request as manually merged afterwards.