Nodes/ComfyUI-FirstOrderMM/FOMM Seg15 Chooser
ComfyUI Node

FOMM Seg15 Chooser

The finest face-part picker, and the one the face parser pairs with

By FuouM·Created 2 years ago·Updated about a year ago· 9
FOMM Seg15 Chooser
    • chosen_seg_indices
    m_0_backgroundfalse
    m_1_rt_fr_headtrue
    m_2_eyestrue
    m_3_mouthtrue
    m_4_lwr_shouldertrue
    m_5_shouldertrue
    m_6_lt_fr_headtrue
    m_7true
    m_8_hair_tiptrue
    m_9_frnt_facetrue
    m_10_rt_eartrue
    m_11_outer_hairtrue
    m_12_lt_eartrue
    m_13_lt_hairtrue
    m_14_rt_hairtrue
    m_15_necktrue

    FOMM_Seg15Chooser is the fine-grained end of the segment-picker trio in this pack. It generates the chosen_seg_indices string for FOMM_Partswap, matching the vox-15segments model - the one that splits a face into sixteen semantic regions so you can swap individual parts with real precision.

    Its checkboxes are the most granular set in the pack: m_0_background, m_1_rt_fr_head, m_2_eyes, m_3_mouth, m_4_lwr_shoulder, m_5_shoulder, m_6_lt_fr_head, m_8_hair_tip, m_9_frnt_face, m_10_rt_ear, m_11_outer_hair, m_12_lt_ear, m_13_lt_hair, m_14_rt_hair, m_15_neck - and one quirky one, m_7, which the pack's constants list with no name at all. It's a real, detectable region; the authors just never labelled it. If you see a stray swapped patch, that's it.

    Background defaults off, everything else on. As with the other choosers, this node does no inference: it reads the booleans, keeps the indices of the checked ones, and outputs them as an underscore-joined string for FOMM_Partswap to deserialize.

    Why 15 segments

    Precision, and a specific pairing. With 15 segments you can do things the 5- and 10-segment models can't express, like swapping just the mouth (m_3_mouth) for a lip-sync effect, or swapping the face while leaving every strand of hair (m_13_lt_hair, m_14_rt_hair, m_8_hair_tip, m_11_outer_hair) untouched. And per the README, the 15-segment model is the one the optional face-parsing pass (use_face_parser on FOMM_Partswap, which needs the resnet18-5c106cde.pth + 79999_iter.pth weights in face_parsing/) is designed to pair with for cleaning up residual background. The finer segments plus face parsing is the setup the author points at for the cleanest swaps.

    Wiring it up

    • Output chosen_seg_indices → FOMM_Partswap's chosen_seg_indices input.
    • This chooser is for vox-15segments only. Use it with the 5- or 10-segment models and the index numbers stop meaning what they say - out-of-range indices get silently dropped, so you'll usually end up with a partial or empty swap instead of a crash.

    Install and gotchas

    Pack install only - ComfyUI Manager (search "FirstOrderMM") or git clone + pip install -r requirements.txt into custom_nodes/, restart. The model it feeds (vox-15segments.pth.tar in checkpoints/) is a manual download like everything here.

    Two things to remember. First, the default (everything but background on) is a full-face swap; untick what you want to keep. Second, if you enable use_face_parser on the Partswap node, that's extra weights you have to fetch by hand - the README's "should definitely be used for FOMM models" refers to using it, but it won't do anything until the two .pth files are in place. And if your output has a mysterious unswapped or oddly-swapped patch around the forehead, you've likely met m_7 - the nameless segment.

    CategoryFirstOrderMM

    Inputs (16)

    NameTypeDefaultDescription
    m_0_backgroundBOOLEANfalse
    m_1_rt_fr_headBOOLEANtrue
    m_2_eyesBOOLEANtrue
    m_3_mouthBOOLEANtrue
    m_4_lwr_shoulderBOOLEANtrue
    m_5_shoulderBOOLEANtrue
    m_6_lt_fr_headBOOLEANtrue
    m_7BOOLEANtrue
    m_8_hair_tipBOOLEANtrue
    m_9_frnt_faceBOOLEANtrue
    m_10_rt_earBOOLEANtrue
    m_11_outer_hairBOOLEANtrue
    m_12_lt_earBOOLEANtrue
    m_13_lt_hairBOOLEANtrue
    m_14_rt_hairBOOLEANtrue
    m_15_neckBOOLEANtrue

    Outputs (1)

    NameTypeDescription
    chosen_seg_indicesSTRING