Nodes/Eric Qwen-Edit & Qwen-Image Nodes/Eric Qwen-Edit Delta Overlay
ComfyUI Node

Eric Qwen-Edit Delta Overlay

The smart-overlay node for high-res Qwen edits

By EricRollei·Created 6 months ago·Updated 4 months ago· 20
Eric Qwen-Edit Delta Overlay
  • original_image
  • edited_image
  • input_mask
  • composite
  • change_mask
  • upscaled_edit
threshold0.050
blur_radius5
expand_mask3
upscale_methodlanczos

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

  1. Original (resized to edit resolution) is compared against the edit.
  2. A per-pixel difference threshold generates a change mask.
  3. The mask gets a Gaussian blur for soft edges, then a dilation (expand_mask) to catch edge artifacts.
  4. The edit is upscaled to the original's resolution.
  5. 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 threshold so only strong deltas count.
  • Halos around edited regions - raise blur_radius and expand_mask so 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_mp your VRAM allows.
  • Everything looks untouched - threshold too high; the edit's changes were subtler than the cutoff. Drop it toward 0.01.
CategoryEric Qwen-Edit

Inputs (7)

NameTypeDefaultDescription
original_imageIMAGEThe original high-resolution image (before editing)
edited_imageIMAGEThe edited image (may be lower resolution than original)
thresholdoptFLOAT0.0500.001–0.5Pixel difference threshold to detect changes (0-1 range). Lower = more sensitive, higher = only major changes.
blur_radiusoptINT50–50Gaussian blur radius for mask edge softening. Higher = smoother transitions between edited and original regions.
expand_maskoptINT30–30Dilate the mask by this many pixels to catch edge artifacts.
upscale_methodoptCOMBOlanczosMethod for upscaling the edited image to original resolution.
input_maskoptMASKOptional: override the auto-detected mask with a manual one. This confines the overlay to only the masked region.

Outputs (3)

NameTypeDescription
compositeIMAGE
change_maskMASK
upscaled_editIMAGE