Nodes/ComfyUI-Inpaint-CropStitch-NB2/Smart Mask Multi Stitch
ComfyUI Node

Smart Mask Multi Stitch

Smart Mask Multi Stitch — four independent edits, one final image

By amortegui84·Created 5 months ago·Updated 3 months ago· 3
Smart Mask Multi Stitch
  • stitcher_1
  • edited_image_1
  • stitcher_2
  • edited_image_2
  • stitcher_3
  • edited_image_3
  • stitcher_4
  • edited_image_4
  • image
edge_feather_percent1.0
result_mask_feather_percent1.5

Run two Smart Mask Stitch calls in series and the second paste can overwrite the first - each stitch outputs the whole image, and there's no clean way to layer independent edits. Smart Mask Multi Stitch exists so you don't have to. It applies up to four independent local masked edits onto one accumulated final image, in one node.

The use case is spelled out in the README and it's very specific: separate garment passes - top and bottom, say - each generated independently (GPT Image, Seedream, whatever) but all destined for the same photograph. One selector finds the bra, another finds the pants, each gets its own crop → edit → and then instead of chaining two single stitches and hoping the second doesn't clobber the first, both feed this node and it layers them.

Inputs

  • stitcher_1 + edited_image_1 - required. The first edit's coordinate bundle and result. From there, stitcher_2/edited_image_2 through stitcher_4/edited_image_4 are all optional, so the node scales from one edit up to four.
  • edge_feather_percent (0–50, default 1) - shared feather for the crop boundaries.
  • result_mask_feather_percent (0–100, default 1.5) - shared extra blur on the stored local masks used for blending each edit back.

One output: image, the accumulated result.

Everything is applied in order (1 → 2 → 3 → 4), so if two regions overlap, the later stitch wins the overlap. For garments that don't overlap that's a non-issue; if you're layering overlapping edits, order your stitching to put the thing you care about most last.

The flow it completes

Florence "bra"   -> Smart Object Isolate Crop -> GPT Image 2 Edit \
Florence "pants" -> Smart Object Isolate Crop -> GPT Image 2 Edit  -> Smart Mask Multi Stitch -> final

Same idea works with Seedream 4.5 (07_..._seedream45_multistitch.json), SAM 3 selectors (08_sam3_garment_detail_seedream45_multistitch.json), or Florence selectors (06_..._gpt_image2_multistitch.json). Each branch is a full isolate → edit → stitcher chain; the multi-stitch just collects them.

Install

Same pack, same command:

cd ComfyUI/custom_nodes
git clone https://github.com/amortegui84/comfyui-inpaint-cropstitch-nb2

or search comfyui-inpaint-cropstitch-nb2 in ComfyUI Manager, restart. Local node, no key needed for the stitch itself - the selectors and editors upstream are the FAL-keyed parts.

One practical tip: if a single-edit test looks good but the multi-stitch version looks wrong, check that each branch's info made it through - the auto_from_region sizing on the editors depends on it, and a branch that lost its region_info wire will come back at the wrong size and show as a misaligned paste. Rebuild the branch's wiring rather than chasing the shared feather settings.

Categoryinpaint/masked

Inputs (10)

NameTypeDefaultDescription
stitcher_1STITCHER
edited_image_1IMAGE
edge_feather_percentFLOAT1.00–50
result_mask_feather_percentFLOAT1.50–100
stitcher_2optSTITCHER
edited_image_2optIMAGE
stitcher_3optSTITCHER
edited_image_3optIMAGE
stitcher_4optSTITCHER
edited_image_4optIMAGE

Outputs (1)

NameTypeDescription
imageIMAGE