Nodes/Region Edit Toolkit/图像分区 · 多分块归一化合并
ComfyUI Node

图像分区 · 多分块归一化合并

Sew the edited tiles back into one image without a visible seam at every boundary

By Liu-Bot24·Created 2 months ago·Updated about a month ago· 1
图像分区 · 多分块归一化合并
  • destination
  • candidate_tiles
  • composite_masks
  • ownership_masks
  • merged_source
  • strict_union_mask
  • overlap_heatmap
  • ownership_map
  • report_json
x
y
width
height
support_cutoff0.020
edge_ramp_pixels128
edge_confidence_floor0.050

Tile-based editing has a dirty secret: the seams. Edit five overlapping tiles of a large image, paste them all back, and every tile boundary is a candidate for a visible line where two independently-regenerated patches meet. RegionEditTileMerge is the pack's answer - a merge node that stitches edited tiles back onto the destination with a strategy designed around one principle: each pixel belongs to exactly one tile, and blending only happens in a defined seam band.

The mechanism, from the source: when you feed it ownership_masks (the optional input), each tile keeps a disjoint "ownership core" - the pixels it owns outright - and crossfading happens only in the explicit seam band between cores. That means the center of every tile is used as-is (no double-blended mush), and the transition happens where it must, in the seam zone, in one pass at the end. If you don't wire ownership_masks, it falls back to a legacy normalized merge - which works, but can't give you the disjoint-core guarantee. Wire them in. That's the whole upgrade.

Required inputs: destination (the full original image), candidate_tiles (your edited tile list), composite_masks (one per tile), and the geometry lists x, y, width, height - all as lists, one entry per tile, matching the outputs of RegionEditTileBatchPrepare. The tuning dials: support_cutoff (0.02) - below this mask value a pixel stops counting as tile support; edge_ramp_pixels (128) - how wide the seam ramp is; edge_confidence_floor (0.05) - the minimum confidence for a tile to claim a pixel. Larger edge_ramp_pixels gives softer seams but more blending zone; too small and the seam gets hard.

Outputs: merged_source (the stitched result - wire this forward or to the final save), strict_union_mask (exactly which pixels changed), and the two diagnostic views that make this node worth trusting: overlap_heatmap (where tiles overlapped and how hot) and ownership_map (which tile owns which pixel, as a labeled image). If a seam looks wrong, those two outputs tell you whether it's an ownership problem or a ramp problem before you re-run anything.

Where it sits: this is the last step of the big-image multi-region path - target mask → RegionEditTilePlannerRegionEditTileBatchPrepare → edit each tile → this → final composite. For a truly large image or scattered targets (the README's stated use case), this replaces the single-crop strict composite with a tile-aware version that keeps the same strict-coordinate discipline.

Install: ComfyUI Manager → search Region Edit Toolkit (registry ID native-region-tile-planner-merge), or git clone https://github.com/Liu-Bot24/ComfyUI-Region-Edit-Toolkit.git into custom_nodes, pip-install requirements.txt into ComfyUI's actual Python, restart.

The beginner trap is list discipline: everything here is INPUT_IS_LIST, so the tile, mask, and coordinate inputs must arrive as matched lists or the merge will mismatch tiles to positions in confusing ways. Feed it the lists straight from RegionEditTileBatchPrepare - that's the pairing it was designed for. New pack, no community lore yet, but the overlap heatmap is your debugging friend: if seams persist, look at the heatmap first.

CategoryRegion Edit Toolkit/Tile

Inputs (11)

NameTypeDefaultDescription
destinationIMAGE
candidate_tilesIMAGE
composite_masksMASK
xINT
yINT
widthINT
heightINT
support_cutoffFLOAT0.0200–1
edge_ramp_pixelsINT1281–2048
edge_confidence_floorFLOAT0.0500.001–1
ownership_masksoptMASK

Outputs (5)

NameTypeDescription
merged_sourceIMAGE
strict_union_maskMASK
overlap_heatmapIMAGE
ownership_mapIMAGE
report_jsonSTRING