Muse Person Segmenter (SAM3)
Turning One Crowd Shot Into Four Characters
- image
- obj_masks
- person_1_image
- person_1_mask
- person_2_image
- person_2_mask
- person_3_image
- person_3_mask
- person_4_image
- person_4_mask
- person_count
- annotated_preview
The use case this node is built for: a reference shot with several people in it, and you want each of them as their own character reference for per-person lipsync or audio routing in the Muse Director. MusePersonSegmenter takes a frame plus SAM3's instance masks and splits it into up to four individual person crops with matching masks - sorted left-to-right, color-coded, and annotated so you can tell who's who.
It doesn't do the segmentation itself; it consumes it. That's the first thing to understand. This node expects obj_masks from SAM3's Sam3ImageSegmentation node (specifically the ComfyUI-Easy-Sam3 package by yolain, which is the dependency the source calls out). If you don't have SAM3 upstream, there's nothing to feed this node.
How it works
In, you get a reference image and the obj_masks from Sam3ImageSegmentation. The node normalizes the mask tensor, keeps the first four detected instances, sorts them left-to-right by centroid X (so person 1 is the leftmost person in frame, not the biggest or the model's favorite), then for each person crops the image and mask to their bounding box plus crop_padding pixels of margin.
Out, you get a lot:
person_1_image/person_1_mask…person_4_image/person_4_mask- the crops and their masks. Empty slots return 8×8 zero tensors rather than failing, so downstream nodes can assume all four outputs always exist.person_count- how many people were actually found (INT).annotated_preview- the source frame with each person tinted (red, green, blue, yellow) so you can verify the assignment before wiring anything.
The crop_padding input (default 40px) is the one knob: too tight and the crop clips shoulders, too loose and characters bleed into each other.
Where it fits
This is a front-end for the Director's per-person audio routing and lip-sync ambitions - individual face/body crops per character, ready to be wired to per-person conditioning or audio. In that sense it's the person-scale sibling of MuseFaceLock (which crops a single face via SAM3 text prompting): Face Lock is for a single identity, Person Segmenter is for untangling a group shot.
Installing it
Two packages again - the pack, plus the SAM3 source it depends on:
cd ComfyUI/custom_nodes
git clone https://github.com/muse-collective-26/muse-ltx-timeline
# plus the upstream SAM3 package this node expects:
# ComfyUI-Easy-Sam3 (yolain) via ComfyUI Manager or git clone
Restart, pip install av torchaudio soundfile. The pack's README doesn't document the SAM3 dependency, so treat it as the gotcha it is - no Sam3ImageSegmentation upstream, and this node's obj_masks socket has nothing to plug into.
Gotchas
- Order is spatial, not semantic. "Person 1" is the leftmost person, not the protagonist. Check
annotated_previewbefore you wire person 3's crop to person 3's audio track. - It caps at four people. More than four in frame and the rest are simply dropped.
- WIP module loaded in a try/except - missing Easy-Sam3 means the node silently won't register.
For multi-character LTX work this is exactly the plumbing you'd otherwise build by hand. Just remember the two-install reality and double-check the color-coded preview before committing to the wiring.
Inputs (3)
| Name | Type | Default | Description |
|---|---|---|---|
| image | IMAGE | — | |
| obj_masks | MASK | — | |
| crop_padding | INT | 400–300 | Pixels of padding added around each person's bounding box crop |
Outputs (10)
| Name | Type | Description |
|---|---|---|
| person_1_image | IMAGE | — |
| person_1_mask | MASK | — |
| person_2_image | IMAGE | — |
| person_2_mask | MASK | — |
| person_3_image | IMAGE | — |
| person_3_mask | MASK | — |
| person_4_image | IMAGE | — |
| person_4_mask | MASK | — |
| person_count | INT | — |
| annotated_preview | IMAGE | — |