CMK FaceRebuild SDXL · Advanced
Three faces, three identities, one node
- MODEL
- PROCESS
- IMAGE
- LOG
- SOURCE FACE 1
- SOURCE FACE 2
- SOURCE FACE 3
- VISUAL
- MODEL
- PROCESS
- IMAGE
- LOG
- VISUAL
- diagnostic
Two people in frame, and you only want one of them to become your reference person. Or three people, and you want a different reference on each. CMK FaceRebuild SDXL · Advanced is the version of the FaceRebuild executor that does exactly that: up to three slots, each with its own target face, its own source image, and its own strength values, executed in sequence by a single node.
The community has wanted this shape for years, for a specific reason. Detailing a group shot with a single identity produces clones - the same base-seed re-render applied region by region converges on one person. Slots let you say "leftmost gets reference A, rightmost gets reference B."
The slots
Each of FACE 1, FACE 2, FACE 3 has the same little block of settings:
ENABLE- off by default except for slot 1. Inactive slots are ignored completely.TARGET FACE- which detected person this slot rebuilds:Largest,Leftmost,Rightmost,Topmost,Bottommost,Center. Three slots ship pre-seeded withLeftmost,Center,Rightmost, which is the sensible default for a group.SOURCE FACE- the reference face image for that slot. Each slot can point at a different person.IDENTITY STRENGTH(1.0) /POSE STRENGTH(0.7) - per slot.SAMPLING START(−2 … +2, default 0). Tooltip:SOURCE (-2) to TARGET (+2). It's a relative position, not an absolute step: the code takes half ofTOTAL STEPSas neutral and offsets from there, then clamps into range. Negative pushes the re-render earlier so more anatomical change is allowed; positive holds the existing layout.PASTEBACK NECK- whether the generated neck ellipse makes it into the final composite.
Shared below the slots: TOTAL STEPS (20), HEAD AREA (0.75), NECK AREA (0.4), MASK FEATHER (32), WORKING RESOLUTION (768/1024/1280), DETECT MODEL and DETECT SIZE, and the InstantID stack - instantid_model, controlnet_model, provider (default CoreML), cfg (4.5), identity_noise (0.75), sampler, scheduler.
Wiring: MODEL, PROCESS, IMAGE, LOG in; MODEL, PROCESS, IMAGE, LOG, VISUAL, diagnostic out. VISUAL is optional on the input side and feeds the pack's central VISUAL chain so each rebuild stage can show up in the CMK Visualizer.
How it runs
Slots are resolved against the unmodified target: it detects once, maps each selector to an actual face box, then sorts the active slots largest-face-first. Then, one at a time, it crops, samples with InstantID, and pastes back into the working image, so slot 2 sees the result of slot 1. Results are cached internally against the resolved input signature, so a re-run that changes nothing doesn't redo all three passes.
Two behaviours worth knowing:
- Duplicate targets are a hard error. If two active slots resolve to the same detected face you get "two active slots resolve to the same target face; choose a different TARGET FACE in one of those slots." Good error, but it's the one that bites when a selector lands on a face you didn't expect.
- The experimental landmark shape warp is suspended here. The engine has code for deforming the target geometry toward dense source landmarks, and
Prepareexposes it, but this node deliberately passesSHAPE STRENGTH = 0.0. Don't expect the tooltip language about SOURCE/TARGET to mean geometry transfer in Advanced - it's sampling position.
Install and requirements
cd ComfyUI
git clone https://github.com/CMKFlow/cmk_nodes.git custom_nodes/cmk_nodes
python3 custom_nodes/cmk_nodes/scripts/install_cmk_requirements.py
Manager: search CMK Flow (cmk-flow), then restart. Turn on Vue Nodes / Nodes 2.0 - with 30-odd widgets on this node you want the frontend that handles automatic sizing and advanced folding.
Budget the cost honestly: three slots means three InstantID sampling passes plus detection. On a 12GB card, keep total steps low and expect this to be the slow node in the graph. InstantID itself is SDXL-only and its reference repo has been dormant since mid-2024 - on anything past SDXL this whole family is the wrong tool.
Inputs (42)
| Name | Type | Default | Description |
|---|---|---|---|
| MODEL | CMK_MODEL_PIPE | — | |
| PROCESS | CMK_RESULT_PROCESS | — | |
| IMAGE | IMAGE | — | |
| LOG | CMK_LOG_PIPE | — | |
| FACEREBUILD ENABLE | BOOLEAN | true | — |
| FACE 1 ENABLE | BOOLEAN | true | — |
| TARGET FACE 1 | COMBO | Leftmost | 6 options: Largest, Leftmost, Rightmost, Topmost, Bottommost, Center |
| SOURCE FACE 1 | IMAGE | — | |
| PASTEBACK NECK 1 | BOOLEAN | false | — |
| SAMPLING START 1 | INT | 0-2–2 | SOURCE (-2) to TARGET (+2). Zero selects the face-size balance automatically. |
| IDENTITY STRENGTH 1 | FLOAT | 1.000–1 | — |
| POSE STRENGTH 1 | FLOAT | 0.700–1 | — |
| FACE 2 ENABLE | BOOLEAN | false | — |
| TARGET FACE 2 | COMBO | Center | 6 options: Largest, Leftmost, Rightmost, Topmost, Bottommost, Center |
| SOURCE FACE 2 | IMAGE | — | |
| PASTEBACK NECK 2 | BOOLEAN | false | — |
| SAMPLING START 2 | INT | 0-2–2 | SOURCE (-2) to TARGET (+2). Zero selects the face-size balance automatically. |
| IDENTITY STRENGTH 2 | FLOAT | 1.000–1 | — |
| POSE STRENGTH 2 | FLOAT | 0.700–1 | — |
| FACE 3 ENABLE | BOOLEAN | false | — |
| TARGET FACE 3 | COMBO | Rightmost | 6 options: Largest, Leftmost, Rightmost, Topmost, Bottommost, Center |
| SOURCE FACE 3 | IMAGE | — | |
| PASTEBACK NECK 3 | BOOLEAN | false | — |
| SAMPLING START 3 | INT | 0-2–2 | SOURCE (-2) to TARGET (+2). Zero selects the face-size balance automatically. |
| IDENTITY STRENGTH 3 | FLOAT | 1.000–1 | — |
| POSE STRENGTH 3 | FLOAT | 0.700–1 | — |
| TOTAL STEPS | INT | 201–200 | — |
| HEAD AREA | FLOAT | 0.750–2 | — |
| NECK AREA | FLOAT | 0.400–2 | — |
| MASK FEATHER | INT | 320–64 | — |
| WORKING RESOLUTION | COMBO | 1024 | 3 options: 768, 1024, 1280 |
| DETECT MODEL | COMBO | buffalo_l | 1 options: buffalo_l |
| DETECT SIZE | INT | 640128–1280 | — |
| instantid_model | COMBO | 1 options: | |
| controlnet_model | COMBO | 1 options: | |
| provider | COMBO | CoreML | 4 options: CoreML, CPU, CUDA, ROCM |
| cfg | FLOAT | 4.50–10 | — |
| identity_noise | FLOAT | 0.750–1 | — |
| sampler | COMBO | euler_ancestral | 44 options: euler, euler_cfg_pp, euler_ancestral, euler_ancestral_cfg_pp, heun, heunpp2, +38 |
| scheduler | COMBO | karras | 9 options: simple, sgm_uniform, karras, exponential, ddim_uniform, beta, +3 |
| VISUALopt | CMK_VISUAL_PIPE | — | |
| _cmk_content_guard_enabledopt | BOOLEAN | true | — |
Outputs (6)
| Name | Type | Description |
|---|---|---|
| MODEL | CMK_MODEL_PIPE | — |
| PROCESS | CMK_RESULT_PROCESS | — |
| IMAGE | IMAGE | — |
| LOG | CMK_LOG_PIPE | — |
| VISUAL | CMK_VISUAL_PIPE | — |
| diagnostic | CMK_DIAGNOSTIC | — |