Nodes/ComfyUI-Segformer_Ultra_Fast/Segformer Fashion Label
ComfyUI Node

Segformer Fashion Label

Fine-grained garment masks, one at a time

By lihaoyun6·Created 11 months ago·Updated 11 months ago· 39
Segformer Fashion Label
    • labels
    shirt_blousefalse
    top_tShirt_sweatshirtfalse
    sweaterfalse
    cardiganfalse
    jacketfalse
    vestfalse
    pantsfalse
    shortsfalse
    skirtfalse
    coatfalse
    dressfalse
    jumpsuitfalse
    capefalse
    glassesfalse
    hatfalse
    headband_hairAccessoryfalse
    tiefalse
    glovefalse
    watchfalse
    beltfalse
    leg_warmerfalse
    tights_stockingsfalse
    sockfalse
    shoefalse
    bag_walletfalse
    scarffalse
    umbrellafalse
    hoodfalse
    collarfalse
    lapelfalse
    epaulettefalse
    sleevefalse
    pocketfalse
    necklinefalse
    bucklefalse
    zipperfalse
    appliquefalse
    beadfalse
    bowfalse
    flowerfalse
    fringefalse
    ribbonfalse
    rivetfalse
    rufflefalse
    sequinfalse
    tasselfalse
    everything_elsefalse

    The plain Segformer Clothes Label in this pack gives you body-part-level masks: shirt, pants, arms, legs. This one is the fine-grained sibling. Segformer Fashion Label exposes 47 classes of garment details - sleeve, pocket, neckline, collar, lapel, zipper, sequin, ruffle, tassel, bow, bead, and a couple dozen more - so you can ask for a mask of just the collar, or just the sleeves, instead of "everything on the upper body." If you've ever wanted to recolor a zipper or change only the cuffs, this is the checkbox list you've been missing.

    How it works

    Same mechanism as the other label node: each checkbox maps to a class id (0–46) and the node returns the selected ids as a labels list for the main segmentation node. The class vocabulary matches the fashion models in the model dropdown - sayeed99/segformer-b2-fashion and sayeed99/segformer-b3-fashion - which are trained on fashion-pedia-style annotations where every jacket is decomposed into sleeve, pocket, collar, and so on.

    And yes, the same inversion rule applies, so get this straight before you fight it: ticked boxes stay in the mask. The labels list tells the segmentation node which classes to punch out, so checking sleeve leaves just the sleeves white and everything else cut away. Leave all 47 boxes off and you get an empty black mask - not a crash, just the logical result of "keep nothing." Default everything to off, tick exactly the detail you want, and don't expect the model to nail all of them at once.

    The inputs and output

    All inputs are BOOLEAN checkboxes, every one defaulting to off. You won't set all 47 - nobody does. The ones that actually earn their keep:

    • everything_else (class 0, the background) - leave it off for subject isolation.
    • sleeve, pocket, collar, neckline - the structural details that matter for clothing edits.
    • shirt_blouse, top_tShirt_sweatshirt, jacket, dress, pants - the headline garment classes, if you want the whole garment rather than a detail.
    • zipper, sequin, tassel, bow - fun, but thin, tiny regions; treat these results skeptically.

    The single output, labels (wildcard * type), goes into the labels input on Segformer B2 Clothes Ultra-Fast. It only makes sense with the two fashion models - pair it with the plain b2/b3 clothes models and the class ids won't match the predictions, giving you masks that are wrong in ways that are hard to debug.

    Installing it

    It's part of ComfyUI-Segformer_Ultra_Fast, so no separate install:

    cd ComfyUI/custom_nodes
    git clone https://github.com/lihaoyun6/ComfyUI-Segformer_Ultra_Fast
    

    or ComfyUI Manager → search "Segformer Ultra Fast" → Install → restart. The pack's dependencies (transformers>=4.54.0, kornia, pillow, numpy, huggingface_hub) install with it, and the fashion model weights auto-download to ComfyUI/models/segformer/ on first run of the main node. This node itself downloads nothing - it's a pure list builder.

    Common issues

    • Empty mask - no boxes ticked. The default state keeps nothing.
    • Mask looks unrelated to what you checked - you paired it with a non-fashion model. Match model to segformer-b2-fashion or -b3-fashion.
    • Details don't resolve - small classes like zipper and sequin are where a tiny segmentation backbone struggles; if a detail won't separate, fall back to the whole-garment class and refine by hand.

    Honest take: 47 classes sounds like a precision tool, and mostly it is - but a B2 backbone has finite patience for distinguishing a pocket from a lapel. It's brilliant for picking up whole garments and bold details, and mediocre at the fiddly ones. That's the nature of the model, not a defect in the node.

    CategorySegformer Ultra-Fast/Label

    Inputs (47)

    NameTypeDefaultDescription
    shirt_blouseBOOLEANfalse
    top_tShirt_sweatshirtBOOLEANfalse
    sweaterBOOLEANfalse
    cardiganBOOLEANfalse
    jacketBOOLEANfalse
    vestBOOLEANfalse
    pantsBOOLEANfalse
    shortsBOOLEANfalse
    skirtBOOLEANfalse
    coatBOOLEANfalse
    dressBOOLEANfalse
    jumpsuitBOOLEANfalse
    capeBOOLEANfalse
    glassesBOOLEANfalse
    hatBOOLEANfalse
    headband_hairAccessoryBOOLEANfalse
    tieBOOLEANfalse
    gloveBOOLEANfalse
    watchBOOLEANfalse
    beltBOOLEANfalse
    leg_warmerBOOLEANfalse
    tights_stockingsBOOLEANfalse
    sockBOOLEANfalse
    shoeBOOLEANfalse
    bag_walletBOOLEANfalse
    scarfBOOLEANfalse
    umbrellaBOOLEANfalse
    hoodBOOLEANfalse
    collarBOOLEANfalse
    lapelBOOLEANfalse
    epauletteBOOLEANfalse
    sleeveBOOLEANfalse
    pocketBOOLEANfalse
    necklineBOOLEANfalse
    buckleBOOLEANfalse
    zipperBOOLEANfalse
    appliqueBOOLEANfalse
    beadBOOLEANfalse
    bowBOOLEANfalse
    flowerBOOLEANfalse
    fringeBOOLEANfalse
    ribbonBOOLEANfalse
    rivetBOOLEANfalse
    ruffleBOOLEANfalse
    sequinBOOLEANfalse
    tasselBOOLEANfalse
    everything_elseBOOLEANfalse

    Outputs (1)

    NameTypeDescription
    labels*