Nodes/Enigmatic Nodes/Pose Anchor & Fit (Enigmatic)
ComfyUI Node

Pose Anchor & Fit (Enigmatic)

Keep retargeted skeletons on canvas and feet on the floor

By enigmatice·Created 2 months ago·Updated 7 days ago· 1
Pose Anchor & Fit (Enigmatic)
  • pose_data
  • pose_data
canvas_margin20
max_scale1.00
anchor_xtrue
anchor_ytrue
confidence_threshold0.30
fallback_to_first_valid_frametrue

Retargeting a pose onto a new performer is a two-thirds-done job. The motion comes across, sure - but the skeleton drifts off the canvas edge, or the feet float six inches above where they should be, and every generated frame inherits the problem. Pose Anchor & Fit is a small post-processing pass that fixes exactly that: it scales the retargeted skeleton so it fits inside the canvas with a margin, then anchors the feet to the source performer's foot position, per frame. The author's own description tells you where it goes: "Insert between PoseAndFaceDetection and DrawViTPose."

It's one node in Enigmatic Nodes, a small utility pack by the individual dev enigmatice. No models, no downloads - it's pure geometry on pose data.

How it works

It reads the POSEDATA object, which carries both the retargeted skeleton (pose_metas) and the original source skeleton (pose_metas_original). For each frame it does three things:

  1. Fit. It computes the skeleton's bounding box using only keypoints above a confidence threshold, then scales it so the box fits inside the canvas minus a canvas_margin on each side - capped by max_scale. At the default max_scale of 1.0, that means shrink-only: it never enlarges a skeleton to fill the canvas.
  2. Anchor. It finds the feet (ankles and toes) of the retargeted skeleton, then shifts the whole thing so those feet land on the source performer's normalized foot position from the original data - the X from the mean of the ankles, the Y from the lowest foot. This is what keeps the character standing where the source performer stood.
  3. Fallback. If a frame's source feet aren't detected (below confidence_threshold), it reuses the first valid frame's anchor position when fallback_to_first_valid_frame is on, so you don't get a random jump in the middle of the clip.

The scale pivot is the feet, not the center - which is the right choice, because it means scaling makes the character grow or shrink toward the floor rather than floating. That's the detail that separates this from a naive "fit to canvas" node.

The inputs that matter

  • pose_data - the POSEDATA from your retargeting chain. It needs both the retargeted and original metas to do anything.
  • canvas_margin (default 20) - pixels of breathing room between the skeleton and the canvas edge.
  • max_scale (default 1.0) - the scale ceiling. 1.0 = shrink only; raise it if you want to allow enlarging small skeletons.
  • anchor_x / anchor_y (both on) - which axes to anchor to the source feet.
  • confidence_threshold (default 0.3) - keypoints below this are ignored when computing boxes and anchors.

The output

One pose_data back out, with the retargeted metas re-fit and re-anchored. Feed it to DrawViTPose and the drawn skeleton stays on canvas and on the ground.

Installing it

Same for every node in the pack:

  • ComfyUI Manager - search Enigmatic Nodes, install, restart.
  • Manual - cd ComfyUI/custom_nodes && git clone https://github.com/enigmatice/comfyui-enigmatic-nodes, then restart.

No model files. The pack declares torch, numpy, scipy, Pillow, opencv-python; ComfyUI core already ships all but opencv-python (which you almost certainly have from another pack), and Manager installs deps.

Common issues

  • Nothing happens. The most likely cause: your pose_data has no pose_metas_original because the source reference image wasn't wired into the retarget node. The code checks for this and passes the data through with a warning in the console. Also make sure the retargeted and original frame counts match - if they don't, it bails out rather than guess.
  • Skeletons come out too small. That's max_scale at 1.0 doing its shrink-only job. If the retargeted pose is smaller than the canvas, raise max_scale to let it fill.
  • Feet float anyway. If confidence_threshold is too high, the feet keypoints get discarded and there's nothing to anchor to. Lower it, or check that the source footage actually has visible feet.
  • It's not in the README. True - this node (like Match Image Batch Size) shipped in the code before the pack's README caught up. It's real and registered; the docs are just behind.

It's a young pack with zero community footprint yet, so the niche work of pose-retargeting post-processing is largely yours to figure out. But the mechanism is sound, the defaults are sane, and for a very specific failure - skeletons drifting off-canvas - it's the right medicine.

Categoryenigmatic

Inputs (7)

NameTypeDefaultDescription
pose_dataPOSEDATA
canvas_marginINT200–500Pixels of margin between the skeleton bounding box and the canvas edge.
max_scaleFLOAT1.000.1–3Upper limit on the scale factor. 1.0 = shrink-only (never enlarge). Raise to allow enlargement.
anchor_xBOOLEANtrueAnchor feet X to the source performer's feet X, per frame.
anchor_yBOOLEANtrueAnchor feet Y to the source performer's feet Y, per frame.
confidence_thresholdFLOAT0.300–1Keypoints below this confidence are ignored when computing bboxes and anchors.
fallback_to_first_valid_frameBOOLEANtrueIf a frame's source feet aren't detected, reuse the first valid frame's anchor position.

Outputs (1)

NameTypeDescription
pose_dataPOSEDATA