Nodes/tri3d-comfyui-nodes/Extract pose part v5.1.0
ComfyUI Node

Extract pose part v5.1.0

Cut a crop around the torso (or shoulders) so you can regenerate it in place

By TRI3D-LC·Created 3 years ago·Updated about a year ago· 27
Extract pose part v5.1.0
  • image
  • image
  • coords
pose_jsondwpose/keypoints/input.json
width_pad1.00
height_pad1.00
shouldersfalse

Extract pose part is the "cut out a region of the image so you can fix just that region" node in the TRI3D try-on pipeline. It takes an image plus a DWpose JSON (the same height / width / keypoints format the pack's dwpose node writes), rescales the keypoints from JSON space to the real image size, and crops around a body part. The one part it actually implements is the shoulders - flip shoulders on and it crops around the box spanning the left and right shoulder keypoints, then reports where it cut.

That's the whole trick, and it's genuinely useful in a two-pass workflow: crop the torso/shoulder region, run it through an inpaint or a fresh generation pass to fix the garment, then stitch it back onto the original using the coords it hands you. Doing a tight crop instead of regenerating the whole frame keeps the face, hair, and background untouched and saves VRAM at the same time. It's a spatial-variant of the region-then-restore loop the pack's other nodes (fill mask, stitch box to image) complete.

Inputs that matter

  • image - the full frame you're cropping from.
  • pose_json - file path to the DWpose JSON, default dwpose/keypoints/input.json. It's a plain string, so you can hardcode a path or pipe one in.
  • width_pad and height_pad - padding as a percentage of image dimensions, added on both sides of the crop. Default 1 (1%), max 100. This is the knob you'll actually fiddle with: too little padding and you clip the garment edges; too much and the crop is barely smaller than the original.
  • shoulders - boolean. On, you get the shoulder-region crop; off, it returns the whole frame (still with a coords string).

Outputs

Two outputs:

  • image - the cropped region, ready to feed a sampler or inpaint node.
  • coords - a string in "xmin,xmax,ymin,ymax" form. Keep hold of it; the pack's tri3d-position_pose_part node consumes it verbatim to paste the crop back in exactly where it came from.

Gotchas

  • It reads keypoints[2] and keypoints[5] for the shoulders. If the pose detector didn't see both shoulders, the coords come back None and it silently falls back to the full frame - check your pose JSON if crops look wrong.
  • The JSON must have height and width fields matching the pose detector's output resolution; if they mismatch the source image, the keypoints get stretched wrong and your crop drifts. This is the classic trap, and it's why the pack ships sample JSONs in samples/ - mimic their format.
  • No model involved, no extra install. If the pack loads, this node works.

It's a small, single-purpose helper, but if you're assembling a pose-adaption or garment-editing workflow from this pack, it's one of the load-bearing pieces - and the coords string it produces is the contract the rest of the pipeline depends on.

CategoryTRI3D

Inputs (5)

NameTypeDefaultDescription
imageIMAGE
pose_jsonSTRINGdwpose/keypoints/input.json
width_padFLOAT1.000–100
height_padFLOAT1.000–100
shouldersBOOLEANfalse

Outputs (2)

NameTypeDescription
imageIMAGE
coordsSTRING