Is only trouser v5.1.0
Detect a bottom-half shot and branch your pipeline
- BOOLEAN
Is only trouser is a small boolean detector with a very specific job: given a DWpose JSON, decide whether the pose was a bottom-half shot - a frame where only the legs and trousers are visible and the torso is out of frame. It checks a handful of upper-body keypoints - nose, both eyes, both ears, neck, and both shoulders - and if none of them came back with a valid coordinate (all x,y ≤ 0, the convention DWpose uses for "not detected"), it returns True. No face and no shoulders in the pose file means the camera only saw the bottom half.
Why does that matter? In a catalog try-on pipeline, you don't process a trouser-only shot the same way as a full-body or upper-body shot. Torso processing, garment-skin interaction, neck adjustments - they're all wasted effort (or actively harmful) when there's no torso in the frame. This node turns "which kind of shot am I looking at?" into a boolean you can route with a standard switch or conditional node: if is_only_trouser is True, take the leg-focused branch; otherwise run the full-body path. It's the branch condition for an automated batch of mixed-format product photos.
Inputs
pose_json_file- a string path to the DWpose JSON, defaultdwpose/keypoints. The file must use the pack's usual format withheight,width, and a 130-keypointkeypointsarray in the standard DWpose order (it reads specific indices for nose, eyes, ears, shoulders, neck).
Output
One BOOLEAN. True = upper-body keypoints all absent (bottom shot); False = at least one upper-body keypoint detected.
What it can't tell you
Read the name carefully: it's "only trouser," not "no person." The test is purely about which keypoints exist in the JSON, not about what the garment actually is. A headless, shoulderless top-only crop would also return True, because the node has no way to know what the garment is - it only knows the pose was bottom-up. If your source images are always full-person shots cropped at the waist, that's fine. Just don't ask it to classify garments; it classifies framing.
Install and gotchas
Same pack story:
cd ComfyUI/custom_nodes
git clone https://github.com/TRI3D-LC/tri3d-comfyui-nodes
# restart ComfyUI
ComfyUI Manager (search "tri3d") works too. Keep the folder named tri3d-comfyui-nodes. No model, no deps - it just reads a JSON and tests a few numbers.
- The keypoint order must match the DWpose 130-point layout this pack uses everywhere. If your pose JSON came from a different detector with a different index order, the node will happily read the wrong keypoints and lie to you.
- It reads the JSON from a file path, so the pose file has to exist on disk where the node expects it. It won't take a pose passed in via wire.
Tiny, unglamorous, and genuinely useful the moment your batch of product shots is a mix of formats. It's the "is this a leg shot?" branch in a pipeline that would otherwise process every frame identically.
Inputs (1)
| Name | Type | Default | Description |
|---|---|---|---|
| pose_json_file | STRING | dwpose/keypoints | — |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| BOOLEAN | BOOLEAN | — |