Nodes/ComfyUI_Sapiens/SapiensSplit
ComfyUI Node

SapiensSplit

Keep just the shirt, or just the legs — pick your body parts

By smthemex·Created 2 years ago·Updated 3 months ago· 205
SapiensSplit
    • conds
    keep_allfalse
    Backgroundfalse
    Apparelfalse
    Eyeglassfalse
    Face_Neckfalse
    Hairfalse
    Left_Footfalse
    Left_Handfalse
    Left_Lower_Armfalse
    Left_Lower_Legfalse
    Left_Shoefalse
    Left_Sockfalse
    Left_Upper_Armfalse
    Left_Upper_Legfalse
    Lower_Clothingfalse
    Right_Footfalse
    Right_Handfalse
    Right_Lower_Armfalse
    Right_Lower_Legfalse
    Right_Shoefalse
    Right_Sockfalse
    Right_Upper_Armfalse
    Right_Upper_Legfalse
    Torsofalse
    Upper_Clothingfalse
    Lower_Lipfalse
    Upper_Lipfalse
    Lower_Teethfalse
    Upper_Teethfalse
    Tonguefalse

    You've got a person in a frame. You want to regenerate just their jacket, just their shoes, or just the upper half - without touching their face, hands, or pose. That's the job SapiensSplit exists for: it's a body-part filter that tells the rest of the pack which parts of the person to keep and which to clear out.

    It rides on the quality of Sapiens' segmentation, which is the best thing about this whole pack - the same Meta Goliath class set that made people notice human vision models in the first place. Where a generic "person mask" is a binary blob, this gives you 29 named parts: left and right socks, shoes, upper and lower arms and legs, torso, apparel, hair, even the lips and teeth as separate classes. That granularity is what makes outfit-specific editing actually work.

    How it works

    The node is deceptively simple: 29 boolean toggles, one per body part, plus a keep_all shortcut. Whatever you tick becomes a list of segmentation class indices, and that list flows out of the conds output into SapiensSampler's optional cond input. The sampler's segmentation pass then colors in only the parts you selected and paints everything else with the background color (the BG_R/G/B you set on the sampler - white by default, which is exactly what you want for mask-style output).

    Here's the part that makes it powerful: it's not just the seg map that gets filtered. The sampler passes that same kept-mask along to the normal, depth, pose, pointmap, and albedo paths. So when you say "keep only the jacket," every map the pack produces is now constrained to the jacket - you get a normal map of just the jacket, a depth map of just the jacket, and so on. Wire those into ControlNet and you can re-render the jacket in a new style or lighting while the rest of the person stays pinned.

    Inputs that matter

    • keep_all - the shortcut. On, and every part is kept; you're effectively saying "whole person." Handy when you want the filter off without unticking 28 boxes.
    • The part toggles - Background, Apparel, Eyeglass, Face_Neck, Hair, the left/right limbs (Foot, Hand, Lower_Arm, Lower_Leg, Shoe, Sock, Upper_Arm, Upper_Leg), Torso, Upper_Clothing, Lower_Clothing, and the facial bits (Upper_Lip, Lower_Lip, Upper_Teeth, Lower_Teeth, Tongue).

    A couple of gotchas baked into the defaults. Tick nothing and leave keep_all off, and you get no filtering - the default whole-person map, because the sampler treats an empty selection as "just do the normal thing." And note the naming: these are Goliath dataset labels, so it's Upper_Clothing not "jacket," Left_Sock not "sock." Close enough to guess, weird enough to trip you up the first time.

    The output

    conds - typed as CONDITIONING, which is a lie worth knowing about. It's really a list of class indices, not a text-prompt conditioning vector. Do not wire it into a KSampler's positive/negative input; it only makes sense feeding the SapiensSampler's cond slot. That type label is just the pack reusing a convenient wire type to carry a list.

    Where you'd reach for it

    This is a character-consistency and editing tool more than a generation tool. Classic moves: keep face, hands, and background but regenerate the outfit; keep only the head for a head-swap or relight; keep only the shoes for product-style consistency shots; or use keep_all as a glorified "just give me the clean person mask." Combined with the pack's mask output and inpainting, it covers a surprising amount of the "change one thing, keep everything else" territory that character-consistency discussions always land on.

    Install and caveats

    Same pack as everything else - ComfyUI Manager, search ComfyUI_Sapiens, or clone into custom_nodes and pip install -r requirements.txt. SapiensSplit needs a seg model loaded in SapiensLoader to have anything to split, so the practical order is: load seg → run sampler with an image → then start ticking parts and re-running.

    The only real annoyance is ergonomic: 29 toggles is a lot of clicking to build a "shirt only" selection every time, and there's no preset save. If that bugs you, remember keep_all is your "undo" button and that the background color lives on the sampler, not here. For everything else - granular, part-level control over what a person in your workflow actually is - SapiensSplit is a genuinely useful little node hiding behind a wall of checkboxes.

    CategorySapiens

    Inputs (30)

    NameTypeDefaultDescription
    keep_allBOOLEANfalse
    BackgroundBOOLEANfalse
    ApparelBOOLEANfalse
    EyeglassBOOLEANfalse
    Face_NeckBOOLEANfalse
    HairBOOLEANfalse
    Left_FootBOOLEANfalse
    Left_HandBOOLEANfalse
    Left_Lower_ArmBOOLEANfalse
    Left_Lower_LegBOOLEANfalse
    Left_ShoeBOOLEANfalse
    Left_SockBOOLEANfalse
    Left_Upper_ArmBOOLEANfalse
    Left_Upper_LegBOOLEANfalse
    Lower_ClothingBOOLEANfalse
    Right_FootBOOLEANfalse
    Right_HandBOOLEANfalse
    Right_Lower_ArmBOOLEANfalse
    Right_Lower_LegBOOLEANfalse
    Right_ShoeBOOLEANfalse
    Right_SockBOOLEANfalse
    Right_Upper_ArmBOOLEANfalse
    Right_Upper_LegBOOLEANfalse
    TorsoBOOLEANfalse
    Upper_ClothingBOOLEANfalse
    Lower_LipBOOLEANfalse
    Upper_LipBOOLEANfalse
    Lower_TeethBOOLEANfalse
    Upper_TeethBOOLEANfalse
    TongueBOOLEANfalse

    Outputs (1)

    NameTypeDescription
    condsCONDITIONING