Nodes/CMK Flow/CMK FaceRebuild SDXL
ComfyUI Node

CMK FaceRebuild SDXL

Detect, re-render, paste back — in one node

By CMKFlow·Created 3 months ago·Updated a day ago· 6
CMK FaceRebuild SDXL
  • MODEL
  • PROCESS
  • IMAGE
  • LOG
  • SOURCE FACE
  • VISUAL
  • MODEL
  • PROCESS
  • IMAGE
  • LOG
  • VISUAL
  • diagnostic
◄FACEREBUILD ENABLEtrue►
◄TARGET FACELeftmost►
◄PASTEBACK NECKfalse►
◄SAMPLING START0►
◄IDENTITY STRENGTH1.00►
◄POSE STRENGTH0.70►
◄TOTAL STEPS20►
◄HEAD AREA0.75►
◄NECK AREA0.40►
◄MASK FEATHER32►
◄WORKING RESOLUTION1024►
◄DETECT MODELbuffalo_l►
◄DETECT SIZE640►
◄instantid_model▾►
◄controlnet_model▾►
◄providerCoreML►
◄cfg4.5►
◄identity_noise0.75►
◄samplereuler_ancestral►
◄schedulerkarras►
◄_cmk_content_guard_enabledtrue►

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.

CategoryCMK/Flow/Face

Inputs (27)

NameTypeDefaultDescription
MODELCMK_MODEL_PIPE—
PROCESSCMK_RESULT_PROCESS—
IMAGEIMAGE—
LOGCMK_LOG_PIPE—
FACEREBUILD ENABLEBOOLEANtrue—
TARGET FACECOMBOLeftmost6 options: Largest, Leftmost, Rightmost, Topmost, Bottommost, Center
SOURCE FACEIMAGE—
PASTEBACK NECKBOOLEANfalse—
SAMPLING STARTINT0-2–2SOURCE (-2) to TARGET (+2). Zero selects the face-size balance automatically.
IDENTITY STRENGTHFLOAT1.000–1—
POSE STRENGTHFLOAT0.700–1—
TOTAL STEPSINT201–200—
HEAD AREAFLOAT0.750–2—
NECK AREAFLOAT0.400–2—
MASK FEATHERINT320–64—
WORKING RESOLUTIONCOMBO10243 options: 768, 1024, 1280
DETECT MODELCOMBObuffalo_l1 options: buffalo_l
DETECT SIZEINT640128–1280—
instantid_modelCOMBO1 options:
controlnet_modelCOMBO1 options:
providerCOMBOCoreML4 options: CoreML, CPU, CUDA, ROCM
cfgFLOAT4.50–10—
identity_noiseFLOAT0.750–1—
samplerCOMBOeuler_ancestral44 options: euler, euler_cfg_pp, euler_ancestral, euler_ancestral_cfg_pp, heun, heunpp2, +38
schedulerCOMBOkarras9 options: simple, sgm_uniform, karras, exponential, ddim_uniform, beta, +3
VISUALoptCMK_VISUAL_PIPE—
_cmk_content_guard_enabledoptBOOLEANtrue—

Outputs (6)

NameTypeDescription
MODELCMK_MODEL_PIPE—
PROCESSCMK_RESULT_PROCESS—
IMAGEIMAGE—
LOGCMK_LOG_PIPE—
VISUALCMK_VISUAL_PIPE—
diagnosticCMK_DIAGNOSTIC—