Nodes/ComfyUI-ImgPatchEditor/Image Patch Editor
ComfyUI Node

Image Patch Editor

A ComfyUI node in ImgPatch with 11 inputs and 5 outputs.

By Premik·Created 5 months ago·Updated 5 months ago· 0
Image Patch Editor
  • original_image
  • edited_image
  • merged_image
  • final_mask
  • heatmap
  • raw_mask
  • debug_overlay
detection_alg
region_size8
stride1
min_area_size4
tolerance0.50
blur_radius3.0
mask_expansion0
edit_max_alpha1.00
allow_rescaletrue
CategoryImgPatch

Inputs (11)

NameTypeDefaultDescription
original_imageIMAGE
edited_imageIMAGE
detection_algCOMBO3 options: difference, l2_norm, ssim
region_sizeINT81–128Size of the blocks used for difference detection.
strideINT11–64Step size for the sliding window. 1 means full overlap (slowest, most accurate), equal to region_size means no overlap (fastest).
min_area_sizeINT40–128Minimum size of the changed area to keep.
toleranceFLOAT0.500–5Sensitivity of difference detection. Higher values will detect more changes.
blur_radiusFLOAT3.00–100Radius of the gaussian blur applied to the mask.
mask_expansionINT0-128–128Expand or shrink the mask. Positive values expand, negative values shrink.
edit_max_alphaFLOAT1.000–1Maximum alpha for the edited image overlay.
allow_rescaleBOOLEANtrueIf true, rescales the edited image to match original size.

Outputs (5)

NameTypeDescription
merged_imageIMAGEThe original image with the patched areas from the edited image.
final_maskMASKThe final mask used for merging. White indicates changes (taken from edited image), black indicates unchanged areas.
heatmapIMAGEVisualization of differences. Brighter areas indicate larger differences between original and edited images.
raw_maskMASKInitial binary mask before post-processing. White indicates detected changes, black indicates no change.
debug_overlayIMAGEOriginal image with a red overlay highlighting the detected changes.