LayerMask: Segformer Clothes Setting
Segformer Clothes Setting
- segformer_clothes_setting
Segformer Clothes Setting is a configuration node - a checklist, really. A SegFormer clothes model can identify a whole taxonomy of human parts and garments in an image; this node is where you tick the boxes for which of those you want in your final mask. Want just the upper clothes? Check upper_clothes, leave the rest off. Want everything except the face and hair? Check all the garments, skip those two. It's the "select which labels" step that turns a full human-parsing result into the specific mask you actually need.
There are no sliders here, just booleans - one per class the model can detect, all defaulting to off:
- Body/head:
face,hair,hat,sunglass - Limbs:
left_arm,right_arm,left_leg,right_leg,left_shoe,right_shoe - Garments:
upper_clothes,skirt,pants,dress,belt,bag,scarf
Flip on whichever regions you want included, and the resulting mask is the union of those parts. The single output is segformer_clothes_setting, which you wire into the Segformer segmentation node that produces the actual mask.
This is the third piece of a three-node pattern, and it only makes sense as part of that trio: Load Segformer Model loads the brain, this node says which classes to keep, and a Segformer segmentation node runs them against your image to output the mask. On its own it's just a settings object - nothing happens until it's plugged into the segmenter.
Why it's genuinely useful: this is fine-grained, label-aware masking, which is a big step up from the coarse garment splits elsewhere. The KB notes that rembg's cloth segmentation only divides a person into upper/lower/full body - three buckets. Here you get seventeen individually-toggleable classes, including left-vs-right limbs and specific accessories. That precision is what unlocks targeted edits: recolor only the dress, swap only the pants, inpaint a new jacket over upper_clothes, remove sunglasses, or mask everything but the face for a background-and-body treatment. Anything virtual-try-on or fashion-editing shaped runs through exactly this kind of per-garment selection.
The practical advice is just to be intentional about the checkboxes. Because everything defaults to off, a fresh node produces an empty mask until you enable something - if your downstream mask is coming out blank, this is the first place to look. And separate left/right toggles are a nice touch but easy to half-set, so if you meant "both arms," remember to check both. Beyond that there's nothing to break here - it's a pure config node with no models or heavy code of its own.
Install is the pack standard. Easiest is ComfyUI Manager - search ComfyUI Layer Style (or "LayerStyle"), install, restart. Manual: cd ComfyUI/custom_nodes && git clone https://github.com/chflame163/ComfyUI_LayerStyle, then pip install -r requirements.txt from inside the folder using ComfyUI's Python, and restart. On a hosted ComfyUI it's usually preinstalled.
The pack-wide caveat: Layer Style is notorious for import failures - install it, restart, and the whole node set shows up red or missing. It's rarely the specific node; it's a dependency clash. The pack pulls a heavy stack (transformers, onnxruntime, opencv), and one mismatched version - a stray transformers or tensorflow being the usual culprit - takes the entire pack down on import. Fix it by reading the ComfyUI startup log for the traceback (it names the package that failed), reinstalling requirements against ComfyUI's own Python, and using Manager's Try Fix. If this node is missing, so is every other LayerStyle node - including the Load Segformer Model loader it pairs with - and that shared import failure is the real problem to solve.
Inputs (17)
| Name | Type | Default | Description |
|---|---|---|---|
| face | 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 | — |
| left_shoe | BOOLEAN | false | — |
| right_shoe | BOOLEAN | false | — |
| upper_clothes | BOOLEAN | false | — |
| skirt | BOOLEAN | false | — |
| pants | BOOLEAN | false | — |
| dress | BOOLEAN | false | — |
| belt | BOOLEAN | false | — |
| bag | BOOLEAN | false | — |
| scarf | BOOLEAN | false | — |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| segformer_clothes_setting | LS_SEGFORMER_SETTING | — |