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

Body Segment (RMBG)

Body Segment (RMBG)

By 1038lab·Created 2 years ago·Updated 8 days ago· 2,051
Body Segment (RMBG)
  • images
  • background_color
  • IMAGE
  • MASK
  • MASK_IMAGE
Hairfalse
Glassesfalse
Top-clothesfalse
Bottom-clothesfalse
Torso-skinfalse
Facefalse
Left-armfalse
Right-armfalse
Left-legfalse
Right-legfalse
Left-footfalse
Right-footfalse
mask_blur0
mask_offset0
invert_outputfalse
backgroundAlpha

Body Segment masks body parts. Tick Torso-skin, or Left-arm, or Face, or Top-clothes, and it hands back a mask covering exactly those regions of a person. It's the whole-body companion to Face Segment and Clothes Segment - same idea, wider scope. Reach for it when you need to isolate limbs, skin, or coarse clothing zones: masking arms and legs for a skin retouch, grabbing the torso for a shirt swap, or keeping a person while dropping everything else.

Like its siblings, it's a human-parsing model rather than a prompt-driven segmenter. The model was trained to label every pixel of a person into body categories, so you don't describe anything - you check boxes for the parts it already knows. No detector to wire up, no text prompt, no point-clicking. That's what makes this family fast and predictable compared to the SAM/GroundingDINO nodes.

The inputs are the part toggles: Hair, Glasses, Top-clothes, Bottom-clothes, Torso-skin, Face, Left-arm, Right-arm, Left-leg, Right-leg, Left-foot, and Right-foot. Flip on any combination and they merge into a single mask - so "both arms" is two boxes, "all skin" is Torso-skin plus the arms and legs (and Face if you want it), and "the outfit" is Top-clothes plus Bottom-clothes. The settings underneath are lean: mask_blur and mask_offset for edge cleanup and growing/shrinking, invert_output to flip the selection, and background / background_color to output transparency or a solid fill. Note there's no process_res slider on this one - it runs at the parser's own working resolution. Outputs are the standard IMAGE, MASK, and MASK_IMAGE; MASK is the one that goes downstream.

Install is the usual pack routine: "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 body-parsing model auto-downloads on first use and caches. It's a small, quick model.

A few things worth knowing. The Left/Right split is assigned from the image's orientation, not the subject's own left and right, so don't agonize over it - glance at the MASK_IMAGE preview and pick whichever side lit up. The category set here is coarser than Clothes Segment's (Top-clothes / Bottom-clothes rather than shirt / skirt / dress), which is exactly right for broad zone work and wrong if you need a specific garment - for that, drop down to Clothes Segment or the Fashion nodes. The invert_output trick applies here too: select the parts you don't want and invert to keep everything else, which is often the fastest way to build a "person minus their clothes" or "everything but the arms" mask. And as always, add a touch of mask_blur before inpainting so the edited region blends instead of showing a hard boundary.

Where it fits against the pack: Body Segment is the tool for limb- and zone-level masks on a person. If you want fine garment detail, use Clothes/Fashion Segment; for facial features, Face Segment; for a plain full-person cutout, RMBG or BiRefNet is simpler. This one earns its place when the thing you're after is "that arm" or "the torso skin" - a body region a general remover can't isolate and a text-prompt segmenter would need coaxing to find.

Category🧪AILab/🧽RMBG

Inputs (18)

NameTypeDefaultDescription
imagesIMAGE
HairoptBOOLEANfalse
GlassesoptBOOLEANfalse
Top-clothesoptBOOLEANfalse
Bottom-clothesoptBOOLEANfalse
Torso-skinoptBOOLEANfalse
FaceoptBOOLEANfalse
Left-armoptBOOLEANfalse
Right-armoptBOOLEANfalse
Left-legoptBOOLEANfalse
Right-legoptBOOLEANfalse
Left-footoptBOOLEANfalse
Right-footoptBOOLEANfalse
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