Skip to content

A custom node for ComfyUI that implements OpenCV's seamless cloning functionality, allowing you to blend images naturally using Poisson blending techniques.

Notifications You must be signed in to change notification settings

Aksaz/comfyui-seamless-clone

Repository files navigation

ComfyUI Seamless Clone Node

Publish to Comfy registry

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.

Features

  • 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

Installation

  1. Navigate to your ComfyUI custom nodes directory:
cd ComfyUI/custom_nodes/
  1. Clone this repository:
git clone https://github.com/Aksaz/comfyui-seamless-clone
  1. Install the required dependencies:
pip install -r requirements.txt

Usage

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

Requirements

  • numpy==2.2.0
  • opencv_python==4.10.0.84
  • torch==2.5.1

License

See the LICENSE file for details.

Credits

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.

About

A custom node for ComfyUI that implements OpenCV's seamless cloning functionality, allowing you to blend images naturally using Poisson blending techniques.

Topics

Resources

Stars

Watchers

Forks

Packages

No packages published

Languages