Nodes/CMK Flow/CMK InstantID Sampler SDXL -Pipe-
ComfyUI Node

CMK InstantID Sampler SDXL -Pipe-

Identity injection without leaving the pipe

By CMKFlow·Created 3 months ago·Updated a day ago· 6
CMK InstantID Sampler SDXL -Pipe-
  • MODEL
  • PROCESS
  • SAMPLED
  • LOG
  • source_face
  • VISUAL
  • MODEL
  • PROCESS
  • SAMPLED
  • LOG
  • IDENTITY IMAGE
  • VISUAL
  • diagnostic
◄identity_strength1.00►
◄pose_strength0.70►
◄target_faceLargest►
◄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►

Module 15 in the CMK flow: it takes the layout you already sampled, applies InstantID identity to it, and hands back a still-unsampled SAMPLED pipe for the refiner. It's the pack's whole InstantID implementation, and it's the difference between "InstantID as a side-quest with its own noodles" and "InstantID as a step in the queue."

It's also the module where the pipe architecture earns its keep, because InstantID needs things a plain KSampler chain doesn't want to carry: a face analysis model, ArcFace identity embeddings, a keypoint ControlNet, and its own conditioning pass.

How it's structured

Three types travel through: MODEL (CMK_MODEL_PIPE), PROCESS (CMK_PROCESS_SDXL) and SAMPLED (CMK_SAMPLED_PIPE), plus LOG. The proprietary SAMPLED type is what the README means about keeping the SDXL sampler, InstantID and refiner stages as one latents-carrying handoff instead of bouncing through IMAGE.

IDENTITY IMAGE is the output people miss - it's the keypoint visualization that InstantID's ControlNet conditions on. Useful for confirming the face detector locked onto the person you thought it did.

The settings that decide whether it looks like your reference

  • identity_strength (1.0) and pose_strength (0.7). Identity is the ArcFace embedding's pull; pose is the keypoint ControlNet's grip. Take pose to 0 and the head pose stops being constrained, which is either the fix or the problem, depending on your shot.
  • target_face - Largest (default) / Leftmost / Rightmost / Topmost / Bottommost / Center. Tooltip: "Selects which detected person receives the InstantID identity." Only one person per InstantID pass, so a group shot needs the Advanced FaceRebuild slots or several passes.
  • instantid_start / instantid_end (0.0 → 1.0) - a single interval controlling both the identity attention and the keypoint ControlNet. Most people set the start late (~0.2–0.3) so composition is already decided before the face gets pushed around.
  • noise (0.75) - how much noise goes onto the unconditional face embedding. The tooltip notes higher values can strengthen identity transfer, especially without module 05 (ControlNet). It's not latent noise; don't confuse it with a denoise setting.
  • cfg (4.5), and provider - which defaults to CoreML, which is an odd default on a CUDA box.
  • conditioning_mode - InstantID reference (the default) encodes the prompt with the checkpoint's native CLIP for the identity pass; CMK prepared reuses whatever module 10 already encoded, clip_skip and all.
  • reference_conditioning_weight (0.75) - the blend between the two. 1.0 is pure native reference, 0.0 is pure CMK-prepared. Ignored entirely in CMK prepared mode.
  • reference_start_at_step (8) - where the VAE-encoded reference latent enters. Lower lets the reference sit under more redesign; higher preserves more of the reference composition. It's clamped below total steps and only does anything with InstantID and module 05 present.

The bit that surprises people

Module 15 samples. The SAMPLED pipe that arrives from module 10 isn't necessarily the thing that gets finished here, and the KSampler execute node knows it: when the pipe is flagged as an InstantID reference-latent pass, CMK KSampler -Pipe- deliberately bypasses itself and logs "InstantID reference latent is encoded and sampled in module 15." Same for the case where instantid_end_at_step is 0. Read the log before assuming a sampler is broken - the pipeline is telling you it skipped on purpose.

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: CMK Flow (cmk-flow) → install → restart. Requirements are heavy - insightface, onnxruntime, ultralytics, segment-anything, nudenet==3.4.2, opencv-python - and imageio-ffmpeg for the video side.

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

That gets you the InstantID adapter and ControlNet. The face analysis model is the fiddly one: InstantID's vendored FaceAnalysis loads antelopev2 from models/insightface, and antelopev2 is a manual download - buffalo_l isn't a substitute even though the detection dropdown will happily use it.

Finally: InstantID is SDXL-only and its reference repo has been dormant since 2024. If you're on SDXL, Illustrious or Pony it still works and still works well. On Flux, PuLID is where this job went. And the weights are research-only while the code is Apache - the permissive headline doesn't survive contact with what you download.

CategoryCMK/Flow/Face

Inputs (20)

NameTypeDefaultDescription
MODELCMK_MODEL_PIPE—
PROCESSCMK_PROCESS_SDXL—
SAMPLEDCMK_SAMPLED_PIPE—
LOGCMK_LOG_PIPE—
source_faceIMAGE—
identity_strengthFLOAT1.000–1—
pose_strengthFLOAT0.700–1—
target_faceCOMBOLargestSelects which detected person receives the InstantID identity.
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—
_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—