Nodes/ComfyUI-Vton-Mask/Generate ComfyUI-Vton-Mask
ComfyUI Node

Generate ComfyUI-Vton-Mask

The 500MB half of a 10GB try-on model

By karthikg-09·Created about a year ago·Updated about a year ago· 1
Generate ComfyUI-Vton-Mask
  • mask_model
  • vton_image
  • masked_image
  • mask
  • pose_image
category
offset_top0
offset_bottom0
offset_left0
offset_right0

Here's the thing nobody warns you about with virtual try-on: the heavy half of a try-on model isn't the part that puts clothes on people - it's the part that figures out where the clothes are. FitDiT, like IDM-VTON and CatVTON before it, spends its first act running pose detection and human parsing to build a garment mask and a skeleton, and only then diffuses the new outfit. This node is that first act, ripped out and repackaged so you get the mask without paying for an 8–10GB diffusion model just to see a white blob.

That's the entire pitch of ComfyUI-Vton-Mask, and it's a good one. Full FitDiT wants 8–12GB of VRAM; this pack's models are ~500MB, and the README's claim that it runs fine on CPU holds up in practice. The masking quality is identical to the full pipeline because it is the full pipeline's preprocessing - the pack lifts FitDiT's own code rather than reinventing it.

How it works

Feed it a person photo and three things come back. The node resizes your image, runs it through a DWPose detector - the same improved pose detector behind OpenPose controlnets - producing both a skeleton image and keypoint coordinates. In parallel, a human parsing model (ATR + LIP semantic segmentation, ONNX) labels every pixel with a body-part class: 4 is upper clothing, 7 is lower clothing, and so on. The two results get combined by get_mask_location(), which knows that "Upper-body" means the torso + sleeve classes, "Lower-body" means pants, and "Dresses" means roughly everything south of your neck.

The inputs that matter

  • vton_image - your person photo, straight out of LoadImage.
  • category - Upper-body, Lower-body, or Dresses. This is the one that bites people. Pick wrong and you get a mask over the torso when you wanted the trousers.
  • offset_top / bottom / left / right - nudge the mask boundaries from -200 to +200 pixels, default 0. Human parsing is rarely perfect, and these fix the classic "mask chopped the shirt collar off" cases.
  • mask_model - the custom COMFYUI_VTON_MASK_MODEL output from the pack's loader node.

You get three outputs: masked_image (your person with the garment region greyed out - the "garment-agnostic" input try-on models expect), mask (the binary white-on-black garment region), and pose_image (the skeleton for pose conditioning).

Wiring it up

The honest gotcha: this pack gives you the mask and stops. There's no generation half - that's the point, but it means the outputs are pure IMAGE tensors, and the mask comes out as an RGB image rather than a MASK. If you want classic inpainting, you'll run it through an image-to-mask conversion before it'll feed an inpaint node. The natural pairing is with a proper try-on generator (FitDiT-style nodes, or anything that wants a garment-agnostic person + pose as conditioning). If you're just assembling the pipeline, masked_image and pose_image are the two you care about; mask is there when you need to verify what got blanked.

Install and the first-run tax

Grab it via ComfyUI Manager (search "ComfyUI-Vton-Mask") or cd ComfyUI/custom_nodes && git clone https://github.com/karthikg-09/ComfyUI-Vton-Mask and restart. Requirements are the usual stack - onnxruntime, scikit-image, transformers, huggingface_hub - so Manager or a pip install -r requirements.txt handles them.

The real tax is the first run: ~500MB of ONNX weights auto-download from kg-09/kg-vton-mask into ComfyUI/models/ComfyUI-Vton-Mask/. It looks like a hang. It isn't - watch the console. If the download fails, grab the repo manually, drop it in that exact folder, and restart. And since the loader defaults to CPU, a high-res person photo takes a few seconds per frame; flip the loader's device to "cuda" and it stops being an excuse.

One opinion: this is the right way to skin the try-on cat. Most try-on models reshuffle your body shape while they're at it - the community's standing complaint about the genre. Using a clean garment-agnostic mask + pose from here and doing the generation yourself gives you control over how much of the person gets rebuilt, which is the difference between "outfit swap" and "surprise new twin."

CategoryComfyUI-Vton-Mask

Inputs (7)

NameTypeDefaultDescription
mask_modelCOMFYUI_VTON_MASK_MODEL
vton_imageIMAGE
categoryCOMBO3 options: Upper-body, Lower-body, Dresses
offset_topINT0-200–200
offset_bottomINT0-200–200
offset_leftINT0-200–200
offset_rightINT0-200–200

Outputs (3)

NameTypeDescription
masked_imageIMAGE
maskIMAGE
pose_imageIMAGE