Repository navigation
Studio: add Qwen-Image-2.1 image editing - #11587
Merged
Merged
Conversation
…a to capable sd.cpp builds
…d drop a stale localized layer at once
…rojector for PR unslothai#11587 The projector (mmproj-F16.gguf) is now a listed native asset, and a local_files_only load fails on any uncached asset, so a Qwen-Image-2.1 GGUF cached before this change stopped restoring even though text-to-image never reads the projector. Skip an uncached llm_vision asset offline instead; edit is already offered only when it is loaded, and opening the model from the Images page fetches it.
shaojun
pushed a commit
to shaojun/unsloth
that referenced
this pull request
Sep 29, 2026
* Studio: add Qwen-Image-2.1 image editing * Keep Match Image 1 sizes valid, pad native masks black, and pass alpha to capable sd.cpp builds * Trim comments * Share conditioned-field checks across engines, bound native sizes, and drop a stale localized layer at once * Fix offline load of a cached Qwen-Image-2.1 GGUF without the vision projector for PR unslothai#11587 The projector (mmproj-F16.gguf) is now a listed native asset, and a local_files_only load fails on any uncached asset, so a Qwen-Image-2.1 GGUF cached before this change stopped restoring even though text-to-image never reads the projector. Skip an uncached llm_vision asset offline instead; edit is already offered only when it is loaded, and opening the model from the Images page fetches it. * Fail closed on unreadable builds for native edit and reference fidelity * Move Edit right after Create in the Images workflows --------- Co-authored-by: danielhanchen <[email protected]>
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.
Adds Qwen-Image-2.1 editing to Studio's Images page, with multiple reference images, localized edits and transparent PNG output. The same model remains available for text-to-image generation.
Previously, image input was only exposed through Reference, which discarded transparency and kept at most four images. Native GGUF loads could not edit images.
What changes
Both Diffusers and native sd.cpp/GGUF can run edits. The backend enforces each model's image and size limits, includes references in its memory estimate, and fixes the offloaded vision-encoder device mismatch that prevented image-conditioned calls.
Screenshots
Taken from a fresh Studio profile in Chromium (en-US, 2x scale) with Qwen-Image-2.1 on Diffusers. Each output is the result of the request shown.
Combining images: the empty room is Image 1, the rocking chair Image 2 and the sofa Image 3.

Localized edit with a colour annotation. "Add region wording" appended the instruction to leave the marks out, and the red circle is gone from the result.

Transparent-layer edit. "Ask for a transparent background" adds the model card's prompt wording, and the output keeps its alpha.
Separate mask: the painted region is sent as Image 2, and the rider appears only there.
Verification
Live runs used Linux/CUDA on RTX 6000 Ada and RTX 3090.
c92d73cbuilt locally, Q6_KA Diffusers run matched a direct pipeline call pixel-for-pixel with the same settings.
Transparent edit of the same RGBA source (fully transparent pixels in the output):
Subject extraction on the native upstream build reached 72.7% transparent, with some white patches left in the background.
Backend suites: 1,545 passed. Frontend typecheck passed. The full frontend suite had eight failures out of 8,475 tests: seven also fail on
origin/main; the remaining transport test passes in isolation on both branches.Scope and limitations
The pinned native build (
master-813-bfbef5b-u1d02858) predates upstream's reference fixes (78557f8,e012065,e112ab5). Studio checks the binary for a string the alpha fix added. When it is missing, Studio flattens input transparency onto white and pads references so sd-server does not crop them, and the page says so. Separate masks are padded with black so the padding adds no edit region. With a build that has the fixes, images go through unchanged and native transparent editing works. Shipping that needs a new mirror release of the pinned sd.cpp. On any native build, transparent output needs guidance above 1, and the page says so.Match Image 1 always produces a size the API accepts. For an extreme aspect ratio such as 4096x256, the short side is held at 256 and the long side capped at the model's maximum.
Native loads also download a 1.16 GB vision projector.
INT8/FP8 transformer builds, other platforms and 2K outputs were not validated. Ten references at 1024 detail and one at 2048 detail exhausted memory on the RTX 3090.