A custom node for ComfyUI that implements OpenCV's seamless cloning functionality, allowing you to blend images naturally using Poisson blending techniques.
Profil du package
LIREMOI
Seamless Clone Example
A custom node for ComfyUI that implements OpenCV's seamless cloning functionality, allowing you to blend images naturally using Poisson blending techniques.
Sources
3 sourcesVérifié 11 sept.
Extraits de sources
1 extraitSource context: Repo Aksaz/comfyui-seamless-clone
Seamless image blending using OpenCV's
Three blending modes:
NORMAL_CLONE: Standard seamless
MIXED_CLONE: Mixed seamless cloning that preserves gradients
MONOCHROME_TRANSFER: Monochrome transfer mode
Automatic or manual center point selection
Compatible with ComfyUI's image processing pipeline
Robust handling of mismatched image proportions - automatically resizes and validates boundaries
Fallback blending - if seamless cloning fails, falls back to simple alpha blending
cd ComfyUI/custom_nodes/
git clone https://github.com/Aksaz/comfyui-seamless-clone
pip install -r requirements.txt
The node accepts the following inputs:
source_image: The image to be cloned (foreground)
destination_image: The target image (background)
mask_image: A binary mask defining the region to be cloned
blend_mode: Choose between NORMAL_CLONE, MIXED_CLONE, or MONOCHROME_TRANSFER
center_x: X-coordinate of the clone center (optional)
center_y: Y-coordinate of the clone center (optional)
Output:
cloned_image: The resulting seamlessly blended image"Mask is empty after processing": Ensure your mask contains non-zero values in the region you want to clone.
"No valid mask pixels found": Check that your mask image has visible content in the areas you want to clone.
Seamless cloning falls back to alpha blending: This is normal behavior when the geometry is too complex for seamless cloning. The result will still be a blended image, though without the advanced Poisson blending.
Contributions are welcome! Here's how to contribute:
git checkout -b feature/amazing-feature)git commit -m 'Add amazing feature')git push origin feature/amazing-feature)Please ensure your code follows the existing style and includes appropriate documentation updates.
This project is licensed under the MIT License - see the LICENSE file for details.
This node utilizes OpenCV's seamless cloning implementation based on the paper "Seamless Image Cloning and Editing" by Patrick Pérez, Michel Gangnet, and Andrew Blake.
Nœuds dans ce pack
Nœud 1Vérifié 11 sept.