Segformer Clothes Label
The label picker for Segformer Clothes
- labels
Segformer Clothes Label looks like a wall of checkboxes and does exactly one thing: it decides which clothing and body-part classes the main Segformer B2 Clothes Ultra-Fast node leaves in the mask. It has no image input, no model, no settings besides the boxes - it's a list builder, and the list it builds is the labels input that tells the segmentation node what to cut out. In the words of the pack's own README: connect the matching label generator, select your model, and the mask appears.
How it works
The segformer clothes models (by default mattmdjaga/segformer_b2_clothes) classify every pixel into one of 18 classes: background, hat, hair, sunglasses, upper clothes, skirt, pants, dress, belt, left/right shoe, face+torso, left/right leg, left/right arm, bag, scarf. This node maps each checkbox to a class id and returns the ids as its labels output. It's the same idea as the fashion-detail variant in this pack, just with a coarser, body-part-level vocabulary.
Now the counterintuitive bit, which you'll hit the moment you wire it up: the boxes you check are the things that stay in the mask. The label list flows to the segmentation node as "punch these classes out of the white region," so ticking upper_clothes gives you a mask of just the shirt, and leaving everything unchecked gives you a solid black mask. That default state looks like a bug until you remember the inversion. Practically: check what you want to keep - for a full-subject cutout that's everything except everything_else (class 0, the background).
Two checkboxes deserve a note. shoe maps to two classes (9 and 10, left and right shoe) under the hood, so it's the one checkbox that stands in for two predictions. And everything_else is the background class - leave it unchecked when you want a clean subject.
The inputs and output
Every input is a BOOLEAN checkbox, defaulting to off - face_torso, hair, hat, sunglass, left_arm, right_arm, left_leg, right_leg, upper_clothes, skirt, pants, dress, belt, shoe, bag, scarf, everything_else. That's the whole control surface, and that's fine.
The single output, labels, is a wildcard * type carrying a list of class ids. Wire it into the labels input on Segformer B2 Clothes Ultra-Fast. Important: this node's 18 classes only line up with the mattmdjaga/segformer_b2_clothes and sayeed99/segformer_b3_clothes models. The fashion models (segformer-b2-fashion, segformer-b3-fashion) use the other label node in this pack - feed them this node's list and the ids won't match the predictions, so your mask comes out wrong.
Installing it
Nothing special here - this node ships inside ComfyUI-Segformer_Ultra_Fast. ComfyUI Manager → search "Segformer Ultra Fast" → Install → restart, or:
cd ComfyUI/custom_nodes
git clone https://github.com/lihaoyun6/ComfyUI-Segformer_Ultra_Fast
The pack pulls in transformers>=4.54.0, kornia, pillow, numpy and huggingface_hub on install, and the segformer weights auto-download to ComfyUI/models/segformer/ the first time the main node runs. This label node itself does zero downloading - it's pure Python list-building.
Common issues
- Black mask on first try - all boxes unchecked. Tick the classes you want to keep.
- Nonsense masks - you paired this node with a fashion model. Match the label set to the model.
- Half the subject missing - you ticked
upper_clothesbut not the arms and legs; the body-part classes are separate, so check all of them for a whole-person cutout.
One tip from real workflows: for inpainting you usually don't want a razor-tight mask, so pair this with GrowMask Ultra-Fast (same pack) and grow the result a few pixels before it hits your sampler.
Inputs (17)
| Name | Type | Default | Description |
|---|---|---|---|
| face_torso | BOOLEAN | false | — |
| hair | BOOLEAN | false | — |
| hat | BOOLEAN | false | — |
| sunglass | BOOLEAN | false | — |
| left_arm | BOOLEAN | false | — |
| right_arm | BOOLEAN | false | — |
| left_leg | BOOLEAN | false | — |
| right_leg | BOOLEAN | false | — |
| upper_clothes | BOOLEAN | false | — |
| skirt | BOOLEAN | false | — |
| pants | BOOLEAN | false | — |
| dress | BOOLEAN | false | — |
| belt | BOOLEAN | false | — |
| shoe | BOOLEAN | false | — |
| bag | BOOLEAN | false | — |
| scarf | BOOLEAN | false | — |
| everything_else | BOOLEAN | false | — |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| labels | * | — |