Nodes/ComfyUI-QG-tools/Crop Restore
ComfyUI Node

Crop Restore

Pastes a processed crop back where Mask Crop took it from. The crop is resized back to the rectangle it was cut at, then blended over the source picture through the mask, so every pixel outside the mask stays bit-identical to the source. expand grows the mask before pasting (a few pixels hide the seam of a repaint), feather softens that edge, and colour_match shifts the patch's overall colour to match the source and remove the brightness drift an upscale-and-back leaves behind. Only the part of the rectangle inside the picture is written; a crop that hung outside the frame keeps its filled room outside.

By live1617·Created 21 days ago·Updated 2 days ago· 3
Crop Restore
  • seam
  • image
  • mask
  • background
  • image
◄expand0►
◄feather8►
◄colour_match0.00►
CategoryQG-tools/Image

Inputs (7)

NameTypeDefaultDescription
seamQGSeamThe seam output of Mask Crop.
imageIMAGEThe crop after processing. Any size; it is resized back to the rectangle.
expandINT0-256–256Grow the mask this many pixels before pasting; negative shrinks it. 4 to 16 hides a repaint seam.
featherINT80–256Soften the pasted edge over this many pixels. 0 gives a hard cut.
colour_matchFLOAT0.000–1Line the patch's median colour up with the source's. Fixes a brightness or cast drift, does not recolour a repaint.
maskoptMASKA mask for the processed crop (the crop's own mask, edited). Leave empty to reuse the painted area.
backgroundoptIMAGEPaste onto this instead of the source picture. Must be the source's size.

Outputs (1)

NameTypeDescription
imageIMAGEThe source picture with the processed crop blended back in.