Nodes/ComfyUI-xiaozhuguang/小珠光 IM (图像合并)
ComfyUI Node

小珠光 IM (图像合并)

The merge half of split-and-merge

By xiaozhuguang·Created 2 months ago·Updated a day ago· 56
小珠光 IM (图像合并)
  • images
  • split_data
  • masks
  • merged

Big images break the latent budget. The workaround is as old as the ecosystem: split the image into tiles, process each tile at a resolution the model can actually handle, then stitch them back. 小珠光 IM (图像合并, Image Merger) is the stitch half of that split-and-merge pair - it takes the image blocks from the pack's splitter (via its SPLIT_DATA) and reassembles them into the original, with feathered overlap blending so the tile boundaries don't show.

You'd reach for it when a 4K image needs a pass that SDXL-class models can't do at native size: split into overlapping tiles, run your img2img or upscaler per tile, merge back with the overlap region crossfaded instead of hard-cut. It also merges masks alongside the images, so tile-based inpainting can stay masked end to end.

How it works

It consumes a SPLIT_DATA object (the pack's XiaozhuguangImageSplitter produces it) that records each block's original position and the overlap geometry. The merger places every block at its full_pos, and in overlap regions it builds a feather mask - Gaussian-blurred toward zero at the tile edges - then blends blocks together in weight-normalized fashion: each pixel is a weighted average of whatever blocks cover it. No overlap, no feather, but the splitter's blocks are designed with overlap for exactly this reason. It accepts a list of images and an optional list of masks, and outputs a list of merged images (OUTPUT_IS_LIST).

The inputs that matter

  • images - the list of processed tiles.
  • split_data - the SPLIT_DATA from the pack's splitter. This is what tells the merger where everything goes.
  • masks - optional, the matching list of tile masks.

Output: merged - a list of reconstructed IMAGE tensors.

Keep the pairing straight: the split_data must come from the splitter that actually produced the tiles you processed. Feed a tile from one split job with data from another and the positions are garbage in, garbage out.

Install

From the ComfyUI-xiaozhuguang pack - Manager (search "ComfyUI-xiaozhuguang"), or:

cd ComfyUI/custom_nodes/
git clone https://github.com/xiaozhuguang/ComfyUI-xiaozhuguang.git

Restart. No dependencies beyond torch + OpenCV.

Gotchas

The honest caveat about tile-merge workflows applies here with full force: even with feathering, a tile processed independently comes back with slightly different style, color, or noise, and the seams are where that shows. Lower denoise per tile and keep overlap generous to give the feather something to work with. And because the output is a list of merged images (one per source batch), check what your downstream expects - most save nodes handle a list fine, but single-image nodes may need you to index it.

Categoryxiaozhuguang

Inputs (3)

NameTypeDefaultDescription
imagesIMAGE
split_dataSPLIT_DATA
masksoptMASK

Outputs (1)

NameTypeDescription
mergedIMAGE