CMK Pipe Peek Preprocess Face
Building a Face Pass From Scratch, With CMK's State
- pipe
- image
- model
- clip
- vae
- opt_seed
- opt_prompt_pos
- opt_prompt_neg
- opt_active_loras
- opt_lora_stack
Faces are the one thing in ComfyUI that everybody admits look broken at small sizes. An 80-pixel face in a 1024-pixel frame gets 80 pixels of model attention and comes out a smear, no matter how good the checkpoint is. The fix is a dedicated pass - and the fix is finicky, which is why face node packs keep multiplying.
CMK Pipe Peek Preprocess Face is CMK's contribution to the finicky part: it reads a CMK_PIPE mid-flow and hands you the raw materials a face pass needs.
Outputs
Validated, always present: image (IMAGE), model (MODEL), clip (CLIP), vae (VAE).
Optional, may be empty: opt_seed (INT), opt_prompt_pos (STRING), opt_prompt_neg (STRING), opt_active_loras (STRING), opt_lora_stack (LORA_STACK).
Identical to CMK Pipe Peek Preprocess Detailer, right down to the socket names. The two differ in exactly one thing: which image they pick.
The one difference that matters
Honestly? In the shipped source the two image selectors are identical - image_detailer → image_refiner → image_1st_pass → image → image_original in both. The face peek exists as its own node for naming and intent, not because it picks a different frame.
The intent does matter, though. This node is one of the taps into CMK's PostProcess zone - the family-neutral region the README places after the PostProcess Boundary, where FaceRebuild, FaceSwap, FaceProcess, Detailer and MaskDetailer all live. So it's the right node to reach for when you want the current best image on the way into a face stage, not the raw sample.
Which lands on the ordering rule that keeps coming up in auto-detailing: detail at native resolution first, upscale after. Upscaling first bakes the mangled face into four times as many pixels and then costs four times as much to repair.
The contract check
It builds a contract dict and requires ["image", "model", "clip", "vae"], raising a named error if any is missing. seed and the prompt strings read with safe defaults, lora_stack may be None.
That check is doing more work than it looks like. Face passes are usually inserted late in a graph, where a missing clip might not surface until a CLIPTextEncode three nodes downstream - with an error that names the encoder rather than your pipe. Failing at the poke is better.
What you'd do with it
Run an identity-preserving face pass using your own nodes. The model stack from a CMK checkpoint loader, the prompts from the flow, the image from wherever the flow is - and then whatever face machinery you trust, whether that's a restore model, a detailer, or an identity adapter. CMK deliberately keeps the model stack here as plain MODEL/CLIP/VAE, which is what those consumers want. Note the split of concerns, though: this gives you a cleaner face. Sameness of face across images is a different toolset - IP-Adapter, InstantID, PuLID - and CMK ships InstantID modules separately for its SDXL path.
Bypass CMK's face module without leaving CMK's flow. The FaceProcess module packs a lot of behaviour into a small surface - runtime modes, restore versus detailer parameter sets, a UI that swaps parameter groups based on PROCESS MODE. If you want the flow's state and none of that interface, peek instead of plugging in.
Diagnose a face pass that isn't firing. Nine outputs tells you fast whether the model stack ever arrived.
Install
Part of CMKFlow/cmk_nodes. ComfyUI Manager → search CMK Flow → install the CMKFlow entry → restart. Manual, ComfyUI fully shut down:
git clone https://github.com/CMKFlow/cmk_nodes.git custom_nodes/cmk_nodes
python3 custom_nodes/cmk_nodes/scripts/install_cmk_requirements.py
Wait for CMK dependency check: OK. For actual face work you also need weights - Ultralytics detectors, optionally InsightFace models or a face-restore checkpoint. scripts/check_cmk_resources.py --models-root /your/shared/models checks against the exact filenames the shipped workflows reference, so it's a much better answer than "my models folder has stuff in it."
Traps
No SAM model output. Unlike the face pipe peek, this one doesn't surface a SAM_MODEL - because a plain CMK_PIPE isn't carrying one. If your face pass needs SAM, get it from CMK Pipe Peek Face Process or wire it directly.
opt_ really does mean "maybe nothing." Don't assume opt_prompt_pos has content. A flow that never set a global prompt passes an empty string, and a face pass with no prompt re-renders the crop on the model's priors alone - which is a legitimate look, but not usually the one you wanted.
The generic caveat for any face pass: every detected region tends to re-render from the same base seed, so a crowd drifts toward looking like one person. If you're detailing a group, vary seeds or expect clones.
Inputs (1)
| Name | Type | Default | Description |
|---|---|---|---|
| pipe | CMK_PIPE | — |
Outputs (9)
| Name | Type | Description |
|---|---|---|
| image | IMAGE | — |
| model | MODEL | — |
| clip | CLIP | — |
| vae | VAE | — |
| opt_seed | INT | — |
| opt_prompt_pos | STRING | — |
| opt_prompt_neg | STRING | — |
| opt_active_loras | STRING | — |
| opt_lora_stack | LORA_STACK | — |