Nodes/CMK Flow/CMK InstantID Face Detailer SDXL
ComfyUI Node

CMK InstantID Face Detailer SDXL

A second InstantID pass, aimed at one crop

By CMKFlow·Created 3 months ago·Updated a day ago· 6
CMK InstantID Face Detailer SDXL
  • MODEL
  • PROCESS
  • TARGET ROI
  • SOURCE FACE
  • LOG
  • MODEL
  • PROCESS
  • IMAGE
  • LOG
  • diagnostic
◄TOTAL STEPS20►
◄SAMPLING START6►
◄IDENTITY STRENGTH1.00►
◄POSE STRENGTH0.70►
◄instantid_model▾►
◄controlnet_model▾►
◄providerCoreML►
◄cfg4.5►
◄identity_noise0.75►
◄samplereuler_ancestral►
◄schedulerkarras►

InstantID's job in a normal CMK flow happens before the sampler: module 15 injects the identity while the whole image is being built. This node is the opposite case. It takes a cropped face region and runs a small img2img pass on it with InstantID conditioning applied, so a face that came out slightly wrong can be re-rendered with the reference identity still in the loop - without redoing the 1024px image around it.

The source is blunt about its scope: it's "a local InstantID Img2Img detailer; deliberately independent of module 15." You can use it inside the FaceRebuild chain, or standalone if you feed it a crop.

Why you'd want it

Detecting and re-rendering a face is settled practice at this point: the mask decides the region, the crop gets its own sampling pass at a resolution the model can resolve, and the result is composited back. Every detailer works this way - the crop is the whole trick, because a face occupying 70 pixels of a 1024px frame has no latent budget to spend.

What makes this one different from a FaceDetailer-style pass is identity. InstantID gives you an ArcFace embedding plus a keypoint ControlNet, so the re-render is pulled toward your reference person rather than drifting off toward whatever the checkpoint thinks a face looks like. The KB's InstantID panel has the honest framing: it gets close to a likeness and stops. That's still a lot better than a generic detailer pass on a crowd shot.

Inputs that matter

The four you wire: MODEL (a CMK_MODEL_PIPE), PROCESS (a CMK_RESULT_PROCESS), TARGET ROI (the crop, IMAGE) and SOURCE FACE (your reference face, IMAGE). Plus LOG.

Then the sampling controls:

  • SAMPLING START (default 6) - absolute img2img entry point. Earlier values allow more anatomical change; later values keep the existing structure and only clean it up. This is your denoise knob, expressed in steps instead of a 0–1 float.
  • TOTAL STEPS (default 20). The start value is clamped below it, so an out-of-range entry silently becomes the last step rather than an error.
  • IDENTITY STRENGTH (1.0) and POSE STRENGTH (0.7) - how hard the ArcFace embedding and the keypoint ControlNet bite.
  • cfg (4.5) and sampler/scheduler (euler_ancestral / karras).
  • identity_noise (0.75) - noise applied to the unconditional InstantID face embedding, not to your latent.
  • instantid_model, controlnet_model, provider - advanced. Note the provider default ships as CoreML; on a Windows or Linux CUDA box you want CUDA there.

Outputs are MODEL, PROCESS, IMAGE (the rebuilt ROI), LOG and a diagnostic payload you can preview.

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

Manager route: search CMK Flow (registry cmk-flow), install, restart. Then enable Vue Nodes / Nodes 2.0 - CMK's dynamic nodes fall back to plain LiteGraph without it, and this node has advanced toggles that live in that.

Weights are separate from the Python package:

python3 custom_nodes/cmk_nodes/scripts/check_cmk_resources.py --models-root "/path/to/ComfyUI-Shared"

Traps

It refuses to run without a PostProcess Boundary. The node checks process["result_contract"] == "family_neutral" and throws otherwise. You can't hand it a bare SDXL process context from the middle of the generation section; it wants the process object that comes out of the PostProcess Boundary, which is the pack's way of keeping SDXL/Z-Image/HYBRID paths from bleeding into each other.

Two different InsightFace model packs, and they're not interchangeable. The detector dropdown behind the FaceRebuild nodes reads whatever is inside models/insightface/models (buffalo_l is the usual one). InstantID's own face analysis, vendored in this pack, loads antelopev2 by name. antelopev2 is a manual download, so an InstantID error about a missing model usually means you only installed buffalo_l. Both are non-commercial weights - the library is permissive, the models are not.

A disabled FaceRebuild upstream bypasses this node entirely and passes the ROI through untouched, which is correct behaviour and very confusing if you didn't know it was there.

CategoryCMK/Flow/Face

Inputs (16)

NameTypeDefaultDescription
MODELCMK_MODEL_PIPE—
PROCESSCMK_RESULT_PROCESS—
TARGET ROIIMAGE—
SOURCE FACEIMAGE—
LOGCMK_LOG_PIPE—
TOTAL STEPSINT201–200—
SAMPLING STARTINT60–199Absolute Img2Img sampling entry. Earlier values permit more anatomical change.
IDENTITY STRENGTHFLOAT1.000–1—
POSE STRENGTHFLOAT0.700–1—
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

Outputs (5)

NameTypeDescription
MODELCMK_MODEL_PIPE—
PROCESSCMK_RESULT_PROCESS—
IMAGEIMAGE—
LOGCMK_LOG_PIPE—
diagnosticCMK_DIAGNOSTIC—