Nodes/CMK Flow/CMK InstantID Regional Advanced SDXL -Pipe-
ComfyUI Node

CMK InstantID Regional Advanced SDXL -Pipe-

InstantID, Regionalized

By CMKFlow·Created 3 months ago·Updated 2 days ago· 6
CMK InstantID Regional Advanced SDXL -Pipe-
  • MODEL
  • PROCESS
  • SAMPLED
  • LOG
  • source_face_a
  • source_face_b
  • VISUAL
  • LOG_B
  • MODEL
  • PROCESS
  • SAMPLED
  • LOG
  • IDENTITY IMAGE
  • VISUAL
  • diagnostic
◄enable_source_btrue►
◄identity_strength_a1.00►
◄pose_strength_a0.70►
◄target_face_aLeftmost►
◄identity_strength_b1.00►
◄pose_strength_b0.70►
◄target_face_bRightmost►
◄instantid_start0.00►
◄instantid_end1.00►
◄instantid_model▾►
◄controlnet_model▾►
◄providerCoreML►
◄cfg4.5►
◄noise0.75►
◄conditioning_modeInstantID reference►
◄reference_conditioning_weight0.75►
◄reference_start_at_step8►
◄_cmk_content_guard_enabledtrue►

Two people in the frame, two donor photos, no desire to train two character LoRAs to get there. Plain InstantID can't help - one face, one ArcFace embedding, one IdentityNet keypoint map over the whole image. Ask it for two people and the same identity leaks onto both heads, or one person inherits the donor's jaw while the other turns to mush.

This is the regional variant: up to two donors, each bound to a specific person in the layout, each with its own attention patch and keypoint ControlNet branch behind a region mask, finished in one sampling continuation.

Where it sits in the CMK chain

Nodes named -Pipe- belong to CMK's closed, guided ecosystem where wires carry proprietary types; the rest of the pack is an open scratchbox. This one is -Pipe-, module 15 of the numbered SDXL path: 01 START HERE → 02 Regional Conditioning → 05 ControlNet → 10 KSampler → 15 InstantID → 20 Refiner.

It doesn't take an IMAGE from a sampler - it takes SAMPLED, a latent handoff type used between sampler, InstantID and refiner so you can't mis-plug a decoded picture into it. The conceptual shift: identity injection happens inside sampling, not to a finished render.

It also obeys module 01: with instantid_enabled off there, the node passes your pipes through and hands back no identity image. No error. Just nothing.

What it does under the hood

In order: the keypoints latent is decoded to a layout image so InsightFace (through provider) can find the faces. target_face_a and target_face_b pick which person in that layout gets which donor - Largest, Leftmost, Rightmost, Topmost, Bottommost or Center - and each selection becomes its own region mask. InstantID's attention patch is then applied twice, once per donor with its own weight, and two ControlNet branches stack keypoint hints with separate pose_strength. One KSampler continuation runs from the layout latent; that decode is your IDENTITY IMAGE.

Two levers surprise people. identity_strength_a and identity_strength_b cap at 1.0 - the old "InstantID weight 1–1.3" advice doesn't apply here. The author's answer for more identity pressure is noise, perturbation on the unconditional face embedding; the tooltip says so, and that it is not sampling noise. And the default conditioning_mode of InstantID reference re-encodes your prompts with the checkpoint's native CLIP, blended against prepared conditioning at reference_conditioning_weight (0.75) - which is why a prompt full of LoRA syntax behaves differently here. CMK prepared reuses what module 10 built.

The inputs and outputs that matter

Wire source_face_a from a load-image node, and turn enable_source_b off with only one donor - the tooltip says it skips all Source B loading, analysis, attention, ControlNet and guard work, so leaving it on with an empty source_face_b is a hard error rather than a one-face run. With B on, source_face_b loads lazily, so nothing expensive happens until needed. instantid_start/instantid_end gate both the attention and the ControlNet together. reference_start_at_step only matters in the InstantID + module 05 reference-latent path: higher preserves reference composition, lower allows more redesign.

Outputs: MODEL, PROCESS, SAMPLED, LOG, IDENTITY IMAGE, VISUAL, diagnostic. IDENTITY IMAGE is the guard-approved decode - for your eyes and your comparer, not the final result.

Install

ComfyUI Manager, search CMK Flow, install the entry from CMKFlow, restart. Or manually, ComfyUI fully closed:

cd /path/to/ComfyUI
git clone https://github.com/CMKFlow/cmk_nodes.git custom_nodes/cmk_nodes
python3 custom_nodes/cmk_nodes/scripts/install_cmk_requirements.py

That second command isn't optional - a manual clone never runs pip, and the requirements pull insightface, onnxruntime, ultralytics, nudenet, segment-anything and OpenCV. Then the weights pip knows nothing about:

python3 custom_nodes/cmk_nodes/scripts/check_cmk_resources.py \
  --models-root "/path/to/shared/models" --install instantid-adapter
python3 custom_nodes/cmk_nodes/scripts/check_cmk_resources.py \
  --models-root "/path/to/shared/models" --install instantid-controlnet

Expect models/instantid/ip-adapter.bin and models/controlnet/instantid/diffusion_pytorch_model.safetensors; the check also unpacks the official buffalo_l InsightFace archive and SHA-verifies pinned downloads. Keep Vue Nodes / Nodes 2.0 on, or CMK's widgets degrade to old LiteGraph.

Troubleshooting

InstantID Sampler SDXL -Pipe-: InstantID and ControlNet models are required means the two advanced dropdowns are empty - the weights aren't where CMK looks.

provider defaults to CoreML - the author's validation machine was a Mac. On Nvidia set CUDA, on AMD set ROCM; the wrong provider is slow at best.

InsightFace is still one of the rougher installs in the ecosystem, though version 1.0 in May 2026 dropped the C++ build step - a compiler error means your version is stale.

The content guard runs on donor photos and on the sampled result; a source face estimated under the conservative 25 threshold is a hard abort with diagnostic codes. Swap the photo, don't debug it.

Overlapping faces are where this runs out: intersecting regions can't isolate two identities, so keep the people spatially separated. And InstantID is an SDXL-era adapter with no Flux path - excellent on Illustrious and photoreal SDXL checkpoints, a dead end anywhere newer, and its InsightFace weights are research-only.

CategoryCMK/Flow/Face

Inputs (26)

NameTypeDefaultDescription
MODELCMK_MODEL_PIPE—
PROCESSCMK_PROCESS_SDXL—
SAMPLEDCMK_SAMPLED_PIPE—
LOGCMK_LOG_PIPE—
source_face_aIMAGE—
enable_source_bBOOLEANtrueDisable to skip all Source B loading, analysis, attention, ControlNet, and guard work.
source_face_bIMAGE—
identity_strength_aFLOAT1.000–1—
pose_strength_aFLOAT0.700–1—
target_face_aCOMBOLeftmostPerson in the preliminary prompt layout that receives identity A.
identity_strength_bFLOAT1.000–1—
pose_strength_bFLOAT0.700–1—
target_face_bCOMBORightmostPerson in the preliminary prompt layout that receives identity B.
instantid_startFLOAT0.000–1Start of both InstantID identity attention and keypoint ControlNet guidance.
instantid_endFLOAT1.000–1End of both InstantID identity attention and keypoint ControlNet guidance.
instantid_modelCOMBO1 options:
controlnet_modelCOMBO1 options:
providerCOMBOCoreML4 options: CoreML, CPU, CUDA, ROCM
cfgFLOAT4.50–30—
noiseFLOAT0.750–1Noise applied to the unconditional InstantID face embedding. Higher values can strengthen identity transfer, especially without module 05. This does not control latent sampling noise.
conditioning_modeCOMBOInstantID referenceInstantID reference: encodes the prompts with the native checkpoint CLIP for the identity pass (current CMK default). CMK prepared: reuses the conditioning already prepared by module 10, including its CLIP settings.
reference_conditioning_weightFLOAT0.750–1Blend used by InstantID reference: 1.0 is pure native reference conditioning; 0.0 is pure CMK prepared conditioning. Ignored in CMK prepared mode.
reference_start_at_stepINT80–200Absolute sampling entry for the VAE-encoded reference latent. Higher steps preserve more reference composition; lower steps allow more redesign. Clamped below Total Steps and used only with InstantID + module 05.
VISUALoptCMK_VISUAL_PIPE—
LOG_BoptCMK_LOG_PIPE—
_cmk_content_guard_enabledoptBOOLEANtrue—

Outputs (7)

NameTypeDescription
MODELCMK_MODEL_PIPE—
PROCESSCMK_PROCESS_SDXL—
SAMPLEDCMK_SAMPLED_PIPE—
LOGCMK_LOG_PIPE—
IDENTITY IMAGEIMAGE—
VISUALCMK_VISUAL_PIPE—
diagnosticCMK_DIAGNOSTIC—