Smart merge images
The node that fixes pixel drift when Qwen-Edit or Klein edits your image
- original_image
- edited_crop_B
- original_crop_A
- Merged_Image
Smart merge images is the flagship node of this pack, and it exists to solve a very 2026 problem: instruction editors like Qwen-Image-Edit and Flux 2 Klein don't patch your image - they re-emit the whole frame. Pixels you didn't ask to change come back slightly shifted, and the colors drift. So when you crop a region, edit it, and try to stitch it back onto the original, it doesn't line up. This node does the stitching for you: it finds the shared features between the edited crop and the original, warps them back into alignment, matches the color, and merges them into a seam-free result.
How it works
You feed it two images: original_image and edited_crop_B (the edited region to merge back). The node finds matching features between them, computes the transform that re-aligns the edit to the original, and blends. There's also an optional original_crop_A input - and the README's advice is worth taking: for the most reliable merge, use all three, where original_crop_A is the unmodified crop from the original image. That third input gives the matcher a clean reference and dramatically improves alignment.
The knobs are split into stages:
match_method- how features are found:SIFT (OpenCV)(fast, classic), orDISK + LightGlue/SIFT + LightGlue(learned matching, more robust).warp_method- how the edit is realigned:Homography(affine-ish plane warp),Homography + Optical Flow, or pureOptical Flowfor handling more complex distortion.optical_flow- which flow estimator to use when flow is involved:Farneback,DIS, orRAFT-Small/RAFT-Large(the bigger, the more accurate, the slower).color_match- nine modes includingHistogram,LAB_Mean,SeamlessClone (PS Auto Blend),Laplacian Pyramid Blend, and the pack's ownAdaptive Local (strong), which is specifically tuned to repair the color shift from editing models. This one has two companion knobs:adapt_thresh(color difference threshold) andadapt_local_match(which local matching flavor the adaptive mask fusion uses).feather_kernel(0–256) - softness of the merge seam.merge_mode-One to Onemerges a single pair;All to Onehandles the tiled case.
use_gpu toggles GPU acceleration (default on - flip it off if you're getting VRAM pressure or crash-on-driver weirdness), and force_recompute re-runs the feature matching instead of reusing a cached result, which you'll want after changing inputs.
Tiled merging
v1.4.7 added support for merging multiple crops in one go: edited_crop_B can take a batch of crop images and the node returns a single fully merged Merged_Image. The catch, stated plainly in the README: the input must be a batch, not a list. If you're feeding it from a list-producing node, convert it first with an Image List To Batch node or it won't work.
The model download you should know about
Some of the advanced matching/color options need model files. They're optional - if you don't use those options, nothing downloads. When you do, the node auto-downloads them to ComfyUI/models/elementEasy on first run. If you'd rather pre-stage them (or you're offline), copy the elementEasy folder from the pack's models directory into that same path and it'll skip the download.
Installing it
It ships in supElement/ComfyUI_Element_easy:
cd ComfyUI/custom_nodes
git clone https://github.com/supElement/ComfyUI_Element_easy.git
Restart ComfyUI, or install via ComfyUI Manager by searching ComfyUI_Element_easy. This is the one node in the pack with real dependencies - OpenCV at minimum, plus the matching/flow machinery for the advanced modes - so expect the first run to be heavier than the rest of the pack.
Gotchas
The "batch not list" rule for tiled merging is the number one tripwire. After that: the merge only works when the images actually share enough common features - if the edit changed too much (completely new content, no overlap), there's nothing to align and the result will be rough. Start with SIFT (OpenCV) for speed and only escalate to LightGlue/RAFT when alignment is bad. And the Adaptive Local (strong) color mode is specifically the fix for Qwen-Edit-style color shift - if that's your problem, use it rather than the generic modes.
Inputs (13)
| Name | Type | Default | Description |
|---|---|---|---|
| original_image | IMAGE | — | |
| edited_crop_B | IMAGE | — | |
| match_method | COMBO | 3 options: DISK + LightGlue, SIFT + LightGlue, SIFT (OpenCV) | |
| warp_method | COMBO | 3 options: Homography, Homography + Optical Flow, Optical Flow | |
| optical_flow | COMBO | 4 options: Farneback, DIS, RAFT-Small, RAFT-Large | |
| color_match | COMBO | 9 options: Patch_based_color, Boundary-Aware Color, Laplacian Pyramid Blend, SeamlessClone (PS Auto Blend), Adaptive Local (strong), Histogram, +3 | |
| feather_kernel | INT | 200–256 | — |
| adapt_thresh | INT | 250–255 | — |
| adapt_local_match | COMBO | 5 options: Histogram, LAB_Mean, Reinhard, Adaptive Histogram, None | |
| merge_mode | COMBO | 2 options: All to One, One to One | |
| use_gpu | BOOLEAN | true | — |
| force_recompute | BOOLEAN | false | — |
| original_crop_Aopt | IMAGE | — |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| Merged_Image | IMAGE | — |