LayerMask: Segformer Fashion Setting
Pick which clothing parts to mask
- segformer_fashion_setting
This one confuses people at first because it doesn't output a mask - it outputs a setting. It's the checklist you wire into LayerStyle's Segformer clothes-parsing node to tell it exactly which garments and accessories to include in the mask. Think of it as the control panel: 45 toggles, one per clothing category (shirt, jacket, pants, dress, shoe, hat, glasses, tie, all the way down to buttons, bows, and sequins), and it bundles your picks into a single config the segmenter consumes.
Why split it out into its own node? Because fashion segmentation covers a lot of classes, and cramming 45 booleans onto the actual parsing node would be a monster. Separating the selection lets you reuse the same setting across graphs and keeps the parser node clean. This is the standard "auto-mask the clothes" building block for virtual try-on, garment recoloring, and outfit inpainting.
How it works
The Segformer clothes model classifies every pixel of a person into fashion categories. This node doesn't run the model - it builds the filter that says "keep these categories, ignore the rest." You tick the parts you care about, and the downstream Segformer node uses that to produce a mask covering only those garments.
The inputs and outputs that matter
There are no image or mask inputs - it's all BOOLEAN toggles, 45 of them, default false. You turn on the ones you want masked. A few you'll actually reach for:
shirt,top,jacket,coat,dress,pants,skirt- the main garments.shoe,hat,glasses,bagwallet- common accessories.- The long tail (
collar,sleeve,pocket,zipper,bow,sequin, etc.) is for fine-grained selection when you need just a detail.
Leave everything you don't want at false. Output is a single segformer_fashion_setting of type LS_SEGFORMER_SETTING - a pack-internal config type - which plugs into the matching Segformer fashion parsing node. It only connects there.
How to install it
ComfyUI Manager: search ComfyUI Layer Style, install, restart. Or:
cd ComfyUI/custom_nodes
git clone https://github.com/chflame163/ComfyUI_LayerStyle
Restart afterward. Important: the Segformer parsing node that consumes this setting needs a model - the segformer clothes/fashion weights, which download automatically to the pack's models folder on first run (so the first execution stalls while it fetches). The model-dependent Segformer nodes live in the heavier half of this project; if Manager offers ComfyUI_LayerStyle_Advanced, that's where the parsing side ships, since the pack was split to keep model-dependent nodes separate from the lightweight ones.
Common issues & troubleshooting
The big pack-wide failure is IMPORT FAILED at startup, and the Segformer side is especially prone to it because it pulls in transformers and friends - a broken transformers/tensorflow combo (a very common traceback for this exact pack) will take it down. Fixes: reinstall the pack clean, and make sure you're not running a stale combined install from before the ComfyUI_LayerStyle / ComfyUI_LayerStyle_Advanced split. If only the Segformer nodes fail while the rest load, it's almost always the dependency/model side, not the base pack.
Node-specific: this setting connects only to the Segformer fashion parsing node - nothing else accepts LS_SEGFORMER_SETTING, so if it won't connect, you're aiming at the wrong node. If your mask comes back empty, you probably left every toggle at false; turn on at least the garment you want. And accuracy is the model's, not yours - Segformer clothes parsing is solid on clear full-body shots and gets shaky on occlusion, unusual poses, or busy patterns.
Inputs (46)
| Name | Type | Default | Description |
|---|---|---|---|
| shirt | BOOLEAN | false | — |
| top | BOOLEAN | false | — |
| sweater | BOOLEAN | false | — |
| cardigan | BOOLEAN | false | — |
| jacket | BOOLEAN | false | — |
| vest | BOOLEAN | false | — |
| pants | BOOLEAN | false | — |
| shorts | BOOLEAN | false | — |
| skirt | BOOLEAN | false | — |
| coat | BOOLEAN | false | — |
| dress | BOOLEAN | false | — |
| jumpsuit | BOOLEAN | false | — |
| cape | BOOLEAN | false | — |
| glasses | BOOLEAN | false | — |
| hat | BOOLEAN | false | — |
| hairaccessory | BOOLEAN | false | — |
| tie | BOOLEAN | false | — |
| glove | BOOLEAN | false | — |
| watch | BOOLEAN | false | — |
| belt | BOOLEAN | false | — |
| legwarmer | BOOLEAN | false | — |
| tights | BOOLEAN | false | — |
| sock | BOOLEAN | false | — |
| shoe | BOOLEAN | false | — |
| bagwallet | BOOLEAN | false | — |
| scarf | BOOLEAN | false | — |
| umbrella | BOOLEAN | false | — |
| hood | BOOLEAN | false | — |
| collar | BOOLEAN | false | — |
| lapel | BOOLEAN | false | — |
| epaulette | BOOLEAN | false | — |
| sleeve | BOOLEAN | false | — |
| BOOLEAN | false | — | |
| neckline | BOOLEAN | false | — |
| buckle | BOOLEAN | false | — |
| zipper | BOOLEAN | false | — |
| applique | BOOLEAN | false | — |
| bead | BOOLEAN | false | — |
| bow | BOOLEAN | false | — |
| flower | BOOLEAN | false | — |
| fringe | BOOLEAN | false | — |
| ribbon | BOOLEAN | false | — |
| rivet | BOOLEAN | false | — |
| ruffle | BOOLEAN | false | — |
| sequin | BOOLEAN | false | — |
| tassel | BOOLEAN | false | — |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| segformer_fashion_setting | LS_SEGFORMER_SETTING | — |