ATR Parse Batch v5.1.0
Label every body part and garment on a batch
- images
- IMAGE
ATR (Adaptive Texture Recognition) is one of the classic human-parsing datasets, and its 18-class palette - background, hat, hair, sunglasses, upper/lower garment, dress, belt, shoes, bags, legs, arms - is the lingua franca of virtual try-on. tri3d-atr-parse-batch runs the ATR model over an image batch and returns the segmentation maps. It's the first step of the pack's garment pipeline: parse first, then tri3d-extract-masks-batch turns those colored maps into clean masks, and tri3d-extract-parts-batch cuts out actual garment patches.
What it does
One input - images, an IMAGE batch. It saves each frame to a temp folder inside the pack (atr_node/input), shells out to the pack's simple_extractor.py script with the --dataset atr flag, and reads back the colored segmentation PNGs as an IMAGE batch. Every pixel is labeled with one of the ATR palette colors, so a "mask" for the head is simply "all pixels that are color [192,128,0]".
The mechanics matter for two gotchas:
- It's a subprocess, not in-process inference. The node runs
python simple_extractor.pyviaos.system. Which Python? It checks aCOMFY_PYTHON_PATHenvironment variable and falls back topython. If your ComfyUI runs in an embedded venv (the Windows portable build),pythonon PATH may not be your ComfyUI Python, and the script dies with an import error. - Model download on first run. The ATR weights (
atr.pth) don't ship with the pack. The script pulls them from Google Drive viagdownon first execution intoatr_node/checkpoints/. That's a multi-hundred-MB download and it can fail on rate limits - the node will look broken until the weights are in place.
What to expect
Segmentation quality is classic 2020-era ATR: solid on clearly separated garments and body parts, mediocre on overlap, hands, and unusual poses. For clean mannequin shots it's plenty. Output is an IMAGE batch of palette-colored maps; there's no transparency or alpha - the class encoding is pure color, which is exactly what the extract nodes expect.
Wiring it up
The canonical chain: LoadImage → tri3d-atr-parse-batch → tri3d-extract-masks-batch (tick the parts you want as masks) or tri3d-extract-parts-batch (get actual crops). Because the color mapping is baked into both sides, mixing this pack's parse with another pack's segmentation colors won't match - use them as a pair.
Installing
ComfyUI Manager (search "tri3d"), or:
cd ComfyUI/custom_nodes
git clone https://github.com/TRI3D-LC/tri3d-comfyui-nodes
Then pip install -r custom_nodes/tri3d-comfyui-nodes/requirements.txt (needs gdown for the weights and python-dotenv for env handling). Restart, run once, let it download the ATR weights, and keep an eye on your console.
Troubleshooting
ModuleNotFoundErrorwhen the script runs - wrong Python. SetCOMFY_PYTHON_PATHto your ComfyUI Python (in.envor the environment) so the subprocess uses the environment that has torch and the pack's deps.- Hangs on first run - the gdown download; give it time or re-run.
- Output maps look empty/dark - check the console for errors from the subprocess; the node returns results even when the script silently failed, which makes this easy to miss.
This is the pack's heaviest node in terms of moving parts - a subprocess and a Google Drive download - but once it's warm it's a reliable, boring segmentation step.
Inputs (1)
| Name | Type | Default | Description |
|---|---|---|---|
| images | IMAGE | — |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| IMAGE | IMAGE | — |