Nodes/comfyui_bmad_nodes/SeamlessClone (simple)
ComfyUI Node Runs on cloud

SeamlessClone (simple)

The same magic, minus the placement math

By bmad4ever·Created 3 years ago·Updated 9 months ago· 70
SeamlessClone (simple)
  • dst
  • src
  • src_mask
  • IMAGE
flagNORMAL

SeamlessClone (simple) is the friendlier twin of the pack's SeamlessClone node, and the only difference is one of convenience: it figures out where to paste for you. The full version makes you supply cx and cy, the center point in the destination image, and they default to 0,0 - the top-left corner - which is how a lot of people paste their first object into the corner and think the node is broken. This variant skips that entirely: it reads your source mask, finds its bounding box, and centers the clone on that. You get the same OpenCV seamlessClone Poisson blending with one less thing to get wrong.

Inputs

  • dst - the background image.
  • src - the object to paste in.
  • src_mask - image mask marking the object's pixels.
  • flag - NORMAL (default), MIXED (blends gradients from both images), or MONO (monochrome transfer - shape and luminance only, for moving a pattern or texture onto a different-colored surface).

Output: a single composited IMAGE.

So for the common case - "take this object, blend it believably into this scene, put it wherever the mask is" - this is the node you want. The full SeamlessClone only becomes necessary when you need to control the exact placement point, which for advanced compositing is a real need, but it's not where most people start.

How it works, briefly

Under the hood it's a thin wrapper: it converts the mask to OpenCV, calls boundingRect to find the mask's box, computes the box center as the placement point, then delegates to the full SeamlessClone with those coordinates. That's the entire difference. Everything about the blending - Poisson solving at the boundary, preserving source gradients while adopting destination lighting - is identical to the parent node.

Installing

Ships in comfyui_bmad_nodes, bmad4ever's grab-bag of API, CV, and utility nodes. ComfyUI Manager - search "comfyui_bmad_nodes" (or "Bmad Nodes") - install, restart. Manual:

cd ComfyUI/custom_nodes
git clone https://github.com/bmad4ever/comfyui_bmad_nodes
cd comfyui_bmad_nodes
pip install -r requirements.txt

Restart after. No model downloads. It's a CV node, so it needs opencv-python (~4.8 in the requirements); if the console says "Not loaded: CV nodes," that's the fix.

The one thing to remember

The mask's bounding box decides the placement, so where you draw the mask shifts the paste. If the object lands off-center relative to what you drew, it's because the mask's box isn't where you think - tighten or move the mask. And since it's auto-centered, there's no way to nudge it without switching to the full node. For a first pass that's fine; for pixel-level placement, graduate to the parent. Start here, move up when you need the control.

CategoryBmad/CV/C.Photography

Inputs (4)

NameTypeDefaultDescription
dstIMAGE
srcIMAGE
src_maskIMAGE
flagCOMBONORMAL3 options: NORMAL, MIXED, MONO

Outputs (1)

NameTypeDescription
IMAGEIMAGE