Nodes/NH-Nodes/VTON Ultimate Processor (NH)
ComfyUI Node

VTON Ultimate Processor (NH)

The preprocessing half of virtual try-on, all in one node

By jetthuangai·Created 5 months ago·Updated 21 days ago· 6
VTON Ultimate Processor (NH)
  • human_image
  • final_mask
  • agnostic_mask
  • densepose_image
  • parsing_image
  • masked_image
  • parsing_map_raw
  • hair_mask
  • hands_mask
category
mask_feathering4
cover_shoesfalse
refine_handstrue
refine_hairtrue
device
offset_top0
offset_bottom0
offset_left0
offset_right0

Virtual try-on is a pipeline, not a button. A generator like IDM-VTON, CatVTON, or OOTDiffusion doesn't take a person and a garment and magically combine them - it needs a stack of prepared inputs: a clean garment mask, a human parsing map, DensePose, an "agnostic" image with the garment region blanked out. Getting that stack together by hand is where most people's try-on dreams die.

VTON Ultimate Processor (NH) exists to collapse that whole preprocessing phase into one node. Feed it a photo of a person, and it hands you eight outputs: the garment mask, the agnostic mask, a DensePose image, a colored parsing image, a masked image, raw parsing class data, and separate hair and hands masks. It's the prep work for a try-on generator in a single drop, and it's the heavy hitter of the NH-Nodes pack.

How it works

Under the hood it's an ONNX pipeline - no PyTorch model to babysit. On first use it downloads a bundle of weights (kg-09/kg-vton-mask) into ComfyUI/models/ComfyUI-Vton-Mask via huggingface_hub, then runs:

  • DWPose for pose and DensePose (a YOLOX detector plus the dw-ll pose ONNX model).
  • Human parsing (ATR and LIP ONNX models) that labels every pixel with a body-part class - that's what the colored parsing image and the raw class map come from.

From there it builds the garment mask for the category you picked, applies a bunch of thoughtful refinements, and assembles the outputs. The LIP palette coloring of the parsing image is a nice touch - you can literally see whether it understood "upper body" vs "dress" before you commit to a generator.

The inputs that matter

  • human_image - your photo. One person, clear of clutter, ideally.
  • category - the big one: Upper-body, Lower-body, Dresses, Upper-body (Sleeveless), Lower-body (Shorts/Skirt). Pick the one matching the garment you're trying on. This drives everything downstream.
  • mask_feathering - blur radius on the mask edges (0–50, default 4). Low values keep the mask crisp; higher values soften seams.
  • cover_shoes - fill the leg mask down past the ankle when doing lower-body, so the try-on generator doesn't inherit shoes.
  • refine_hands / refine_hair - on by default; they subtract arms and hair from the garment mask so your t-shirt mask doesn't eat the model's hands or hair.
  • device - cpu or cuda. GPU is far faster; CPU works but expect a wait.
  • offset_top/bottom/left/right - nudge the mask edges by pixels when the auto-detection is slightly off.

The outputs to wire into your VTON generator are final_mask (the garment mask) and agnostic_mask (the person minus the garment, the "blank shirt" layer). densepose_image and parsing_image go to the generators that want DensePose or human parsing. hair_mask and hands_mask are handy for a separate inpainting pass or for refining details.

Real-world expectations

First run downloads the model bundle - it's a few hundred MB and needs network access, so don't panic if the first queue hangs on a download. The category choice genuinely changes the mask: use Upper-body (Sleeveless) for tanks and it subtracts the arms; Lower-body (Shorts/Skirt) cuts the mask at the knee so a skirt doesn't become pants. When the mask is slightly wrong, the offsets are the gentle fix; feathering is the cosmetic fix.

Community chatter on try-on in ComfyUI is heavy on the generators themselves - IDM-VTON's 16GB VRAM appetite is a recurring complaint, CatVTON on FLUX is the current favorite - but every one of those threads is someone fighting the same preprocessing problem this node automates. It won't do the actual garment swap; that's the generator's job. It's the part everyone forgets to budget time for, and it's the part this node removes.

One honest note: this is the only node in NH-Nodes with real downloads and real compute. If you're not doing try-on, skip it - the pack's Garment Segment / Portrait Segment nodes cover simpler mask needs with a lighter footprint. If you are doing try-on, this is the node you'd keep.

Install

ComfyUI Manager → search NH-Nodes → install → restart, or:

cd ComfyUI/custom_nodes
git clone https://github.com/jetthuangai/NH-Nodes.git
cd NH-Nodes
pip install -r requirements.txt

The pack's requirements already include onnxruntime (needed for the ONNX inference) and huggingface_hub (for the model download), so a standard install covers it. Restart ComfyUI, then expect the one-time model download on first use.

CategoryNH-Nodes/VTON

Inputs (11)

NameTypeDefaultDescription
human_imageIMAGE
categoryCOMBO5 options: Upper-body, Lower-body, Dresses, Upper-body (Sleeveless), Lower-body (Shorts/Skirt)
mask_featheringINT40–50
cover_shoesBOOLEANfalse
refine_handsBOOLEANtrue
refine_hairBOOLEANtrue
deviceCOMBO2 options: cpu, cuda
offset_topoptINT0-200–200
offset_bottomoptINT0-200–200
offset_leftoptINT0-200–200
offset_rightoptINT0-200–200

Outputs (8)

NameTypeDescription
final_maskMASK
agnostic_maskMASK
densepose_imageIMAGE
parsing_imageIMAGE
masked_imageIMAGE
parsing_map_rawMASK
hair_maskMASK
hands_maskMASK