Resize SDPose Keypoints
Fit a detected skeleton to a new canvas without losing the pose
- pose_keypoints
- resized_pose
Pose keypoints are coordinates on a canvas, and the canvas size is baked into the JSON when detection runs. If your detection happened at 1080p but your WanAnimate generation is 832×480, or you're drawing skeletons onto a reference image of a different size, the coordinates won't line up. Resize SDPose Keypoints rescales the keypoint coordinates and updates the canvas dimensions so everything downstream agrees. It's the plumbing step you don't think about until a skeleton shows up floating off to one side of the drawing.
The core inputs are new_width and new_height (defaults 512×512, up to 8192). Then it gets slightly interesting:
- keep_aspect_ratio (default on) - scales both axes uniformly so the pose isn't stretched. With it off, coordinates are squashed to the exact target box, which distorts the figure.
- allow_crop (default off) - this is the smart bit. When you keep the aspect ratio but the target proportions don't match your canvas, the node can't just fit both. With crop enabled it computes a bounding box around the keypoints themselves, extends it by padding_top and padding_bottom (default 10px each), and center-crops around the figure - so the person stays fully in frame and centered rather than being cut off or shrunk to a sliver.
- score_threshold (default 0.1) - when cropping, keypoints below this confidence are excluded from the bounding-box calculation. Low-confidence noise (a stray hand detection) otherwise inflates the box and defeats the crop.
Output is a single resized_pose POSE_KEYPOINT. Note the padding only affects the crop fit - there's no left/right padding knob, just top and bottom; the horizontal dimension centers on the keypoint box automatically.
Where it slots in
In the pack's long-video pose workflow, this node normalizes the detected skeleton before drawing, so the visualization lines up with the reference figure's proportions. It's also the standard step after loading 360° reference-angle pose JSONs at different resolutions. If the cropped output ever looks off, the first thing to check is score_threshold - with it too high, real keypoints get excluded from the box and the crop tightens onto the torso only.
Install
Part of ComfyUI-CustomNodeKit (Manager: search "ComfyUI-CustomNodeKit"), or clone it:
cd ComfyUI/custom_nodes
git clone https://github.com/user2318/ComfyUI-CustomNodeKit.git
cd ComfyUI-CustomNodeKit
pip install -r requirements.txt
Restart ComfyUI. Pure coordinate math - no models or downloads.
Inputs (8)
| Name | Type | Default | Description |
|---|---|---|---|
| pose_keypoints | POSE_KEYPOINT | — | |
| new_width | INT | 5121–8192 | — |
| new_height | INT | 5121–8192 | — |
| keep_aspect_ratio | BOOLEAN | true | — |
| allow_crop | BOOLEAN | false | 当保持宽高比且比例不匹配时,基于关键点包围盒智能裁剪,保证不丢失关键点。When keeping aspect ratio and proportions don't match, smart-crop based on keypoint bounding box to ensure no keypoints are lost. |
| padding_top | INT | 100–200 | 【仅在允许裁剪时有效】包围盒向上扩展的像素数。Only effective when crop is enabled. Pixels to extend the bounding box upward. |
| padding_bottom | INT | 100–200 | 【仅在允许裁剪时有效】包围盒向下扩展的像素数。Only effective when crop is enabled. Pixels to extend the bounding box downward. |
| score_threshold | FLOAT | 0.100–1 | 【仅在允许裁剪时有效】参与包围盒计算的最低关键点置信度。Only effective when crop is enabled. Minimum keypoint confidence for bounding box calculation. |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| resized_pose | POSE_KEYPOINT | — |