Nodes/ComfyUI-MultiPoseToolkit/MultiPose ▸ Coordinate Sampler
ComfyUI Node

MultiPose ▸ Coordinate Sampler

The SAM2 point generator hiding in a pose pack

By starsFriday·Created 9 months ago·Updated 21 days ago· 3
MultiPose ▸ Coordinate Sampler
  • model
  • images
  • positive_coords
  • negative_coords
  • bbox
positive_points3
negative_points5
person_index-1
seed0
detect_multi_personstrue
positive_modepose
pose_conf_threshold0.30
pose_jitter5.0

A pose pack whose third node doesn't output poses at all - it outputs point coordinates. MultiPose ▸ Coordinate Sampler reuses the same YOLO + ViTPose detection stack as the rest of the pack, but instead of rendering skeletons it spits out JSON lists of "positive" points (on the person) and "negative" points (off the person), plus bounding boxes. If you've seen the bundled example workflow, you know the target: it feeds SAM2-style point prompting so you can carve every person in a video out as its own mask. For multi-person footage, doing that by hand frame-by-frame is misery; this is the automation.

How it works

Per frame, YOLO finds every person (respecting the detect_multi_persons toggle). Then it samples:

  • Positive points - by default (positive_mode = "pose") it runs ViTPose to grab confident joints, filters them by pose_conf_threshold, interpolates between them, and enforces a minimum spacing so points stay on-body and evenly spread. Set positive_mode = "bbox" and it skips ViTPose entirely, scattering points on a jittered grid inside the box - faster, cruder.
  • Negative points - sampled outside every detected bbox, so SAM2 knows what's background.

Everything is seeded, so the same inputs plus the same seed produce the same coordinates every run. That's the feature you want when you're iterating on prompts and don't want your masks dancing around between runs.

Inputs and outputs

The three inputs that matter for a beginner:

  • positive_points (default 3) and negative_points (default 5) - how many of each. SAM2 works fine with a few; more is rarely better.
  • person_index - -1 (default) emits entries for every detected person per frame; a specific index pins you to one bbox.
  • seed - deterministic replay, as above.

The rest (pose_conf_threshold, pose_jitter, positive_mode, detect_multi_persons) tune the sampling; the defaults are sane.

Outputs:

  • positive_coords / negative_coords (STRING) - JSON point lists. With person_index = -1 they flatten to [{"x":..,"y":..,"person_index":p,"image_index":i}, ...] so downstream nodes expecting a plain point list still work; a single person gets a bare [{"x":..,"y":..}, ...].
  • bbox (BBOX) - per-frame (x0, y0, x1, y1) tuples, ordered to match the person_index values.

Where it fits

The pack's example workflow is the tell: VHS loads a video, this node samples points, a CoordinatePlotter shows them, and the positive/negative JSON plus bbox go into SAM2Segmentation to pull per-person masks. If you're building anything that needs "which pixels are the person, every frame," this is the point generator. It's also handy if you want textual/JSON annotations of where everyone is rather than rendered canvases.

Gotchas

With person_index = -1, the negative points are the same set duplicated per person (so each person's entry aligns). That's by design, not a bug. If you pick positive_mode = "pose" but your POSEMODEL handle lacks the ViTPose runtime, it raises rather than silently downgrading - load both models in MultiPose ▸ ONNX Loader first. And like the rest of this brand-new pack, expect the YOLO detection pass to be the slow part on CPU; run the loader on CUDA if you have it.

CategoryWanMultiPose

Inputs (10)

NameTypeDefaultDescription
modelPOSEMODEL
imagesIMAGE
positive_pointsINT31–50
negative_pointsINT51–100
person_indexINT-1-1–32
seedINT00–2147483647
detect_multi_personsBOOLEANtrue
positive_modeCOMBOpose2 options: pose, bbox
pose_conf_thresholdFLOAT0.300–1
pose_jitterFLOAT5.00–50

Outputs (3)

NameTypeDescription
positive_coordsSTRING
negative_coordsSTRING
bboxBBOX