Nodes/Dance Everywhere/🕺 Dance Video Composite
ComfyUI Node

🕺 Dance Video Composite

Feet on the ground, dancer anywhere

By GuardSkill·Created 5 months ago·Updated 5 months ago· 0
🕺 Dance Video Composite
  • person_video
  • person_mask
  • background
  • composited_video
pos_x0.500
pos_y0.850
scale0.900
height_ratio1.00
edge_feather6
brightness_blend0.00

DanceVideoComposite is the last step of the "dance anywhere" pipeline: you've generated (or filmed) a dancing person, cut them out with a background-removal node, and now you need to stick them onto a new scene so it looks like they were always there. That's this node's entire job - and it does the one thing the naive version gets wrong: it anchors the person's feet to a spot you choose, so they sit on the floor instead of floating mid-air or sinking into it.

The pack is called Dance Everywhere, and the name is honest. No API, no model downloads, no heavy inference - it's a deterministic pixel operation, the kind the KB's post-processing essay tells you to reach for before burning another diffusion pass. OpenCV resizing, a Gaussian-blurred mask, alpha blending. Old and boring, and exactly what the job calls for.

How the foot anchoring works

This is the clever bit, and it's worth understanding because every other parameter builds on it. pos_x and pos_y are not where the center of the person goes. pos_x is their horizontal center; pos_y is where their feet land - the code computes the paste point as pos_y × background_height − target_height, i.e. the bottom of the box sits on pos_y. That's why cranking scale up doesn't make your dancer start levitating. Most naive composite nodes center the subject and you spend an hour nudging it; this one just works.

The person is scaled relative to the background's height, so a scale of 0.9 makes the dancer 90% of the background's height, keeping the original aspect ratio. height_ratio then stretches or squishes them on the vertical axis only - taller at >1, shorter at <1 - which is how you fake perspective or match a camera angle without touching width. Per-frame, the node resizes the person and mask together (Lanczos), blurs the mask by edge_feather pixels, and composites with per-pixel alpha. The whole video batch gets the same single background, and if your mask has only one frame it gets reused across all of them.

The inputs that matter

You'll actually touch three of these:

  • person_video (IMAGE) and person_mask (MASK) - your cut-out dancer and its alpha mask. Feed the mask from a background-removal node.
  • background (IMAGE) - a single image to drop them into.
  • pos_x / pos_y - foot placement, 0–1 relative coordinates. Start at 0.5 / 0.85 and nudge.
  • scale (person height as a fraction of background height) and height_ratio (vertical stretch only) for size.
  • edge_feather (int, default 6) - mask edge blur radius in pixels. Your main weapon against cutout fringe.
  • brightness_blend (0–1) - how hard to push the person's brightness toward the local background mean. 0 is off.

The single output, composited_video, is your full background-sized frame batch - wire it to your usual video-saving node (a VideoCombine-style node) to render.

The honest gotchas

Mask quality is everything. This node can feather edges, but it can't rescue a bad cutout - a u2net/rembg mask on flyaway hair will look like a cardboard cutout no matter what edge_feather you set. Feed it a strong mask from InSPyReNet or BiRefNet instead; the KB's background-removal essay calls those the ones to reach for on hard edges. The mask's resolution also matters more than you'd think - it's resized with the person, so a tiny mask blurs into mush at big scales.

brightness_blend is a global per-frame gain, not real color matching - it moves the dancer's average brightness toward the background's. A dancer shot in a bright studio dropped onto a dark alley will still look lit, just less glaringly so. If that bugs you, follow the node with a proper color-match node rather than cranking brightness_blend to 1.

If the person lands partially or fully off-canvas, you'll get a console warning (not a crash) and a frame that's just background - check pos_x/pos_y and scale before blaming the node.

Install

Via ComfyUI Manager, search Dance Everywhere. Or manually:

cd ComfyUI/custom_nodes
git clone https://github.com/GuardSkill/ComfyUI-DanceEverywhere

Then restart ComfyUI. It's a lightweight pack - the dependencies are just opencv-python, pillow, and numpy, no model files to download. If you cloned manually and the node fails to load with an ImportError for cv2, install opencv-python into your ComfyUI environment; Manager handles that for you automatically.

Category🎬 Video/Composite

Inputs (9)

NameTypeDefaultDescription
person_videoIMAGE
person_maskMASK
backgroundIMAGE
pos_xFLOAT0.5000–1落脚点横坐标(人物水平中心)
pos_yFLOAT0.8500–1落脚点纵坐标(人物脚底)
scaleFLOAT0.9000.01–2人物整体大小,相对于背景高度的比例(0.35 = 背景高的 35%)
height_ratioFLOAT1.000.2–3>1 拉高人物,<1 压矮人物(宽度保持不变)
edge_featherINT60–80mask 边缘羽化半径(像素,相对于原始人物帧)
brightness_blendFLOAT0.000–1人物亮度向背景局部亮度靠拢的程度(0=不调整,1=完全匹配)

Outputs (1)

NameTypeDescription
composited_videoIMAGE