Clothes Segment (RMBG)
Clothes Segment (RMBG)
- images
- background_color
- IMAGE
- MASK
- MASK_IMAGE
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.
Inputs (25)
| Name | Type | Default | Description |
|---|---|---|---|
| images | IMAGE | — | |
| Hatopt | BOOLEAN | false | — |
| Hairopt | BOOLEAN | false | — |
| Faceopt | BOOLEAN | false | — |
| Sunglassesopt | BOOLEAN | false | — |
| Upper-clothesopt | BOOLEAN | false | — |
| Skirtopt | BOOLEAN | false | — |
| Dressopt | BOOLEAN | false | — |
| Beltopt | BOOLEAN | false | — |
| Pantsopt | BOOLEAN | false | — |
| Left-armopt | BOOLEAN | false | — |
| Right-armopt | BOOLEAN | false | — |
| Left-legopt | BOOLEAN | false | — |
| Right-legopt | BOOLEAN | false | — |
| Bagopt | BOOLEAN | false | — |
| Scarfopt | BOOLEAN | false | — |
| Left-shoeopt | BOOLEAN | false | — |
| Right-shoeopt | BOOLEAN | false | — |
| Backgroundopt | BOOLEAN | false | — |
| process_resopt | INT | 512128–2048 | Processing resolution (higher = more VRAM) |
| mask_bluropt | INT | 00–64 | Blur amount for mask edges |
| mask_offsetopt | INT | 0-64–64 | Expand/Shrink mask boundary |
| invert_outputopt | BOOLEAN | false | Invert both image and mask output |
| backgroundopt | COMBO | Alpha | Choose background type: Alpha (transparent) or Color (custom background color). |
| background_coloropt | COLORCODE | #222222 | Choose background color (Alpha = transparent) |
Outputs (3)
| Name | Type | Description |
|---|---|---|
| IMAGE | IMAGE | — |
| MASK | MASK | — |
| MASK_IMAGE | IMAGE | — |