Nodes/ComfyUI-Inpaint-CropAndStitch/(OLD πŸ’€, use the new βœ‚οΈ Inpaint Crop node)
ComfyUI Node

(OLD πŸ’€, use the new βœ‚οΈ Inpaint Crop node)

What it did and why you should switch to the new node

By lquesadaΒ·Created 2 years agoΒ·Updated 2 months agoΒ· 1,136
(OLD πŸ’€, use the new βœ‚οΈ Inpaint Crop node)
  • image
  • mask
  • optional_context_mask
  • stitch
  • cropped_image
  • cropped_mask
β—„context_expand_pixels20β–Ί
β—„context_expand_factor1.00β–Ί
β—„fill_mask_holestrueβ–Ί
β—„blur_mask_pixels16.0β–Ί
β—„invert_maskfalseβ–Ί
β—„blend_pixels16.0β–Ί
β—„rescale_algorithmbicubicβ–Ί
β—„moderanged sizeβ–Ί
β—„force_width1024β–Ί
β—„force_height1024β–Ί
β—„rescale_factor1.00β–Ί
β—„min_width512β–Ί
β—„min_height512β–Ί
β—„max_width768β–Ί
β—„max_height768β–Ί
β—„padding32β–Ί

Quick heads-up before you wire this in: InpaintCrop is the old version. In current ComfyUI it literally shows up titled "(OLD πŸ’€, use the new βœ‚οΈ Inpaint Crop node)". If you're building something fresh, use InpaintCropImproved instead - this page exists because you probably opened an older workflow that still has this node and want to know what it does and whether to worry.

Short answer: it does the same job as the new node - crop around a mask so you only inpaint the region that matters, then hand a stitch receipt to the matching old Stitch node to paste it back. It still works, so old workflows won't break. But the author replaced it in April 2025 for good reasons, and there's no benefit to starting a new graph with it.

What it did

Same core idea as the modern node. You give it an image and a mask; it fills mask holes, grows/blurs the mask, expands a context box around the masked area, crops to that, and rescales the crop so you can sample at a sensible resolution. Then you sample on the crop and feed the result plus the stitch bundle to InpaintStitch.

The reason it got retired: the old crop-then-resize order could crash when the input image was large and the masked area small; stitching could shift the result by a pixel; it extended the image 3x internally (memory-hungry); and the context box would wander outside the image even when it didn't need to. The improved node fixed all of that and folded in preresize and outpainting so you don't need separate nodes. If a doc or tutorial tells you to use this node, mentally substitute the new one.

The inputs and outputs that matter

If you're keeping an old graph running, the knobs that actually change your result:

  • mask - the region to inpaint.
  • mode (default ranged size) - forced size scales the crop to exact force_width/force_height (use this to pin 512Γ—512 or 1024Γ—1024 for your model); ranged size keeps it between min_width/height and max_width/height; free size scales by rescale_factor.
  • context_expand_pixels (default 20) / context_expand_factor (default 1) - how much surround to include for context. Note the improved node dropped the pixels version because the factor is more intuitive.
  • blend_pixels (default 16) - the feather width for a seamless paste on the Stitch side.
  • blur_mask_pixels (default 16) - grows and blurs the mask itself.

Outputs: stitch (a STITCH bundle - feed only to the matching old Stitch), plus cropped_image and cropped_mask for your sampler.

One compatibility trap: this node emits a STITCH, while the new node emits a STITCHER. They are not interchangeable - old Crop pairs with old Stitch, new with new. Don't try to mix generations.

How to install it

It's part of the same pack, so you already have it if the pack is installed. Search ComfyUI-Inpaint-CropAndStitch in ComfyUI Manager, or:

cd ComfyUI/custom_nodes
git clone https://github.com/lquesada/ComfyUI-Inpaint-CropAndStitch.git

then restart. No models or extra dependencies (GPL-3.0, by Luis Quesada Torres).

Common issues & troubleshooting

Crash on a large image with a small mask. This is the specific bug the rewrite fixed (old resize-before-crop order). The real fix is to move to InpaintCropImproved; there's no setting that reliably works around it.

Result shifted by a pixel after stitching. Also fixed in the new node. Live with it or upgrade.

"(OLD πŸ’€...)" in the node title. Not an error - it's the author flagging that this node is deprecated. Your workflow still runs; it's a nudge to update.

I can still see the original through my inpaint. Same as every node in this pack: your mask isn't fully opaque. Verify the masked pixels are true white (255,255,255 / #FFFFFF); greys your eye reads as white still leak the original.

Categoryinpaint

Inputs (19)

NameTypeDefaultDescription
imageIMAGEβ€”
maskMASKβ€”
context_expand_pixelsINT200–16384β€”
context_expand_factorFLOAT1.001–100β€”
fill_mask_holesBOOLEANtrueβ€”
blur_mask_pixelsFLOAT16.00–256β€”
invert_maskBOOLEANfalseβ€”
blend_pixelsFLOAT16.00–32β€”
rescale_algorithmCOMBObicubic7 options: nearest, bilinear, bicubic, bislerp, lanczos, box, +1
modeCOMBOranged size3 options: ranged size, forced size, free size
force_widthINT10240–16384β€”
force_heightINT10240–16384β€”
rescale_factorFLOAT1.000.01–100β€”
min_widthINT5120–16384β€”
min_heightINT5120–16384β€”
max_widthINT7680–16384β€”
max_heightINT7680–16384β€”
paddingCOMBO327 options: 8, 16, 32, 64, 128, 256, +1
optional_context_maskoptMASKβ€”

Outputs (3)

NameTypeDescription
stitchSTITCHβ€”
cropped_imageIMAGEβ€”
cropped_maskMASKβ€”