Nodes/ComfyUI Layer Style/LayerMask: Segformer Fashion Setting
ComfyUI Node Runs on cloud

LayerMask: Segformer Fashion Setting

Pick which clothing parts to mask

By chflame163·Created 3 years ago·Updated 5 days ago· 3,113
LayerMask: Segformer Fashion Setting
    • segformer_fashion_setting
    â—„shirtfalseâ–º
    â—„topfalseâ–º
    â—„sweaterfalseâ–º
    â—„cardiganfalseâ–º
    â—„jacketfalseâ–º
    â—„vestfalseâ–º
    â—„pantsfalseâ–º
    â—„shortsfalseâ–º
    â—„skirtfalseâ–º
    â—„coatfalseâ–º
    â—„dressfalseâ–º
    â—„jumpsuitfalseâ–º
    â—„capefalseâ–º
    â—„glassesfalseâ–º
    â—„hatfalseâ–º
    â—„hairaccessoryfalseâ–º
    â—„tiefalseâ–º
    â—„glovefalseâ–º
    â—„watchfalseâ–º
    â—„beltfalseâ–º
    â—„legwarmerfalseâ–º
    â—„tightsfalseâ–º
    â—„sockfalseâ–º
    â—„shoefalseâ–º
    â—„bagwalletfalseâ–º
    â—„scarffalseâ–º
    â—„umbrellafalseâ–º
    â—„hoodfalseâ–º
    â—„collarfalseâ–º
    â—„lapelfalseâ–º
    â—„epaulettefalseâ–º
    â—„sleevefalseâ–º
    â—„pocketfalseâ–º
    â—„necklinefalseâ–º
    â—„bucklefalseâ–º
    â—„zipperfalseâ–º
    â—„appliquefalseâ–º
    â—„beadfalseâ–º
    â—„bowfalseâ–º
    â—„flowerfalseâ–º
    â—„fringefalseâ–º
    â—„ribbonfalseâ–º
    â—„rivetfalseâ–º
    â—„rufflefalseâ–º
    â—„sequinfalseâ–º
    â—„tasselfalseâ–º

    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.

    Category😺dzNodes/LayerMask

    Inputs (46)

    NameTypeDefaultDescription
    shirtBOOLEANfalse—
    topBOOLEANfalse—
    sweaterBOOLEANfalse—
    cardiganBOOLEANfalse—
    jacketBOOLEANfalse—
    vestBOOLEANfalse—
    pantsBOOLEANfalse—
    shortsBOOLEANfalse—
    skirtBOOLEANfalse—
    coatBOOLEANfalse—
    dressBOOLEANfalse—
    jumpsuitBOOLEANfalse—
    capeBOOLEANfalse—
    glassesBOOLEANfalse—
    hatBOOLEANfalse—
    hairaccessoryBOOLEANfalse—
    tieBOOLEANfalse—
    gloveBOOLEANfalse—
    watchBOOLEANfalse—
    beltBOOLEANfalse—
    legwarmerBOOLEANfalse—
    tightsBOOLEANfalse—
    sockBOOLEANfalse—
    shoeBOOLEANfalse—
    bagwalletBOOLEANfalse—
    scarfBOOLEANfalse—
    umbrellaBOOLEANfalse—
    hoodBOOLEANfalse—
    collarBOOLEANfalse—
    lapelBOOLEANfalse—
    epauletteBOOLEANfalse—
    sleeveBOOLEANfalse—
    pocketBOOLEANfalse—
    necklineBOOLEANfalse—
    buckleBOOLEANfalse—
    zipperBOOLEANfalse—
    appliqueBOOLEANfalse—
    beadBOOLEANfalse—
    bowBOOLEANfalse—
    flowerBOOLEANfalse—
    fringeBOOLEANfalse—
    ribbonBOOLEANfalse—
    rivetBOOLEANfalse—
    ruffleBOOLEANfalse—
    sequinBOOLEANfalse—
    tasselBOOLEANfalse—

    Outputs (1)

    NameTypeDescription
    segformer_fashion_settingLS_SEGFORMER_SETTING—