Nodes/ComfyUI-FirstOrderMM/FOMM Seg10 Chooser
ComfyUI Node

FOMM Seg10 Chooser

Pick which face parts swap, one checkbox at a time

By FuouM·Created 2 years ago·Updated about a year ago· 9
FOMM Seg10 Chooser
    • chosen_seg_indices
    m_0_backgroundfalse
    m_1_lf_eartrue
    m_2_mouthtrue
    m_3_lf_fr_headtrue
    m_4_rt_eartrue
    m_5_frnt_facetrue
    m_6_lt_cheektrue
    m_7_eyestrue
    m_8_rt_fr_headtrue
    m_9_shouldertrue
    m_10_hair_toptrue

    FOMM_Seg10Chooser is a tiny helper node, and it exists for one reason: to make FOMM_Partswap's chosen_seg_indices input human-readable. Instead of typing a cryptic string like 1_2_5_7 into a text field, you get eleven checkboxes - one per segment - and the node turns whatever you've ticked into the string the Partswap node actually wants.

    Each checkbox maps to one of the 10-segment model's semantic regions: m_0_background, m_1_lf_ear, m_2_mouth, m_3_lf_fr_head, m_4_rt_ear, m_5_frnt_face, m_6_lt_cheek, m_7_eyes, m_8_rt_fr_head, m_9_shoulder, m_10_hair_top. Background defaults to off; everything else defaults to on. Tick the parts you want swapped in and the node outputs chosen_seg_indices - an underscore-joined list of the indices of the checked segments.

    How it works

    There's no model here and no inference. The node counts the booleans you passed in, collects the indices of the ones that are true, and serializes them: "1_2_5" for left ear + mouth + front head. FOMM_Partswap deserializes that string, filters out any index that's out of range for the model you chose (so a bad mismatch won't crash - it just swaps nothing), and builds the blend mask from those segments. This is a pure plumbing node: it converts your checkbox choices into the string the Partswap node's input expects.

    Wiring it up

    • Output chosen_seg_indices → FOMM_Partswap's chosen_seg_indices input. That's the whole job.
    • Match the chooser to the model. Use this one (10 segments) with vox-10segments - and also with vox-cpk, vox-adv-cpk, and vox-first-order, which all run the same 10-segment config. For vox-5segments use the FOMM_Seg5Chooser, and for vox-15segments the FOMM_Seg15Chooser.

    You can also type a segment string by hand into chosen_seg_indices and skip this node entirely - it's just a nicer interface, not a required step. But if you're swapping something specific like "only the mouth," ticking m_2_mouth here and seeing it flow through beats guessing at index numbers.

    Install and issues

    No install beyond the pack itself - ComfyUI Manager (search "FirstOrderMM") or git clone + pip install -r requirements.txt into custom_nodes/, restart. There are no model files for this node; it only matters once you have a Partswap model in checkpoints/.

    Two practical gotchas. First, the default "everything but background is on" means if you connect this without thinking, you get a full-face swap - untick the parts you want to keep. Second, segment names are the model's, not yours: that m_7_eyes is plural and includes brows, and m_5_frnt_face is the central face region, so "swap the face but not the eyes" means turning m_5_frnt_face on and m_7_eyes off. Preview via FOMM_Partswap's seg_src_viz/seg_tgt_viz outputs to see what the model actually detected before you commit.

    CategoryFirstOrderMM

    Inputs (11)

    NameTypeDefaultDescription
    m_0_backgroundBOOLEANfalse
    m_1_lf_earBOOLEANtrue
    m_2_mouthBOOLEANtrue
    m_3_lf_fr_headBOOLEANtrue
    m_4_rt_earBOOLEANtrue
    m_5_frnt_faceBOOLEANtrue
    m_6_lt_cheekBOOLEANtrue
    m_7_eyesBOOLEANtrue
    m_8_rt_fr_headBOOLEANtrue
    m_9_shoulderBOOLEANtrue
    m_10_hair_topBOOLEANtrue

    Outputs (1)

    NameTypeDescription
    chosen_seg_indicesSTRING