Nodes/ComfyUI-RMBG/Clothes Segment (RMBG)
ComfyUI Node Runs on cloud

Clothes Segment (RMBG)

Clothes Segment (RMBG)

By 1038lab·Created 2 years ago·Updated 8 days ago· 2,051
Clothes Segment (RMBG)
  • images
  • background_color
  • IMAGE
  • MASK
  • MASK_IMAGE
Hatfalse
Hairfalse
Facefalse
Sunglassesfalse
Upper-clothesfalse
Skirtfalse
Dressfalse
Beltfalse
Pantsfalse
Left-armfalse
Right-armfalse
Left-legfalse
Right-legfalse
Bagfalse
Scarffalse
Left-shoefalse
Right-shoefalse
Backgroundfalse
process_res512
mask_blur0
mask_offset0
invert_outputfalse
backgroundAlpha

Clothes Segment is the "mask just the shirt" node. Feed it a photo of a person and tick the parts you want - Upper-clothes, Pants, Dress, Hair, whatever - and it returns a mask covering exactly those. It's built for the outfit-editing loop: mask the top, inpaint a new one; mask the dress, recolor it; mask everything but the clothes to keep a person and swap their background. If you've been trying to do this by hand-painting masks, this is the node that ends that.

The mechanism is different from the SAM/BiRefNet nodes and it's why this one is fast and needs no prompt. It's a SegFormer human-parsing model - a network trained specifically to label every pixel of a person into clothing and body categories. So instead of describing what you want in text, you just check boxes for the categories the model already knows. No detector, no point-clicking, no natural language. It knows what "Upper-clothes" is because it was trained on thousands of labeled examples of it.

The inputs are mostly a wall of toggles, and that's the design. You flip on any combination of: Hat, Hair, Face, Sunglasses, Upper-clothes, Skirt, Dress, Belt, Pants, Left-arm, Right-arm, Left-leg, Right-leg, Bag, Scarf, Left-shoe, Right-shoe, and Background. Tick several and it merges them into one combined mask - handy for "all the clothing" in one go, or "arms plus legs" for a skin mask. The handful of real settings underneath: process_res (128–2048, default 512) trades detail for speed and memory; mask_blur and mask_offset clean and grow/shrink the edges; invert_output flips the selection (tick Upper-clothes, invert, and now you've masked everything except the shirt); and background / background_color decide whether you get transparency or a solid fill. Outputs are the usual IMAGE, MASK, and MASK_IMAGE - MASK being the one you pipe into an inpaint or a detailer.

Install is the pack standard: search "Comfyui-RMBG" in ComfyUI Manager, or cd ComfyUI/custom_nodes && git clone https://github.com/1038lab/ComfyUI-RMBG, then pip install -r requirements.txt and restart. The parsing model (SegFormer clothes) auto-downloads on first use into ComfyUI/models/RMBG/segformer_clothes/, so the first run pauses for the download and then it's cached and quick. It's a small model - this node is one of the lighter ones in the pack.

A few practical notes. The categories are only as good as the parser, so on unusual poses, layered outfits, or heavy occlusion it can smear boundaries - bump process_res up and add a point or two of mask_blur to smooth what it gives you. The Left/Right arm and leg split is genuinely useful for things like masking a single sleeve, but the model assigns left/right from the image's orientation, so don't overthink which is which - just look at the MASK_IMAGE preview and pick the one that lit up. And the invert_output trick is the one most people miss: the fastest way to isolate a person's skin is to select the clothing categories and invert, or to keep a subject and drop the background by selecting Background and inverting.

Where this sits versus the rest of the pack: for anything person- and clothing-shaped, this beats wiring up a SAM+GroundingDINO segment node, because you don't have to prompt it and it already understands garment categories. If you need finer fashion detail - specific garment types like cardigans and jumpsuits, or accessories - that's what the Fashion Segment nodes are for. For a plain "cut out the whole person," RMBG or BiRefNet is simpler. Clothes Segment is the specialist for parts of an outfit.

Category🧪AILab/🧽RMBG

Inputs (25)

NameTypeDefaultDescription
imagesIMAGE
HatoptBOOLEANfalse
HairoptBOOLEANfalse
FaceoptBOOLEANfalse
SunglassesoptBOOLEANfalse
Upper-clothesoptBOOLEANfalse
SkirtoptBOOLEANfalse
DressoptBOOLEANfalse
BeltoptBOOLEANfalse
PantsoptBOOLEANfalse
Left-armoptBOOLEANfalse
Right-armoptBOOLEANfalse
Left-legoptBOOLEANfalse
Right-legoptBOOLEANfalse
BagoptBOOLEANfalse
ScarfoptBOOLEANfalse
Left-shoeoptBOOLEANfalse
Right-shoeoptBOOLEANfalse
BackgroundoptBOOLEANfalse
process_resoptINT512128–2048Processing resolution (higher = more VRAM)
mask_bluroptINT00–64Blur amount for mask edges
mask_offsetoptINT0-64–64Expand/Shrink mask boundary
invert_outputoptBOOLEANfalseInvert both image and mask output
backgroundoptCOMBOAlphaChoose background type: Alpha (transparent) or Color (custom background color).
background_coloroptCOLORCODE#222222Choose background color (Alpha = transparent)

Outputs (3)

NameTypeDescription
IMAGEIMAGE
MASKMASK
MASK_IMAGEIMAGE