Extract Pascal Parts Batch v5.1.0
Body-part crops from the coarse Pascal palette (torso, arms, legs, done)
- batch_images
- batch_segs
- batch_secondaries
- IMAGE
- IMAGE
The pack's main part-extraction nodes speak ATR's fine-grained 18-class vocabulary - separate classes for hats, scarves, sunglasses, belt, bags. tri3d-extract-pascal-parts-batch speaks Pascal instead: just seven classes, six body regions plus background. If your segmentation comes from a Pascal-style person-part model and you want bounding-box crops of whole body regions rather than garment minutiae, this is the matching picker.
What it does
Same shape as the ATR version: three image inputs - batch_images (what you crop from), batch_segs (the palette-colored Pascal segmentation maps), and batch_secondaries (a paired second image set that gets the identical crop). Then margin (default 15) and seven booleans:
background,head,torsoupper_arms,lower_armsupper_legs,lower_legs
The mechanism is the bounding-box crop, same as tri3d-extract-parts-batch: find the selected class's pixels by exact color match against the Pascal person-part palette, take the bounding box of all contours, pad by margin, cut that region out of both image sets. Outputs are the two cropped IMAGE batches. Note there's no "hands" class here - Pascal splits the body into coarse segments, so if you need fine garment or hand work, that's the ATR nodes.
Where it fits
Pascal body-part segmentations are coarser but often cleaner for whole-body cuts: you get a proper torso crop, or a leg crop, without the ATR palette's garment splitting. It's also the natural fit if your upstream segmentation was produced by a Pascal-person-parts model rather than the pack's ATR parse node. Same color-keying rule applies, though - the maps have to come from a Pascal palette source or the exact-match lookup finds nothing.
If you're already feeding it the pack's ATR output, you'll get empty results - the palettes don't overlap. Match the extractor to the segmenter.
Installing
ComfyUI Manager (search "tri3d"), or:
cd ComfyUI/custom_nodes
git clone https://github.com/TRI3D-LC/tri3d-comfyui-nodes
Restart, install requirements (pip install -r custom_nodes/tri3d-comfyui-nodes/requirements.txt). No model downloads.
Troubleshooting
- Everything comes back black - your
batch_segsisn't Pascal-palette. Either switch to the ATR pipeline or regenerate the segmentation with a Pascal-style segmenter. - No crop for a region you know is there - if the segmentation is close-but-not-exact on the palette color (compression shift), the exact
cv2.inRangematch misses. Keep the pipeline lossless between segmenter and this node. - Output batch has 10×10 black patches - a class absent in some frames; that's the family's "not found" placeholder, not a hang.
A targeted adapter for a specific palette. If you use Pascal person-part segmentations for cropping body regions out of a batch, it's the only node in the pack that speaks that language.
Inputs (11)
| Name | Type | Default | Description |
|---|---|---|---|
| batch_images | IMAGE | — | |
| batch_segs | IMAGE | — | |
| batch_secondaries | IMAGE | — | |
| margin | INT | 15 | — |
| background | BOOLEAN | false | — |
| head | BOOLEAN | false | — |
| torso | BOOLEAN | false | — |
| upper_arms | BOOLEAN | false | — |
| lower_arms | BOOLEAN | false | — |
| upper_legs | BOOLEAN | false | — |
| lower_legs | BOOLEAN | false | — |
Outputs (2)
| Name | Type | Description |
|---|---|---|
| IMAGE | IMAGE | — |
| IMAGE | IMAGE | — |