Nodes/ComfyUI-gen2/Gen2 Seam Merger
ComfyUI Node

Gen2 Seam Merger

Compositing regenerated seam strips without new artifacts

By petmycat·Created 7 months ago·Updated 12 days ago· 23
Gen2 Seam Merger
  • merged_image
  • seam_layout
  • processed_seam_tiles_list
  • seam_tiles_masks_list
  • final_image
blend_modegaussian
blend_strength0.50
histogram_matchingfalse

The second half of the two-pass seam-fix workflow. Gen2 Seam Fix carved out the seam strips and you regenerated them; this node composites those regenerated seam tiles back onto the first-pass merged image. Where the first-pass Tile Merger has to blend two independently-sampled images that disagree, this one is doing a much safer job: each seam tile's non-strip region equals the canvas content already, so there's nothing to reconcile - you're pasting strips that line up with what's there. That's why its blend modes are simpler and why multi_band is actually safe here (no low-frequency disagreement to ring on).

Inputs

Required:

  • merged_image - the first-pass merged result you're fixing.
  • seam_layout - the GEN2_SEAM_LAYOUT from Gen2 Seam Fix.
  • blend_mode - linear, gaussian (default), or multi_band.
  • blend_strength - 0–1, default 0.5. For multi_band this controls pyramid depth (0 → 1 level, 1 → 6 levels).
  • histogram_matching - boolean, default off.

Optional:

  • processed_seam_tiles_list - your regenerated seam tiles (IMAGE).
  • seam_tiles_masks_list - the strip masks (MASK), from Seam Fix.

Output: final_image.

What each mode does

  • linear / gaussian - a straight alpha composite: final = merged·(1−mask) + seam·mask. On non-overlapping seam tiles both modes are mathematically identical, so the two names exist mainly for symmetry with the Tile Merger. gaussian is the default and a fine one.
  • multi_band - Laplacian-pyramid blend per seam tile against the canvas. Safe here, as noted, because the seam tile's non-strip region equals the canvas content - so the pyramid only smooths the strip boundary itself. blend_strength controls how many pyramid levels it builds.

histogram_matching does a Reinhard mean/std color transfer of each seam tile's strip region to match the surrounding (non-strip) merged content. Turn it on when your regenerated strips come back with a color cast that doesn't match the existing canvas - a real failure mode when strips are sampled separately from the tiles around them.

Wiring the full pipeline

Pass 1 (normal tiling): Splitter → Tile Masks → sampler → Tile Merger → merged_image. Pass 2: feed original_image + merged_image + tile_layout into Seam Fix, sample the seam_tiles, then Seam Merger with merged_image + seam_layout + the processed tiles and masks → final_image. Same mesh topology as the README's diagram, and it's the pattern to run when the first pass leaves ghosting at the seam lines.

Installation

Via ComfyUI Manager (search "ComfyUI-gen2"), or:

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

Requires scipy (in requirements.txt) like the rest of the tiling section. Restart after installing.

Common issues

  • Seam tiles not blending, hard edges. If you didn't wire in the seam_tiles_masks_list, the merger has no masks to feather with - it expects them from Seam Fix.
  • multi_band looks worse than linear. If your strips genuinely disagree with the canvas (e.g. you ran a high denoise and the strip wandered), the pyramid can't fix disagreement - that's the job of histogram_matching and a lower denoise, not the blend mode.
  • Color cast on the strips. histogram_matching = True is the targeted fix.

Keep it simple: gaussian by default, add histogram matching when strips drift in color, and only reach for multi_band when a subtle seam texture persists after the first two. The whole two-pass system is the difference between tiled output you accept and tiled output you'd show someone.

CategoryGen2/Tiling

Inputs (7)

NameTypeDefaultDescription
merged_imageIMAGE
seam_layoutGEN2_SEAM_LAYOUT
blend_modeCOMBOgaussian3 options: linear, gaussian, multi_band
blend_strengthFLOAT0.500–1
histogram_matchingBOOLEANfalse
processed_seam_tiles_listoptIMAGE
seam_tiles_masks_listoptMASK

Outputs (1)

NameTypeDescription
final_imageIMAGE