Nodes/ComfyUI-gen2/Gen2 Tile Merger
ComfyUI Node

Gen2 Tile Merger

The blend modes that decide whether your tile seams show

By petmycat·Created 7 months ago·Updated 12 days ago· 23
Gen2 Tile Merger
  • tile_layout
  • processed_tiles_image_list
  • masks_list
  • merged_image
blend_modenone
blend_strength1.00
seam_modemiddle
histogram_matchingfalse

This is where the tiling workflow either looks seamless or looks like a quilt. You've split the image, sampled each tile independently, and now you need to put the pieces back. The Gen2 Tile Merger recombines processed tiles into one image using the tile_layout from the splitter, and the interesting part of this node is entirely in its blend_mode - because how you resolve the overlapping halos is what determines whether the seams show.

The blend modes

  • none - base-only paste. Halos are discarded; each tile contributes only its owned base region, and since those bases exactly partition the image, you get a perfect reconstruction with no blending math at all. This is the fast path for masked-inpaint workflows, where the halos are supposed to be unchanged context anyway. If you wire in a masks_list (from Gen2 Tile Masks), those masks are used directly, so your feathered masks are honored here too. This is the one to use for bit-exact round-trips - the pack's smoke test verifies none reproduces the original image exactly.
  • linear - normalized weighted average. Each tile gets a linear-falloff mask (1.0 over the base, dropping to 0 at the halo's outer edge) and the output is a weighted average across all tiles covering each pixel. Identity-preserving in the round-trip test.
  • gaussian - same idea with a Gaussian falloff whose sigma is blend_strength × max(overlap_px) / 2. The plateau is inflated by 3σ so the base region stays at 1.0 and the falloff lives entirely inside the halo. The go-to for generation where you want a soft transition.
  • multi_band - sequential Laplacian-pyramid blend. First tile pasted at full strength, then each subsequent tile pyramid-blends into the canvas using its Gaussian mask. Highest quality on high-contrast seams, and the slowest. blend_strength controls pyramid depth (0 → 1 level, 1 → 6 levels).

The other dials

seam_mode - middle (default) uses the natural geometric falloff; optimal runs a per-pixel DP min-cut through the shared overlap band between adjacent tiles and forces the masks to follow the lowest-energy cut, which hides seams better when content is high-contrast. Caveat from the README: the DP loop is a naive Python inner loop, so it's fine for typical overlaps but slow for very large ones.

histogram_matching - Reinhard mean/std color transfer applied to each tile (except the first column) using its left neighbor's overlap band as reference. Flip it on when each tile was sampled independently and you can see tile-to-tile color drift. Cheap, and usually worth it in that situation.

Inputs

Required: tile_layout (GEN2_TILE_LAYOUT from the splitter), blend_mode, blend_strength (0–1, default 1), seam_mode, histogram_matching. Optional: processed_tiles_image_list (your regenerated tiles) and masks_list (from Gen2 Tile Masks). Output: merged_image.

Installation

Via ComfyUI Manager (search "ComfyUI-gen2"), or clone and pip install -r requirements.txt:

cd ComfyUI/custom_nodes
git clone https://github.com/petmycat/ComfyUI-gen2
cd ComfyUI-gen2
pip install -r requirements.txt

The tiling section needs scipy (in requirements.txt). Missing it → [Gen2] Tiling nodes not available in the console.

Common issues

  • Visible seams with linear/gaussian. The blend softens the transition but can still ghost if the regenerated bases genuinely disagree at the boundary (each tile was sampled independently). That's what the two-pass seam-fix workflow (Gen2 Seam Fix + Seam Merger) exists for.
  • Color drift between tiles. Turn on histogram_matching.
  • optimal seam mode grinding. It's a naive Python DP loop - for very large overlaps it gets slow. Drop to middle or reduce the overlap.
  • Tiles pasted in the wrong place. The merger trusts tile_layout; if the layout and the tiles came from different splits, geometry won't line up. Keep them in one workflow.

Start with none (it's the fastest and correct for masked inpaint), reach for gaussian when you need blending, and treat multi_band + optimal as the "make it pretty" combination you reach for when seams actually hurt.

CategoryGen2/Tiling

Inputs (7)

NameTypeDefaultDescription
tile_layoutGEN2_TILE_LAYOUT
blend_modeCOMBOnone4 options: none, linear, gaussian, multi_band
blend_strengthFLOAT1.000–1
seam_modeCOMBOmiddle2 options: middle, optimal
histogram_matchingBOOLEANfalse
processed_tiles_image_listoptIMAGE
masks_listoptMASK

Outputs (1)

NameTypeDescription
merged_imageIMAGE