0571cf60a988f71fe2dd63e5398b940fdc898fee
ComfyUI-ImgPatchEditor
A ComfyUI node for patching images using a difference detection algorithm. It detects changes between two images (original and patched), creates a mask of the differences, and merges them back together with configurable blending.
Features
- Automatic Patch Detection: Compares two images to find changed regions.
- Configurable Masking: Control region size, minimum area, threshold, and blur radius.
- Batch Support: Process multiple image pairs in a batch.
- Output: Returns both the merged image and the generated mask.
Installation
- Clone this repository into your
ComfyUI/custom_nodes/directory. - Install dependencies:
pip install -r requirements.txt
Usage
Add the Image Patch Editor node (Category: ImgPatch) to your workflow.
Inputs
- image_1: The original base image.
- image_2: The patched/modified image.
- region_size: Size of the blocks used for difference detection (default: 8).
- min_area_size: Minimum size of changed areas to keep (removes noise) (default: 4).
- threshold: Sensitivity threshold for difference detection (default: 10).
- blur_radius: Blur radius applied to the mask for smooth blending (default: 3.0).
Outputs
- IMAGE: The final merged image.
- MASK: The mask representing the patched areas.
Languages
Python
98%
Shell
2%