Nodes/CMK Flow/CMK Pipe Create Face Process
ComfyUI Node

CMK Pipe Create Face Process

The Face Restore Setting You Can't See (And Why That's Fine)

By CMKFlow·Created 3 months ago·Updated a day ago· 6
CMK Pipe Create Face Process
  • model
  • clip
  • vae
  • conditioning_pos
  • conditioning_neg
  • image
  • sam_model
  • face_pipe
◄seed0►
◄steps20►
◄cfg8.0►
◄sampler▾►
◄scheduler▾►

Compare a FaceDetailer node from Impact Pack with this one and you'll notice something missing. Impact Pack's FaceDetailer exposes the detector, the bbox threshold, dilation, crop factor, drop size, the restore model, visibility, codeformer weight, face selection, sorting, guide size, max size, feather. Two dozen widgets.

CMK Pipe Create Face Process exposes twelve inputs. And yet the default face_pipe it produces has all of those Impact Pack settings baked into it anyway - just not as widgets. The source is honest about why: "Runtime mode and detailed face parameters are intentionally not exposed in the Create node. They remain present in the face_pipe so CMK Face Process can execute safely."

What you actually set

Required: model, clip, vae, conditioning_pos, conditioning_neg, image, seed, steps (default 20, cap 10000), cfg (default 8.0), sampler, scheduler. Optional: sam_model (SAM_MODEL, forceInput).

That's it. A coherent job: this model, these prompts, this image, these sampling numbers.

What's underneath

The pipe carries sensible defaults the node chose for you: an Ultralytics face detector picked from whatever's in your ultralytics_bbox / ultralytics_segm folders, bbox threshold 0.5, crop factor 3.0, retinaface_resnet50 for restore face detection, restore visibility 1.0, codeformer weight 0.5, face selection all sorted by area, take the first one, guide size 512, max size 768, detail denoise 0.5, noise mask on, force inpaint on, paste feather 20.

Read the code and you'll see the detector default comes from _preferred_face_detector(), and the restore model defaults to the first entry in your facerestore_models folder if you have more than one. So the machine-dependent bits resolve at pipe-creation time from your install.

There's one genuinely interesting line: boolean_face_enable is hardcoded True with a comment explaining that "runtime enable is handled by CMK Face Process, not by the pipe. Keeping this True avoids dirtying upstream pipe branches when Face is toggled." Translation: they left the switch on downstream so that toggling a face pass doesn't invalidate the cache of everything feeding into it. That's a caching decision disguised as a boolean, and it's the kind of thing that only makes sense once you've watched a 40-node workflow re-run because you flipped one checkbox.

Outputs and consumers

One output, face_pipe (CMK_FACE_PIPE). Two things consume it:

  • The CMK FaceProcess module, which holds the actual runtime mode and detailed parameters.
  • CMK Pipe Peek Face Process, which unpacks it into a BASIC_PIPE tuple (model, clip, vae, pos cond, neg cond), the image, seed, steps, cfg, sampler, scheduler, the enable boolean, and the SAM model - the shape other nodes expect when you want to drop an Impact-Pack-style consumer at the end of a CMK pipe.

Standalone construction

The architecture doc keeps this open on purpose. Take CMK Checkpoint VAE Loader -Pipe- for MODEL, CMK Load Image -Pipe- (or CMK Image Load and Resize -Pipe-) for the image side, and build the face pass from there. The pipes "protect the Execute interfaces without preventing standalone use" - which is a nice way of saying the pack is opinionated without being a walled garden.

Install

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

git clone https://github.com/CMKFlow/cmk_nodes.git custom_nodes/cmk_nodes
python3 custom_nodes/cmk_nodes/scripts/install_cmk_requirements.py

CMK dependency check: OK or you've got a partial install. For face work you'll want face weights too: Ultralytics detectors, optionally a face-restore model and an InsightFace pack. Run scripts/check_cmk_resources.py --models-root /your/models to see exactly what's missing - each resource is listed FOUND or MISSING by the filename the shipped workflows actually use, so a half-populated folder doesn't fool it.

Worth knowing

A licensing note, if you're shipping anything. The detection path rides Ultralytics, which is AGPL-3.0 and reaches the runtime, not just your code. It's also the package behind the December 2024 poisoned-release cryptominer incident that reached ComfyUI users through a detailing pack. Pin your versions.

Face passes love to clone people. Every detected region re-renders from the same base seed, so a crowd can converge into a crowd of one person. Worth remembering before you leave a face pass on for a 200-image batch.

CategoryCMK/Developer/Legacy Pipe

Inputs (12)

NameTypeDefaultDescription
modelMODEL—
clipCLIP—
vaeVAE—
conditioning_posCONDITIONING—
conditioning_negCONDITIONING—
imageIMAGE—
seedINT00–18446744073709550000—
stepsINT201–10000—
cfgFLOAT8.00–100—
samplerCOMBO44 options: euler, euler_cfg_pp, euler_ancestral, euler_ancestral_cfg_pp, heun, heunpp2, +38
schedulerCOMBO9 options: simple, sgm_uniform, karras, exponential, ddim_uniform, beta, +3
sam_modeloptSAM_MODEL—

Outputs (1)

NameTypeDescription
face_pipeCMK_FACE_PIPE—