ComfyUI Node

SMC Composite Crop

Sew the detailed crop back in so nobody can see the seam.

By xmarre·Created 6 months ago·Updated 6 months ago· 0
SMC Composite Crop
  • base_image
  • crop_image
  • crop_mask
  • region
  • IMAGE
mask_blur_radius6

SMC Composite Crop (class SMCCompositeCrop) is the back half of the masked-crop workflow, and it's the node that decides whether your detail pass looks like magic or like a badly pasted sticker. You give it the base image, the detailed crop, the aligned crop mask, and the SMC_REGION from SMC Extract Masked Crop, and it blends the crop back in at exactly the right spot with a feathered edge.

The crop→detail→paste loop is the standard way to fix a face or region at high resolution in ComfyUI, and this node is the "paste" step. Its job is to make the transition invisible - which is genuinely hard, because a detail pass changes not just the region but its lighting, color balance, and scale relative to the frame. That mismatch is exactly the drift problem this pack exists to fix, so in practice SMCCompositeCrop usually comes after an SMC Anchor-Guided Compand or affine compand has pulled the corrected crop back toward its stable self.

Inputs

  • base_image - the original full frame.
  • crop_image - the processed crop, ready to paste.
  • crop_mask - the mask that came out of Extract Masked Crop (it must line up with the crop).
  • region - the SMC_REGION from Extract Masked Crop. This tells the node where the crop came from. Don't hand it a region from a different image - the coordinates won't mean anything.
  • mask_blur_radius (0–64, default 6) - feathers the paste alpha via average pooling. Higher = softer seam, but too high and the detailed area bleeds into the background.

Output

One IMAGE - the composited result. Wire it to a Save/Preview and call it done.

Install & gotchas

Install via ComfyUI Manager (search "Stable Manifold Compander") or:

cd ComfyUI/custom_nodes
git clone https://github.com/xmarre/ComfyUI-StableManifoldCompander

No extra dependencies. The hard limit is the same as Extract Masked Crop: batch size 1 only - it raises a ValueError on batches, so no multi-crop batching here either. Two practical notes: if you see a visible seam after compositing, raise mask_blur_radius a little, but if the color doesn't match at the seam, blur isn't the fix - the crop needs the compand correction (or a color-match pass) before it's pasted, because a soft edge can't hide a wrong color cast.

CategoryStableManifoldCompand

Inputs (5)

NameTypeDefaultDescription
base_imageIMAGE
crop_imageIMAGE
crop_maskMASK
regionSMC_REGION
mask_blur_radiusINT60–64

Outputs (1)

NameTypeDescription
IMAGEIMAGE