Nodes/ComfyUI-Sapiens2-Easy/Sapiens2 Pose Advanced
ComfyUI Node

Sapiens2 Pose Advanced

Sapiens2's Advanced Pose Node

By Bogyie·Created 4 months ago·Updated 4 months ago· 29
Sapiens2 Pose Advanced
  • model
  • image
  • bboxes
  • pose_image
  • preview
  • keypoint_mask
  • openpose_json
  • result
targetBODY_25
keypoint_threshold0.30
bbox_threshold0.30
nms_threshold0.30
radius4
thickness2
fallback_full_image_bboxtrue
flip_testtrue
show_pointstrue
show_skeletontrue

If you've ever stared at a pose-estimation workflow and asked "okay, but what do I do with this," you're not alone - it's the recurring question under every Sapiens2 launch thread. The answer, in one line: a pose skeleton is the cheapest, most reliable way to tell a diffusion model where the person is and how they're standing. Feed a pose image into an OpenPose ControlNet and you can re-render a character in any style while keeping the exact stance; hand the JSON to animation or mocap tooling and you've got a motion reference that's already extracted for you.

Sapiens2 Pose Advanced is where this pack's pose work happens with the training wheels off. It runs Meta's Sapiens2 pose model - 308 keypoints - through a person detector and renders the result into whatever format your downstream tool actually wants.

How it works

First a person detector finds bounding boxes (it prefers a local rtmdet_m.pth if you have one under ComfyUI/models/sapiens2/detector/, otherwise falls back to a Hugging Face DETR model). Then the Sapiens2 keypoint model predicts 308 keypoints per person. Three thresholds filter the mess: bbox_threshold and nms_threshold decide which detected people survive, keypoint_threshold decides which keypoints are confident enough to keep. flip_test (on by default) runs a mirrored inference pass and averages the two, which is a genuinely worthwhile accuracy boost for poses seen from the side. Finally the node converts the 308-keypoint raw output into the target you picked and renders the OpenPose-style stick figure.

The inputs that matter

  • target - the format. BODY_25 (OpenPose's 25-keypoint body), DWPose (the detector flavor ControlNet people actually prefer, and it fills in hands and face too), 308-keypoint (Sapiens2's native superset), COCO_18, plus OpenPose hand 21 + 21 and OpenPose face 70. Pick the one your downstream node speaks; BODY_25 is the safe default.
  • keypoint_threshold - raise it to 0.4–0.5 if you're getting jittery keypoints on low-res images.
  • fallback_full_image_bbox - if the detector finds nobody, treat the whole frame as one person instead of returning nothing. Leave it on for a single subject.
  • radius / thickness - how big the rendered dots and bones are. Cosmetic, but they're the first thing you tweak when the skeleton looks lost in a big frame.

Optional bboxes input lets you feed back detection from a previous run instead of re-running the person detector - a real speedup when iterating on a batch.

The outputs

  • pose_image - the black-background stick figure. This is the one you feed into OpenPose ControlNet.
  • preview - the same skeleton overlaid on the source.
  • keypoint_mask - a mask of the detected joints, if you want to combine pose with masking logic.
  • openpose_json - a string of JSON in the target's layout (for DWPose that means pose_keypoints_2d plus hand/face arrays; Sapiens2's raw keypoints are kept as sapiens_keypoints_2d). Wire it to a save node and you have pose data on disk for animation reference.
  • result - a SAPIENS2_POSE_RESULT with the raw keypoint tensors and boxes.

Installing it

It's part of Bogyie/ComfyUI-Sapiens2-Easy, so:

cd ComfyUI/custom_nodes
git clone https://github.com/Bogyie/ComfyUI-Sapiens2-Easy.git
cd ComfyUI-Sapiens2-Easy
python install.py

Restart ComfyUI (or install via Manager). Feed it a Sapiens2 Model Loader set to task = pose; the loader auto-downloads the pose weights on first run. One honest gotcha: the preferred RTMDet detector needs mmdet/mmengine/mmcv, which this pack deliberately does not auto-install because those packages can interfere with your torch/CUDA stack. You don't need them - the DETR fallback works out of the box - but if you want the faster detector, install the mm packages yourself only after checking they match your environment.

CategorySapiens2/Advanced

Inputs (13)

NameTypeDefaultDescription
modelSAPIENS2_MODEL
imageIMAGE
targetCOMBOBODY_256 options: BODY_25, DWPose, 308-keypoint, COCO_18, OpenPose hand 21 + 21, OpenPose face 70
keypoint_thresholdFLOAT0.300–1
bbox_thresholdFLOAT0.300–1
nms_thresholdFLOAT0.300–1
radiusINT41–64
thicknessINT21–64
fallback_full_image_bboxBOOLEANtrue
flip_testBOOLEANtrue
show_pointsBOOLEANtrue
show_skeletonBOOLEANtrue
bboxesoptSAPIENS2_BBOXES

Outputs (5)

NameTypeDescription
pose_imageIMAGE
previewIMAGE
keypoint_maskMASK
openpose_jsonSTRING
resultSAPIENS2_POSE_RESULT