feat: image_edit tool — prompt-guided img2img editing with OpenAI Codex - #32248
Closed
CipherFrame wants to merge 1 commit into
Closed
feat: image_edit tool — prompt-guided img2img editing with OpenAI Codex#32248CipherFrame wants to merge 1 commit into
CipherFrame wants to merge 1 commit into
Conversation
- New image_edit tool: prompt-guided image-to-image editing - Codex provider: edit() method via Responses API with input_image - Provider interface: supports_edit() + edit() on ImageGenProvider base - 40 new tests: schema, handler, provider validation, error paths - Tool wired into model_tools, toolsets, prompt_builder, CLI config - ACP adapter + MCP server transport updated for tool schema Motivation: enables historical photo restoration, style transfer, and reference-guided image editing without leaving Hermes. Closes the gap where image_generate (text-to-image) was the only option — now agents can intelligently choose image_edit when a reference image is provided.
Collaborator
|
Saturated image_edit feature cluster — competing with multiple open PRs:
Also see closed #19261 (first-class image_edit tool, same architecture with supports_edit()/edit() on ImageGenProvider ABC). |
Contributor
|
Thanks for the Codex image-editing implementation. The member's cluster note correctly identified overlapping work; automated hermes-sweeper review found that this capability is now implemented on
Current main deliberately uses one |
This was referenced Aug 3, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Adds an
image_edittool that enables prompt-guided, image-to-image editing via the OpenAI Codex provider (GPT Image 2). Agents can now intelligently route toimage_editwhen the user provides a reference image, instead of falling through to text-to-image generation.What it does
image_edittool (tools/image_edit_tool.py): dispatches to any provider that supportsedit()edit()method: passes a reference image through the Codex Responses API (input_image+ text prompt)supports_edit()andedit()onImageGenProviderbase, defaulting to unsupported for existing providersFiles changed
12 files, 825 insertions, 18 deletions. 40 new tests, 141 existing pass — zero regressions.
Test plan
edit(): auth errors, missing/invalid image, nonexistent pathsedit(): streams input_image through Responses API, validates responseDemo
Before (B&W damaged historical photo) → After (restored, colorized):
Smoke-tested in Hermes Telegram gateway —
gpt-image-2-highsuccessfully processed a 1890s football team photograph with scratch removal, stain cleanup, and natural colorization.Why
Closes the gap where
image_generate(text-to-image) was the only option. Agents now seeimage_editas a mandatory tool when a reference image is present ("Mandatory: when the user provides, uploads, links, or names any reference/source/product/person image, use this image-to-image tool rather than image_generate/text-to-image"). This enables historical photo restoration, style transfer, product variant editing, and other reference-guided workflows.Submitted from CipherFrame fork — happy to iterate based on review feedback.