Eric Qwen-Edit Delta Overlay
The smart-overlay node for high-res Qwen edits
- original_image
- edited_image
- input_mask
- composite
- change_mask
- upscaled_edit
Here's the high-res editing problem this node exists to solve: you have a 20 MP photo, Qwen-Edit is happiest (and fastest) at a few megapixels, and editing the whole 20 MP directly is slow or OOMs. So you edit a downscaled copy, and you're left with a 2 MP edit and a 20 MP original. Eric Qwen-Edit Delta reconciles them: it compares the edit against the original, figures out which pixels actually changed, upscales the edit to match the original, and composites only the changed areas back onto the full-resolution original.
The result: all 20 MP of original detail everywhere Qwen-Edit didn't touch, and the AI edit applied only where it matters. The README's framing is exactly right - "preserves all the original resolution and detail in unchanged areas, while applying the AI edit only where needed."
How it works
- Original (resized to edit resolution) is compared against the edit.
- A per-pixel difference threshold generates a change mask.
- The mask gets a Gaussian blur for soft edges, then a dilation (
expand_mask) to catch edge artifacts. - The edit is upscaled to the original's resolution.
- The changed areas are composited onto the original.
The inputs
original_image- the high-resolution original (before editing).edited_image- the edit, possibly lower resolution.threshold- per-pixel difference cutoff (0.001–0.5, default 0.05). Lower = more sensitive (catches subtle changes), higher = only major changes. If your edit changed the color grade globally, you'll see threshold noise; raise it.blur_radius- Gaussian blur on the change mask (0–50, default 5). Higher = smoother transition between edited and original regions.expand_mask- dilate the mask by N pixels (0–30, default 3) to swallow edge artifacts.upscale_method- lanczos (default), bilinear, bicubic, nearest - how the edit is resized to original resolution.input_mask- optional manual mask. When provided, it's intersected with the auto-detected change mask, confining the overlay to only that region.
Outputs: composite (the final high-res image), change_mask (the binary mask of detected changes - handy for debugging or feeding elsewhere), and upscaled_edit (the edit resized to match the original, before compositing).
The workflow it enables
20 MP original ──→ downscale → Qwen-Edit Image (2 MP edit)
│ │
└────────────── Delta Overlay ◄──────┘
│
20 MP composite
Edit at low res, keep the original, let Delta reattach the changes at full res. No tiled upscaling, no losing detail.
Installing it
ComfyUI Manager → "Eric Qwen-Edit", or:
cd ComfyUI/custom_nodes
git clone https://github.com/EricRollei/Eric_Qwen_Edit_Experiments.git
Restart. Delta itself is pure image math - no model needed - but the edit node feeding it needs a loaded Qwen-Image-Edit pipeline via the pack's loader (Qwen/Qwen-Image-Edit-2511, ~54 GB).
Troubleshooting
- The whole frame changed, so the whole frame got overlaid - a global edit (color grade, lighting change) produces change everywhere. That's correct behavior, but the overlay loses its purpose; either edit in a way that localizes changes, or raise
thresholdso only strong deltas count. - Halos around edited regions - raise
blur_radiusandexpand_maskso the boundary transitions over more pixels. - Blurry edited areas - the edit was upscaled to match; if the edit is very low-res and the change region large, that's inherent. Edit at the highest
max_mpyour VRAM allows. - Everything looks untouched -
thresholdtoo high; the edit's changes were subtler than the cutoff. Drop it toward 0.01.
Inputs (7)
| Name | Type | Default | Description |
|---|---|---|---|
| original_image | IMAGE | The original high-resolution image (before editing) | |
| edited_image | IMAGE | The edited image (may be lower resolution than original) | |
| thresholdopt | FLOAT | 0.0500.001–0.5 | Pixel difference threshold to detect changes (0-1 range). Lower = more sensitive, higher = only major changes. |
| blur_radiusopt | INT | 50–50 | Gaussian blur radius for mask edge softening. Higher = smoother transitions between edited and original regions. |
| expand_maskopt | INT | 30–30 | Dilate the mask by this many pixels to catch edge artifacts. |
| upscale_methodopt | COMBO | lanczos | Method for upscaling the edited image to original resolution. |
| input_maskopt | MASK | Optional: override the auto-detected mask with a manual one. This confines the overlay to only the masked region. |
Outputs (3)
| Name | Type | Description |
|---|---|---|
| composite | IMAGE | — |
| change_mask | MASK | — |
| upscaled_edit | IMAGE | — |