Conversation
Add Capability::ImageEdit and InferenceRequest.input_mask. The backend posts multipart to the OpenAI-compatible /images/edits endpoint: the input image is resolved from messages[0].images[0] (data: URL, local path, or http(s) download) and passed through with the mask untouched — a PNG whose fully transparent areas mark where to regenerate (the OpenAI convention). No mask = whole-image I2I edit. Co-Authored-By: Claude <noreply@anthropic.com>
…stency) gpt-image-1 style: every messages[0].images entry rides as its own multipart image part — first is the edited base, the rest are consistency anchors. Co-Authored-By: Claude <noreply@anthropic.com>
The tests were introduced with the capability but leaned on the dev-dep from the stacked branch; make it explicit so this branch stands alone. Co-Authored-By: Claude <noreply@anthropic.com>
amosgeek
force-pushed
the
feat/image-edit
branch
from
August 26, 2026 04:53
68fb043 to
dd8a20c
Compare
Author
|
Rebased onto current main — the branch now carries only the two image-edit commits (plus an explicit axum dev-dependency for the mock-server tests), no longer stacked on #12. Workspace tests green. |
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.
What
Adds an
image_editcapability so callers can regenerate an input image — either whole (I2I) or restricted to a painted region (inpainting) — over any OpenAI-compatible/images/editsendpoint (gpt-image-1 style).Capability::ImageEdit(image_edit, aliasesimage-edit/inpaint/inpainting)InferenceRequest.input_mask: data: URL / local path / http(s) URL for a mask PNG, transparent (alpha 0) areas mark where to regenerate — the OpenAI convention, passed through to the provider untouched.None= whole-image I2I.messages[0].images(the same slot VLM uses); every entry becomes its own multipartimagepart (gpt-image-1 multi-reference consistency — first is the edited base, the rest are anchors).fetch_image_ref: base64 data-URL decode, local file read, or http(s) download with content-type.invoke_image_editposts multipart (model,prompt,n,image×refs, optionalmask, optionalsize), then reuses the same b64/url artifact resolution asimage_gen(extracted intoimage_bytes_from_response).config.example.tomldocuments the setup.Testing
5 new tests in
openai_compatagainst a live local axum mock (multipart wire assertions — image/mask/size parts, reference bytes inline, b64 artifact written to disk), maskless whole-image edit, missing-input-image rejection,parse_data_urlunit cases, and one-part-per-reference. Full workspace suite green.Stacked on #12 (provider config API) — only the last two commits are new here.
🤖 Generated with Claude Code