Nodes/ComfyUI_DWposeDeluxe/DWposeDeluxe PoseResize
ComfyUI Node

DWposeDeluxe PoseResize

Resize, crop, and reposition pose data without losing quality

By hobinrude·Created 9 months ago·Updated 8 months ago· 11
DWposeDeluxe PoseResize
  • pose_keypoints
  • pose_keypoints
crop_to_posefalse
width0
height0
resize_method
left0
right0
top0
bottom0
extra_padding0
x_offset0
y_offset0
divisible_by2

Resizing a pose is nothing like resizing an image. An image you can just scale with interpolation; a pose is a set of coordinates, and if you naively stretch the numbers you get a skeleton that's out of step with its canvas. This node re-scales, crops, pads, and offsets POSE_KEYPOINT coordinates so the pose still lines up with your target frame dimensions - losslessly, since it's pure coordinate math.

The classic use case: your detected video is 1920×1080, but your generation pipeline wants 832×1216, or your ControlNet expects a specific canvas. You need the skeleton to survive that remap with its proportions intact, and this is the tool.

The inputs that matter

  • width / height - target canvas size. The useful trick: set one of them to 0 and it keeps the original aspect ratio. Set both and you control both.
  • resize_method - stretch squashes the pose to fit exactly (distorting proportions), or pad/crop preserves aspect ratio and pads or crops to the target.
  • left / right / top / bottom - per-side padding (in pixels). Negative values work as cropping, so you can trim a margin off one side.
  • extra_padding - uniform padding around all sides.
  • x_offset / y_offset - shift every keypoint left/right/up/down. This is how you re-center a pose or move it into place on a different canvas.
  • crop_to_pose - when on, tightens the canvas down to just the pose's bounding box before doing anything else. Great for cutting away wasted empty space.
  • divisible_by - rounds the output width and height up to a multiple of this (default 2). Video models often demand dimensions divisible by 8 or 16; set it to 16 and the node handles the rounding for you.

How it works

Internally the node normalizes everything to absolute pixel coordinates, applies the transform (scale, then per-side pad/crop, then offsets), and writes the new canvas dimensions back into the keypoint data. Because it converts to absolute first, the math is consistent regardless of whether your input was normalized or absolute - and the output format gets reported so you know what you're holding.

That last part is the bit to watch. The coordinate format matters for everything downstream, and this node is a common place for format mismatches to sneak in if you're mixing data from different sources. When in doubt, run a KeypointDiff against the original to confirm the resize did what you think.

When to reach for it

Beyond matching a skeleton to a generation canvas, this is the node to use when you want a "clean" pose with the character centered and the dead space cropped - better ControlNet input in practice, since the model sees the subject at the scale you actually care about. Feed it the estimator's keypoints output, adjust, and pipe into KeypointPrinter to preview.

Installing it

Part of the DWposeDeluxe pack:

cd ComfyUI/custom_nodes/
git clone https://github.com/hobinrude/ComfyUI_DWposeDeluxe
cd ComfyUI_DWposeDeluxe
pip install -r requirements.txt

or search DWposeDeluxe in ComfyUI Manager. Pure coordinate math, so no models involved. One trap: if you supply keypoint data missing canvas dimensions, this node (like the pack's other geometry nodes) will complain or misbehave - the author's own notes point at the KeypointConverter to fix datasets that lack canvas size. Keep an eye on the console for the warning.

CategoryDWposeDeluxe

Inputs (13)

NameTypeDefaultDescription
pose_keypointsPOSE_KEYPOINT
crop_to_poseBOOLEANfalse
widthINT0
heightINT0
resize_methodCOMBO2 options: stretch, pad/crop
leftINT0-8192–8192
rightINT0-8192–8192
topINT0-8192–8192
bottomINT0-8192–8192
extra_paddingINT0-8192–8192
x_offsetINT0-8192–8192
y_offsetINT0-8192–8192
divisible_byINT21–64

Outputs (1)

NameTypeDescription
pose_keypointsPOSE_KEYPOINT