Nodes/ComfyUI_DWposeDeluxe/DWposeDeluxe Merge Keypoints
ComfyUI Node

DWposeDeluxe Merge Keypoints

Put two dancers on the same canvas

By hobinrude·Created 9 months ago·Updated 8 months ago· 11
DWposeDeluxe Merge Keypoints
  • keypoints_1
  • keypoints_2
  • pose_keypoints

Sometimes the pose you want is a combination of two people: a dancer on the left from one detection run, another on the right from a different one. This node merges the people from two POSE_KEYPOINT batches into a single canvas, frame by frame, so one stick-figure image carries everyone.

The trick - and the reason this is worth a node instead of a "just add them" - is that merging people is not the same as merging frames. Frame counts must match, canvases must agree, and the coordinate formats have to be reconciled before the two datasets can live together. The node handles the last one for you.

The inputs

  • keypoints_1 - the first dataset; its coordinate format wins.
  • keypoints_2 - the second dataset, merged in.

Both must have the same number of frames - the node checks and errors (returning input 1 unchanged) if they don't. Per frame, it takes the people from keypoints_2 and appends them to the people of keypoints_1, so the output frame count stays the same but each frame holds more people.

How the format matching works

The node auto-detects whether each input is normalized or absolute, and if they disagree, it converts keypoints_2 into keypoints_1's format before merging. So you can feed it one normalized dataset and one absolute dataset and get a consistent result - a genuine convenience, since format mismatches are the pack's most common silent killer.

Canvas dimensions are handled more loosely: if the two canvases differ, it warns and keeps the first input's dimensions. That's usually what you want, but it means you're responsible for making sure both datasets depict a scene of the same size; otherwise the second person's pose can land outside the canvas or at a weird scale.

When you'd use it

The classic case is a multi-person scene shot as separate passes - detect dancer one, mask out, detect dancer two, then merge onto one canvas. Or use it to composite a pose you generated via PoseInterpolation with a static background pose. Either way, run the result through KeypointPrinter to preview before you commit it to a ControlNet.

Installing it

Part of the DWposeDeluxe pack:

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

or search DWposeDeluxe in ComfyUI Manager. No models involved. If your merged result looks off, the usual suspects are frame-count mismatch (hard error, easy to spot) and canvas mismatch (just a warning - the one to check the console for).

CategoryDWposeDeluxe

Inputs (2)

NameTypeDefaultDescription
keypoints_1POSE_KEYPOINT
keypoints_2POSE_KEYPOINT

Outputs (1)

NameTypeDescription
pose_keypointsPOSE_KEYPOINT