Nodes/Eric_Composer_Studio/Poisson Blend (Seamless Clone)
ComfyUI Node

Poisson Blend (Seamless Clone)

A ComfyUI node in Eric_Composer_Studio/compose with 12 inputs and 2 outputs.

By EricRollei·Created 4 months ago·Updated 4 months ago· 3
Poisson Blend (Seamless Clone)
  • background
  • source
  • source_mask
  • image
  • used_mask
modenormal
auto_fittrue
center_x-1
center_y-1
offset_x0
offset_y0
mask_shrink_px1
post_feather_px0
strength1.00
CategoryEric_Composer_Studio/compose

Inputs (12)

NameTypeDefaultDescription
backgroundIMAGEDestination canvas. The output is the same size as this.
sourceIMAGEImage containing the object to clone in. Must be the SAME SIZE as background (crop/pad the source to background size first if needed; centre + offset_x/y are then applied to the mask only). For a different-sized source, see the auto_fit toggle below.
source_maskMASKHard mask over source: which pixels to clone in. Anything > 0.5 is IN. Soft masks are binarised — OpenCV requires a binary mask.
modeCOMBOnormalnormal (NORMAL_CLONE): standard Poisson, full colour/luminance match. Best for opaque objects. mixed (MIXED_CLONE): per-pixel stronger gradient wins. Best for transparent / wispy / textured things (foliage, smoke, hair). monochrome (MONOCHROME_TRANSFER): source contributes only luminance; hue/saturation come from the destination.
auto_fitoptBOOLEANtrueIf source is a different size than background, automatically resize source and source_mask to background size BEFORE blending. With auto_fit OFF a size mismatch is an error.
center_xoptINT-1-1–16384Destination x-coordinate where the mask centroid lands (in pixels). -1 = use the source mask's own centroid (no movement).
center_yoptINT-1-1–16384Destination y-coordinate where the mask centroid lands. -1 = auto.
offset_xoptINT0-16384–16384Additional x-shift applied AFTER center_x (lets you nudge without overriding the centroid).
offset_yoptINT0-16384–16384Additional y-shift applied AFTER center_y.
mask_shrink_pxoptINT10–64Erode mask by N pixels before cloning. Recommended >= 1 because OpenCV's seamlessClone fails / produces black borders if the mask touches the image border. Also reduces fringe artefacts at sharp matte edges.
post_feather_pxoptINT00–128After Poisson blending, re-mix the result over the original background using a feathered version of the mask (Gaussian blur). 0 disables. Use this to soften the very edge of the cloned region without breaking the gradient match (the Poisson result is already seamless; this only helps if your mask edge is jagged).
strengthoptFLOAT1.000–1Linearly blend (1-s)*background + s*poisson_result inside the mask. 1.0 = full Poisson. <1.0 lets some of the original (unmodified) source show through (only meaningful if source was already pre-pasted at the same coords as the mask).

Outputs (2)

NameTypeDescription
imageIMAGE
used_maskMASK