π¨ Quick Merge
Quick Merge isn't quick, and it isn't a checkpoint merge β it's a one-node compositing factory
- Background
- Foreground (optional)
- mask (optional)
- composited_image
- light_mask
- relight_fg_crop
- relight_bg_crop
If "merge" makes you think of checkpoint merging, forget that immediately. π¨ Quick Merge (class QuickMergeNode) is the opposite thing: one giant node that pastes a foreground cutout onto a background, then optionally cuts it out, resizes it, repositions it, blends it, filters it, shadows it, upscales it, and does all of that across whole folders of images. The name is doing a lot of heavy lifting - "quick" and "merge" are the two least accurate words here. It's a single-node compositing factory.
You'd reach for this when a normal graph starts to feel like a plate of spaghetti. The usual product-shot pipeline - cut the subject out with BiRefNet, drop it on a background, scale and nudge it, drop a shadow, upscale - takes six or seven nodes in vanilla ComfyUI. This packs the chain behind one socket setup and, crucially, makes it batchable.
What it actually is
Three image inputs in, one composite out. Background is the required canvas. Foreground (optional) is what gets stamped on top, and mask (optional) feeds the light-pipeline (more on that below). Everything else is a toggle.
It's really four engines behind one face:
- Cutout. Turn on βοΈ
merge_imageand pick βοΈcutout_model- BiRefNet (lite, standard, HR), RMBG-1.4/2.0, or "None (Use Alpha)" if your foreground already has transparency. These are the real deal: the same BiRefNet weights the ecosystem standardised on for hair and fabric edges, loaded straight from HuggingFace viatransformers. BiRefNet_lite is the sensible default; reach for BiRefNet_HR above ~1500px so the model doesn't downscale your edges internally. - Placement. βοΈ
foreground_size, βοΈforeground_left_right, βοΈforeground_up_downdo exactly what they say, plus flips, rotation, edge shrink/feather, opacity, and a handful of blend modes. The one you'll actually touch first isforeground_size- 1.0 means "fit the foreground onto the background canvas." - AI upscale. β‘
ai_upscaleruns a RealESRGAN_x2plus model through spandrel, withupscale_byfor the factor andtile_size(0 = whole image, 512 default) to keep VRAM sane. - Batch. π
batch_processingwith folder paths (more below), pairing either 1-to-1 sequentially or cross-multiplying every foreground with every background.
The four outputs are composited_image (the one you care about), light_mask, and relight_fg_crop / relight_bg_crop. The last three serve a relighting pass downstream: light_mask is your cutout or input mask, blurred into a soft gradient you can feed an IC-Light-style node. If you just want a picture, wire composited_image to a Save Image and ignore the rest.
How it survives big batches
The trick that makes folders possible is chunking and VRAM isolation. batch_chunk_size (default 4) caps how many frames go through the heavy pipeline at once, and the loader normalises every file - a 3-channel .jpg and a 4-channel .png mixed in the same run - into uniform RGBA float32 tensors before the compositor sees them. It clears the CUDA cache between chunks, which is why the README can promise BiRefNet over massive batches without OOM. One gotcha hidden in the source: batch folder paths are relative to your ComfyUI/input directory, not arbitrary filesystem paths. The author patched a path-traversal hole in there, so don't fight it - drop your folders under ComfyUI/input/ and reference them by name.
Install
ComfyUI Manager β search ComfyUI-Quick-Merge (or "Quick Merge"), or the manual way:
cd ComfyUI/custom_nodes
git clone https://github.com/stompy001/ComfyUI-Quick-Merge
Restart ComfyUI. Dependencies are transformers, torchvision, and spandrel - the node tries to auto-install the first three on first import. The heavier cost is model downloads: the cutout weights pull from HuggingFace the first time you run a cutout, and the first upscale downloads RealESRGAN_x2plus.pth from GitHub releases. First runs are slow; subsequent ones cache.
Where people get burned
The README's own warnings are the real ones, not invented friction:
- VRAM. β‘
ai_upscaleabove 2.0Γ over a big batch will happily eat your graphics memory. Keepbatch_chunk_sizeat 1β4 when upscaling. The tooltip says "0 = no limit" but the field's minimum is 1 - treat 1 as the floor, not a suggestion. - Aspect ratio parity. Studio backgrounds with a podium or table must all be the same resolution and aspect ratio in a folder batch, or the pedestal coordinates drift between frames and your product lands off-target. This is a real constraint, not a warning for show.
- Don't touch auto-position. The
auto-position (WiP)toggle is locked down mid-refactor; the node forces it off anyway. Leave it alone. - First run looks frozen while a segmentation model downloads. It's not dead, it's fetching ~600MB of BiRefNet weights over your connection.
Is it the node for a one-off composite? Overkill - the vanilla image nodes do that in three clicks. It earns its keep when you're stamping a hundred product shots onto a hundred backgrounds without babysitting. That's the workflow this was built for.
Inputs (60)
| Name | Type | Default | Description |
|---|---|---|---|
| Backgroundopt | IMAGE | β | |
| Foreground (optional)opt | IMAGE | β | |
| mask (optional)opt | MASK | β | |
| π batch_processingopt | BOOLEAN | false | CRITICAL: Ensure all images processed in a folder batch share identical resolutions and aspect ratios to prevent platform layout shifts. |
| π foreground_batchopt | BOOLEAN | false | β |
| π fg_batch_folderopt | STRING | π Type or paste folder path here... | β |
| π background_batchopt | BOOLEAN | false | β |
| π bg_batch_folderopt | STRING | π Type or paste folder path here... | β |
| π batch_pairing_modeopt | COMBO | 2 options: 1-to-1 Match (Sequential), Cross-Multiply (All Combinations) | |
| π batch_chunk_sizeopt | INT | 41β128 | Max images processed at once through the heavy pipeline. 0 = no limit. |
| π initial_resizeopt | BOOLEAN | false | β |
| π fg_resize_modeopt | COMBO | Crop to Fill (Preserve Aspect) | 4 options: Crop to Fill (Preserve Aspect), Stretch to Fit, Fit Inside (Letterbox), Fit Inside (Pad with Blur) |
| π fg_crop_alignopt | COMBO | center | 5 options: center, top, bottom, left, right |
| π fg_initial_widthopt | INT | 7208β16384 | β |
| π fg_initial_heightopt | INT | 12808β16384 | β |
| π bg_resize_modeopt | COMBO | Crop to Fill (Preserve Aspect) | 4 options: Crop to Fill (Preserve Aspect), Stretch to Fit, Fit Inside (Letterbox), Fit Inside (Pad with Blur) |
| π bg_crop_alignopt | COMBO | center | 5 options: center, top, bottom, left, right |
| π bg_initial_widthopt | INT | 19208β16384 | β |
| π bg_initial_heightopt | INT | 10808β16384 | β |
| βοΈ merge_imageopt | BOOLEAN | false | β |
| βοΈ cutout_modelopt | COMBO | 6 options: BiRefNet_lite (Fast/Accurate), RMBG-2.0 (New/Accurate), RMBG-1.4 (Fast), BiRefNet (High Quality), BiRefNet_HR (4K/8K High Quality), None (Use Alpha) | |
| βοΈ auto-position (WiP)opt | BOOLEAN | false | β |
| βοΈ foreground_sizeopt | FLOAT | 1.000.01β100 | β |
| βοΈ foreground_left_rightopt | INT | 0-8192β8192 | β |
| βοΈ foreground_up_downopt | INT | 0-8192β8192 | β |
| βοΈ flip_horizontalopt | BOOLEAN | false | β |
| βοΈ flip_verticalopt | BOOLEAN | false | β |
| βοΈ rotation_degreesopt | INT | 0-360β360 | β |
| βοΈ edge_shrink_growopt | INT | 0-100β100 | β |
| βοΈ edge_softnessopt | INT | 00β255 | β |
| βοΈ foreground_opacityopt | FLOAT | 1.000β1 | β |
| βοΈ blend_modeopt | COMBO | 5 options: Normal, Multiply, Screen, Overlay, Soft Light | |
| βοΈ blend_strengthopt | FLOAT | 1.000β1 | β |
| β‘ ai_upscaleopt | BOOLEAN | false | β |
| β‘ pipeline_orderopt | COMBO | 3 options: upscale composite, upscale foreground only, upscale background only | |
| β‘ choose_upscale_modelopt | COMBO | 1 options: RealESRGAN_x2plus.pth (Auto-Download) | |
| β‘ upscale_byopt | FLOAT | 2.000.25β32 | β |
| β‘ tile_size (0 means off/native)opt | INT | 5120β8192 | β |
| β‘ post_upscale_edge_softenopt | INT | 00β255 | β |
| π¨ colors_and_filtersopt | BOOLEAN | false | β |
| π¨ filter_targetopt | COMBO | 3 options: Foreground, Background, Both | |
| π¨ filter_typeopt | COMBO | 7 options: Gaussian Blur, Auto-Color Match, Laplacian Sharpen, Edge Detect, Sepia, Invert, +1 | |
| π¨ filter_strengthopt | FLOAT | 1.000β10 | β |
| π¨ brightnessopt | FLOAT | 0.00-2β2 | β |
| π¨ contrastopt | FLOAT | 1.000β5 | β |
| π¨ saturationopt | FLOAT | 1.000β5 | β |
| π¨ filter_sizeopt | INT | 31β127 | β |
| π¨ background_bluropt | INT | 00β255 | β |
| π shadowsopt | BOOLEAN | false | β |
| π shadow_color_hexopt | STRING | #000000 | β |
| π shadow_darknessopt | FLOAT | 0.500β1 | β |
| π shadow_softnessopt | INT | 151β255 | β |
| π shadow_position_xopt | INT | 10-1000β1000 | β |
| π shadow_position_yopt | INT | 10-1000β1000 | β |
| π― target_resolutionopt | BOOLEAN | false | β |
| π― target_resize_modeopt | COMBO | 4 options: Crop to Fill (Preserve Aspect), Stretch to Fit, Fit Inside (Letterbox), Fit Inside (Pad with Blur) | |
| π― target_crop_alignopt | COMBO | 5 options: center, top, bottom, left, right | |
| π― target_widthopt | INT | 192064β16384 | β |
| π― target_heightopt | INT | 108064β16384 | β |
| πΌοΈ pixel_smoothingopt | COMBO | 4 options: bicubic, lanczos, bilinear, nearest |
Outputs (4)
| Name | Type | Description |
|---|---|---|
| composited_image | IMAGE | β |
| light_mask | MASK | β |
| relight_fg_crop | IMAGE | β |
| relight_bg_crop | IMAGE | β |