π§ Restore Mask Crop
Paste the fixed face back exactly where it came from
- original_image
- cropped_image
- crop_info
- cropped_mask
- IMAGE
Cropping a face out to fix it is only half the job. The other half - the one that produces seam lines and scale mismatches when done by hand - is putting the result back where it came from, at the right size, blended so nobody can tell. That's this node's entire reason to exist. It's the paste-back half of the crop-regenerate-paste pattern, the mirror of the pack's Crop Image using Mask node, and it's where the "looks clean or looks edited" difference actually gets decided.
It comes from the π§ SuperNodes pack by SuperCC.
How it works
Three inputs do the heavy lifting: original_image (the untouched source), cropped_image (your processed crop), and crop_info - the CROP_INFO metadata straight out of Image Mask Crop, which carries the crop coordinates, original size, and a stored copy of the crop-space mask. Then:
- strategy - the size-mismatch policy.
scale_croppedresizes the incoming crop to fit the original hole.scale_originaldoes the reverse: it scales the entire background image up so the new crop's scale becomes the image's scale. If you upscaled the crop 2Γ,scale_originalproduces a 2Γ larger composite - that's the mode for "I want the whole frame bigger because the face finally has real pixels." - scale_method - interpolation (nearest-exact, bilinear, area, bicubic, lanczos), matching ComfyUI's built-in image scale nodes.
- cropped_mask (optional) - if connected, overrides the stored mask for blending. Mask values are the paste alpha: 1.0 = fully the new crop, 0 = fully the original. A soft-edged mask is a feather; without one, the stored mask patch from crop time is used, which is why Image Mask Crop bothers to save it.
The blend is done as src * alpha + dest * (1 - alpha) over the intersection region, with proper clipping so a crop that hangs off the edge doesn't crash - it just blends what overlaps.
When you'd reach for it
- Face and hand detail passes: fix the crop, paste it back, keep every unmasked pixel bit-identical. This is the mask-inpainting advantage edit models can't match.
- Any "crop tight, regenerate at native res, restore" workflow where the crop got upscaled in between -
scale_originalexists precisely for that.
Install
ComfyUI Manager, search "ComfyUI-SuperNodes", or:
cd ComfyUI/custom_nodes
git clone https://github.com/sonnybox/ComfyUI-SuperNodes
Restart ComfyUI. No models to download. The pack's only extra dependency is matplotlib (for Sigmas Graph). Heads-up: this pack targets ComfyUI's newer extension API, so update ComfyUI if the nodes don't appear.
Gotchas
- Don't lose the
crop_infowire. Without it the node has no idea where the hole is, and there's no sensible fallback. scale_croppedon an upscaled crop squashes it back down to the hole size - the detail you paid for gets re-compressed. If you upscaled the crop, reach forscale_originalor feed a downscaled copy.- The stored mask patch is a hard-edged rectangle unless you supplied a feathered one. For seamless results, either feather your mask or pass a soft
cropped_mask. The node won't feather for you.
It's the least glamorous node in the pack and the one that decides whether your face-fix looks native or looks pasted. Do your blending homework here and the rest of the workflow stops mattering.
Inputs (6)
| Name | Type | Default | Description |
|---|---|---|---|
| original_image | IMAGE | The original source image before cropping. | |
| cropped_image | IMAGE | The processed cropped image to be pasted back. | |
| crop_info | CROP_INFO | The crop metadata generated by the ImageMaskCrop node. | |
| scale | COMBO | Which image to resize on a size mismatch. 'cropped' resizes the incoming crop to fit the original hole. 'original' resizes the background to match the new crop scale. | |
| scale_method | COMBO | The interpolation method used for resizing images. | |
| cropped_maskopt | MASK | An optional mask to use for blending, overriding the original crop mask. |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| IMAGE | IMAGE | The composite image with the crop restored to its original location. |