姿态数据重定向对齐
Align Pose Data Itself — No Rendering, No Pixel Math
- 参考姿态数据
- 源姿态数据
- 对齐后姿态数据
- 调试信息
If you're building pose-driven workflows from keypoint data instead of rendered pose images, you've probably met the same wall: you found a perfect pose for one character, but it's the wrong scale, the wrong rotation, and a mile off from the framing you want. PoseMetaRetargetAlign remaps one pose's keypoint data onto another pose's composition - without ever rasterizing it to an image. It's the data-level twin of the pack's other node, PoseRedirectAlignByHead, which does the same alignment on rendered pose images. This one works on the pose payload itself, so hands and face come along for the ride for free.
It ships in the comfyui-pose-redirect-align pack (node label "姿态数据重定向对齐", inputs in Chinese). Obscure and low-key, but genuinely useful if you're in the pose-data world.
How it works
The node takes a pose payload - a dict with a pose_metas_original list of per-person keypoint dicts, the format produced by DWPose / HumanMeta-style detector nodes - and aligns it to a reference payload. The interesting part is how it solves the transform:
- Only shared, confident points count. A keypoint must exist on both sides and have confidence above the
置信度阈值threshold or it's excluded from the solve. Missing points don't pollute the math. - The anchor strategy degrades gracefully. First it tries the torso - the shoulder-center to hip-center vector (indices 2/5 to 8/11 in the COCO/OpenPose layout) - which gives a full similarity transform: scale + rotation + translation. If either side is missing those, it falls back to the shoulder line, then to the head, then to "no valid anchor" (identity).
- Everything gets transformed together. Body, both hands, and face keypoints all get the same similarity applied, then re-normalized onto the reference canvas size. Points that exist only in the source are preserved, not deleted.
The output payload is a copy of the source with pose_metas_original replaced by the transformed data, and - helpfully - it patches the pose_metas objects too, so downstream nodes that read either field keep working.
The inputs and outputs
- 参考姿态数据 / 源姿态数据 (both
*, force-input) - two pose payload dicts from your detector. Reference defines the target composition; source is what gets moved. - 置信度阈值 (default 0.35, range 0–1.5) - the confidence cutoff for a keypoint to participate. Raise it to ignore shaky low-confidence detections; lower it to squeeze in more points.
Outputs are 对齐后姿态数据 (the transformed payload, same structure as the source - feed it into whatever consumes pose payloads downstream) and 调试信息 (a STRING that's worth its weight in debugging). Each pose gets a line reporting the mode it used (躯干 = torso, 肩线 = shoulder line, 头部 = head, 无有效锚点 = no valid anchor), how many points participated, and the solved scale, rotation in degrees, and translation. If an alignment looks wrong, read that string first - "无有效锚点" means your keypoints were too sparse or too low-confidence and nothing actually moved.
When to use this one instead of the image node
If your workflow already carries rendered pose images, use PoseRedirectAlignByHead - simpler, no payload format to satisfy. Reach for this node when your graph lives in pose-data land (pose editors, retargeting pipelines, render-on-demand setups) and you'd rather not round-trip through pixels. Bonus: because it solves a similarity transform, it also corrects rotation from the torso, which the image-based node can't do.
Installing it
Same pack, same trivial install. ComfyUI Manager → search comfyui-pose-redirect-align, or:
cd ComfyUI/custom_nodes
git clone https://github.com/playboy-dongan/comfyui-pose-redirect-align
# restart ComfyUI
Dependencies are numpy, opencv-python, and torch - already in your venv. No model files, no downloads. As with the whole pack, if you run ComfyUI remotely the node must be installed on the machine that actually renders.
Gotchas
- "姿态数据必须是字典结构" error - you fed it an image. It wants the detector's payload dict, not a tensor.
- Confidence threshold too high → few or no points qualify, the solve falls to "no valid anchor," and the debug string tells you exactly that.
- The reference and source payloads should come from the same keypoint convention (COCO-style), otherwise index 2 isn't the shoulder anymore.
Pose controlnets are one of the most reliable condition types across every architecture - but a condition map is only as good as the alignment behind it. This node is that alignment, minus the rendering round-trip.
Inputs (3)
| Name | Type | Default | Description |
|---|---|---|---|
| 参考姿态数据 | * | — | |
| 源姿态数据 | * | — | |
| 置信度阈值 | FLOAT | 0.350–1.5 | — |
Outputs (2)
| Name | Type | Description |
|---|---|---|
| 对齐后姿态数据 | * | — |
| 调试信息 | STRING | — |