Nodes/ComfyUI_MiraSubPack/Overlapped Image Merge
ComfyUI Node

Overlapped Image Merge

Stitch tiled upscales back together without the seam lines

By mirabarukaso·Created 8 months ago·Updated 2 months ago· 0
Overlapped Image Merge
  • tiled_images
  • mira_itu_pipeline
  • IMAGE
feather_rate_override0.0

You tiled the image, sampled each tile, and now you have a bag of tiles that need to become one image again. Naive stitching - just paste them at their coordinates - leaves visible seam lines and darker stripes where the overlaps double up. Overlapped Image Merge is the "put it back together" half of the Mira tiled-upscaler loop, and it solves the seam problem with a weighted blend: every pixel gets a feather mask, tiles are accumulated onto a canvas with a weight map, and the final image is the canvas divided by the weights.

This is the step that turns a tiled upscale from "patchwork with visible grid" into "one coherent big image." Anyone who's run tiled diffusion without a merge strategy knows exactly what the failure looks like - the upscaling doc's "patchwork artifacts" warning is this exact problem.

How it works

From the source: it takes the mira_itu_pipeline descriptor (from ImageCropTiles or its pixel variant) to know the full canvas size, the tile grid, and the overlap/feather settings. Then for each tile it:

  1. Computes a geometric feather mask - soft at the edges, full weight in the middle.
  2. Adds tile × mask to a color canvas and mask to a weight map.
  3. Overlap dominance: if a tile overlaps the previous one by more than 50% in either direction, its mask weight gets boosted 10×. That's the anti-ghosting trick - it lets the newer, more-authoritative tile win the heavily-overlapped region instead of both averaging into a blurry double-exposure.
  4. Normalizes by dividing canvas by weight map.

The result is a full-res image with feathered seams and no overlap doubling.

The inputs

  • tiled_images - the sampled tiles, in the same order the tiling node produced them.
  • mira_itu_pipeline - the descriptor from the crop node. This is required, and it's why you must keep the pair together in your graph.
  • feather_rate_override (default 0) - leave at 0 to use the pipeline's feather rate. Set it to another value to override on the fly. -0.1 disables feathering entirely and directly overwrites tiles - a debug mode that will show every seam, useful to confirm the tile grid is right before you tune blending.

One output: IMAGE, the stitched full image.

Install

cd ComfyUI/custom_nodes
git clone https://github.com/mirabarukaso/ComfyUI_MiraSubPack

or search "MiraSubPack" in ComfyUI Manager and restart. No extra dependencies.

Gotchas and notes

  • Tile order and count must match the descriptor. If you crop with one tile size and merge with another descriptor, tiles land in the wrong slots. The pipeline descriptor exists precisely so this can't drift silently - but only if you don't break the link.
  • This is the pixel-space merge. The source comments note it's not great for latents due to potential color shifts - that's why the pack has a separate OverlappedLatentMerge for stitching in latent space. Decode first, merge in pixels.
  • Seams still visible after merge? The usual culprits: overlap_feather_rate too low, or - the big one - tiles that diverged in color during sampling. That's what the pack's TiledImageColorCorrection node is for: feed it the original tiles as reference and it pushes each sampled tile back toward the source palette before merging.
  • If you want to see the raw grid to debug, feather_rate_override = -0.1 is your friend - the seams it reveals are diagnostic gold.
CategoryMira/SubPack/Image Tiled Upscaler

Inputs (3)

NameTypeDefaultDescription
tiled_imagesIMAGETiled images input.
mira_itu_pipelinemira_image_tiled_upscaler_pipelineMira Image Tiled Upscale pipeline info from tiling node.
feather_rate_overrideFLOAT0.0-0.1–4Override feathering rate multiplier if value is not 0. Use -0.1 to disable feathering and directly overwrite tiles.

Outputs (1)

NameTypeDescription
IMAGEIMAGE