CMK FaceRebuild SDXL
Detect, re-render, paste back — in one node
- MODEL
- PROCESS
- IMAGE
- LOG
- SOURCE FACE
- VISUAL
- MODEL
- PROCESS
- IMAGE
- LOG
- VISUAL
- diagnostic
One node that does the whole loop: find the target face, cut a head-and-neck crop, run an InstantID-guided img2img pass on that crop, and composite it back with an inset mask. If the FaceRebuild family has a node you'd actually reach for, it's this one - the Prepare/Detailer/Pasteback trio exists for people who want to watch each stage.
And that's the point, because the "where's the likeness" problem on SDXL is mostly a resolution problem. A face 40 pixels wide in a 1024 frame has no latent budget. InstantID fixes who the face resembles; this node fixes whether the face can be resolved at all. Run them together and the face that used to come out as a smear comes out as the person you meant.
Wiring
In: MODEL, PROCESS, IMAGE, LOG. Out: MODEL, PROCESS, IMAGE, LOG, VISUAL, diagnostic.
VISUAL registers the stage in the pack's Visualizer chain, so this rebuild shows up alongside the other processing stages instead of being invisible.
Settings, grouped by what they do
Detection and geometry: TARGET FACE (Largest, Leftmost, Rightmost, Topmost, Bottommost, Center - note the default here is Leftmost, not Largest), HEAD AREA (0.75), NECK AREA (0.4), MASK FEATHER (32), WORKING RESOLUTION (768/1024/1280), DETECT MODEL, DETECT SIZE (640).
Identity: SOURCE FACE, IDENTITY STRENGTH (1.0), POSE STRENGTH (0.7), identity_noise (0.75 - noise on the unconditional face embedding, not on your latent), plus instantid_model and controlnet_model.
Sampling: TOTAL STEPS (20), SAMPLING START (−2 … +2, default 0), cfg (4.5), sampler (euler_ancestral), scheduler (karras).
Plus FACEREBUILD ENABLE, which bypasses the lot and passes the image through, and PASTEBACK NECK.
SAMPLING START deserves a second look. Its tooltip reads SOURCE (-2) to TARGET (+2), and the engine translates that into an absolute entry step around the midpoint of TOTAL STEPS, clamped into range. Negative = start earlier = more freedom to change the face's anatomy. Positive = start later = keep the existing structure and just clean it. If your rebuild keeps producing a different-looking person, walk this toward +1 first, before you touch identity strength.
Why the pack's own architecture keeps getting in the way here
CMK is opinionated: module numbers in a fixed 01→20 order, mandatory boundaries after each module, and a hard rule that you don't route payloads around a Prepare/Execute pair to peek at them. The README's development rule says a working technical solution isn't a CMK solution when it "erases unnecessary user decisions" at the cost of mis-wireability or re-running unchanged expensive modules. Sometimes that reads as fussy.
It also explains the two things that will stop you cold. The node requires a PROCESS whose result_contract is family_neutral - no PostProcess Boundary, no rebuild. And it lives in the Toolbox half of the pack, the "open experimental box" side, so it doesn't need the numbered modules but it does need the boundary they produce.
Worth knowing what you're buying here, too. CMK Flow is a young, effectively one-author pack - Carsten Kirschner, GPL-3.0-or-later, German-first docs (an English README exists). Its community footprint is tiny: the open-source announcement on r/comfyui in July 2026 sat at 14 upvotes, the follow-up posts at 1, and that's the entire corpus. So there's no crowd of people who already hit your bug. The upside is that the pack ships its own diagnostics and a LOG pipe that narrates exactly what each module did, which is more than most packs with ten times the user base manage.
Install
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
Or ComfyUI Manager → search CMK Flow (registry cmk-flow) → install → restart. Then verify the models, because this node has a long list of them:
python3 custom_nodes/cmk_nodes/scripts/check_cmk_resources.py --models-root "/path/to/ComfyUI-Shared"
It reports FOUND/MISSING per file and can pull the InstantID adapter and ControlNet directly:
python3 custom_nodes/cmk_nodes/scripts/check_cmk_resources.py \
--install instantid-adapter --target-root "/path/to/ComfyUI-Shared"
Two model traps. The detector dropdown reads whatever is under models/insightface/models (buffalo_l usually), but InstantID's vendored face analysis always loads antelopev2 by name - separate, manual, non-commercial weights. And the provider widget defaults to CoreML; on CUDA hardware, change it.
Inputs (27)
| Name | Type | Default | Description |
|---|---|---|---|
| MODEL | CMK_MODEL_PIPE | — | |
| PROCESS | CMK_RESULT_PROCESS | — | |
| IMAGE | IMAGE | — | |
| LOG | CMK_LOG_PIPE | — | |
| FACEREBUILD ENABLE | BOOLEAN | true | — |
| TARGET FACE | COMBO | Leftmost | 6 options: Largest, Leftmost, Rightmost, Topmost, Bottommost, Center |
| SOURCE FACE | IMAGE | — | |
| PASTEBACK NECK | BOOLEAN | false | — |
| SAMPLING START | INT | 0-2–2 | SOURCE (-2) to TARGET (+2). Zero selects the face-size balance automatically. |
| IDENTITY STRENGTH | FLOAT | 1.000–1 | — |
| POSE STRENGTH | 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 | — |