Nodes/ydem_nodes/YDem Pose Filter
ComfyUI Node

YDem Pose Filter

Picking One Person Out of a Crowded Pose Map

By luoq24·Created 7 months ago·Updated 2 months ago· 0
YDem Pose Filter
  • pose_keypoint
  • pose_keypoint
input_pose_orderlarge-small
input_pose_index0
force_reset_frames

Every DWPose user hits the same wall eventually. Your frame has two people in it, or four, and the pose detector happily hands back a POSE_KEYPOINT with all of them. Your ControlNet then gets everyone's skeleton at once, and the model tries to honor all of it - usually by inventing one awful merged person. YDem Pose Filter exists to cut that down to the one person you actually care about.

It's part of luoq24/ydem_nodes, a small Chinese-language pose utility pack, and it's the flagship node: a POSE_KEYPOINT in, a POSE_KEYPOINT out, with one person kept and everyone else dropped.

How it picks the person

The mechanism is pleasantly straightforward, and it borrows from ComfyUI-ReActor's approach (the dev notes cite it directly):

  1. On the first frame, every detected person gets a bounding box and the node sorts them using input_pose_order.
  2. It keeps whoever lands at input_pose_index.
  3. For every later frame, it matches that same person using bounding-box IoU (intersection over union, threshold 0.3) - so the person you picked in frame 1 is tracked through the whole clip instead of the node re-sorting and grabbing whoever happens to be largest that frame.

That last bit is the part that makes this worth having. Without tracking, a "pick the largest person" filter will silently swap characters the moment the largest person changes. Here the selection is anchored to frame 1.

The order choices are the obvious six: left-right, right-left, top-bottom, bottom-top, small-large, and large-small (the default). They're all sorted on the first frame's bounding boxes.

The inputs that matter

Only two of the four matter for most people:

  • pose_keypoint - feed this from a DWPose Estimator or similar node in comfyui_controlnet_aux. That's the source of the POSE_KEYPOINT type.
  • input_pose_order + input_pose_index - the sort strategy and the person to keep. Remember index is 0-based: 0 is the first person in whatever order you chose. Pick the order that matches your target, or you'll get someone else and it'll look like the node is broken.

The last input, force_reset_frames, is the power-user knob. It's a string like 5_left_0;12_empty - per-frame overrides of the form frame_strategy_shortname_index, semicolon-separated, with 1-based frame numbers. The empty strategy clears the pose on that frame entirely, which is handy when your target person is fully occluded and you'd rather ControlNet get nothing than a wrong skeleton. Frame numbers here start at 1, in case you were about to mix it up with the 0-based index.

The single output, pose_keypoint, wires straight into an openpose/DWPose ControlNet model plus Apply ControlNet, or into the pack's own YDem Pose Renderer so you can eyeball what survived.

Installing it

ComfyUI Manager - search "ydem_nodes". Or clone:

cd ComfyUI/custom_nodes
git clone https://github.com/luoq24/ydem_nodes

Then restart. The hard dependency is comfyui_controlnet_aux - not just for the POSE_KEYPOINT type but because the whole pack leans on it. It should already be installed if you use DWPose, but if you don't, get it first. There are no model files in this pack and no requirements.txt; the pose logic is pure Python.

Where people get burned

The most common failure is silent. If input_pose_index is larger than the number of people detected, the node quietly clamps it back to 0 - so a mistyped index hands you the wrong person with no error. Double-check your index against a render.

The other gotcha is tracking breaks: if the target person's IoU with every candidate drops below 0.3 (people overlapping, or the target walking out of frame), that frame's pose is dropped entirely. You'll see it as a skeleton that flickers out mid-clip, and ControlNet just gets no condition that frame. It won't crash - you'll just wonder why the pose briefly vanishes. When a tracking hiccup matters, that's what force_reset_frames is for.

One honest caveat: the README is in Chinese, the pack is young, and you're likely one of the first English-speakers to google this. The good news is the node does one thing and does it with readable code - the sort orders are right there in the dropdown.

Categoryydem_nodes/pose

Inputs (4)

NameTypeDefaultDescription
pose_keypointPOSE_KEYPOINT
input_pose_orderCOMBOlarge-small6 options: left-right, right-left, top-bottom, bottom-top, small-large, large-small
input_pose_indexINT00–100
force_reset_framesSTRING

Outputs (1)

NameTypeDescription
pose_keypointPOSE_KEYPOINT