CMK FaceProcess -Pipe-
Restore or re-detail the face, without the widgets you didn't ask for
- FACE
- opt_log
- VISUAL
- opt_diagnostic
- IMAGE PROCEED
- SELECTED FACE
- SEGS PROCESSED
- ENABLED
- LOG
- VISUAL
- diagnostic
CMK FaceProcess -Pipe- is the pack's face module in its modular form: it reads the image and the mode from a FACE pipe, and its UI only shows you the settings the current mode actually uses. If you've ever stared at a face node with 25 widgets and no idea which twelve are live, that's the problem it solves.
The two modes
process_mode is restore or detailer. They are genuinely different pipelines:
- restore runs a learned face-restoration network: detect faces, align them, run the enhancer, paste back with a soft edge, then blend by
restore_visibility. It's the GFPGAN/CodeFormer-style pass, and it needs those model files plusinsightfaceto find and align the faces. - detailer does the re-render loop - crop the face, upscale it to
detail_guide_size(capped atdetail_max_size), VAE-encode, sample it with a mask so only the face changes, decode, resize back down, paste. That's a diffusion pass per face, so the widget that matters most isdetail_denoise.
Everything after enable and select_face is optional from ComfyUI's point of view, and the CMK frontend extension shows or hides blocks based on the active mode. The inactive set of values is preserved internally and restored when you switch back, which is a small thing that matters a lot when you're A/B-ing modes.
The controls worth understanding
FACE- the prepared context pipe from CMK FaceProcess Prepare -Pipe-.enable- the local switch, on by default. It's AND-ed with the module-wideface_global_enablefrom the prepare node; either one off and the image passes through unchanged.select_face-Largest,Leftmost,Rightmost,Topmost,Bottommost,CenterorAll Faces. These seven presets are this node's face selection; the ReActor-style sort/filter/take controls you'll find on the toolbox node were deliberately dropped from the pipe contract, so presets are the whole interface here.refine_mode-Off,Detail,SharpenorSmooth, applied after the mode's work as a mask-limited pixel pass at a fixed strength.Offis the default, andOffis what you want while you're tuning anything else, because it will happily mask the changes you're trying to evaluate.- The detect block:
detect_bbox_threshold(0.5),detect_bbox_dilation,detect_crop_factor,detect_drop_size. Straight from the detector-wrapper vocabulary - threshold above which a box counts, how far to grow it, how much context around the box to keep. - The restore block:
restore_model(frommodels/facerestore_models),restore_visibility, and two inherited ReActor knobs,restore_facedetectionandrestore_codeformer_weight. Heads up on those two: the CMK restore adapter accepts them and then discards them - the face set always comes from InsightFace's detector, and the CodeFormer weight isn't passed through. Set them and nothing changes. - The detail block:
detail_guide_size(512),detail_guide_size_for(on = measure against the detected box, off = against the crop),detail_max_size(768),detail_noise_mask,detail_force_inpaint,detail_paste_feather(20), anddetail_denoise. detail_denoisedefault 80, range 50–100, and its tooltip says it all: "Sampling entry in percent. Later entry preserves the original face; earlier entry rebuilds it more strongly." It is not a denoise value. 80 becomes denoise 0.20 - a light touch. If you want a heavy rebuild, go down toward 50, which gives denoise 0.50.
Outputs: IMAGE PROCEED, SELECTED FACE (SEGS), SEGS PROCESSED (SEGS), ENABLED (a boolean telling you whether the pass actually ran), LOG, VISUAL and diagnostic. Wire ENABLED into downstream logic if you want a gate that respects "the face module was off"; wire VISUAL if you're using the pack's visualizer.
Install
Manager: search CMK Flow, install the CMKFlow entry, restart. Manually, from the folder holding main.py:
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, then restart. The dependency load is real and shared: insightface, onnxruntime, ultralytics, segment-anything, opencv-python, imageio-ffmpeg, nudenet==3.4.2. Model files are separate - restore networks under models/facerestore_models, detectors under models/ultralytics/bbox, SAM under models/sams:
python3 custom_nodes/cmk_nodes/scripts/check_cmk_resources.py --models-root "/path/to/shared/models"
Enable ComfyUI's Vue Nodes / Nodes 2.0 setting or the mode-dependent UI won't rebuild.
Issues worth knowing
If the module looks inert, check the two switches - enable here and face_global_enable on the prepare node - and then ENABLED on the output, which is the node's own answer to "did I do anything?"
If restore mode fails at run time, it's almost always insightface or its model pack missing. The library is MIT; the pretrained ONNX weights are not, so this is the path with a licensing footnote if you're selling output.
And if you're using the detailer mode to fix a face that's simply too small in frame, no denoise setting will save you. The detailer gives the region its own resolution budget; if the face is 60 pixels wide, raise detail_guide_size and accept the extra time, or generate the frame larger.
Inputs (24)
| Name | Type | Default | Description |
|---|---|---|---|
| FACE | CMK_FACE_PIPE | — | |
| enable | BOOLEAN | true | — |
| process_mode | COMBO | restore | 2 options: restore, detailer |
| select_face | COMBO | Largest | 7 options: Largest, Leftmost, Rightmost, Topmost, Bottommost, Center, +1 |
| refine_modeopt | COMBO | Off | 4 options: Off, Detail, Sharpen, Smooth |
| detect_modelopt | COMBO | none | 1 options: none |
| detect_bbox_thresholdopt | FLOAT | 0.500–1 | — |
| detect_bbox_dilationopt | INT | 0-512–512 | — |
| detect_crop_factoropt | FLOAT | 3.01–100 | — |
| detect_drop_sizeopt | INT | 101–8192 | — |
| restore_modelopt | COMBO | 1 options: none | |
| restore_facedetectionopt | COMBO | 4 options: retinaface_resnet50, retinaface_mobile0.25, YOLOv5l, YOLOv5n | |
| restore_visibilityopt | FLOAT | 1.000–1 | — |
| restore_codeformer_weightopt | FLOAT | 0.500–1 | — |
| detail_guide_sizeopt | FLOAT | 51264–8192 | — |
| detail_guide_size_foropt | BOOLEAN | true | — |
| detail_max_sizeopt | FLOAT | 76864–8192 | — |
| detail_denoiseopt | FLOAT | 8050–100 | Sampling entry in percent. Later entry preserves the original face; earlier entry rebuilds it more strongly. |
| detail_noise_maskopt | BOOLEAN | true | — |
| detail_force_inpaintopt | BOOLEAN | true | — |
| detail_paste_featheropt | INT | 200–200 | — |
| opt_logopt | CMK_LOG_PIPE | — | |
| VISUALopt | CMK_VISUAL_PIPE | — | |
| opt_diagnosticopt | CMK_DIAGNOSTIC | — |
Outputs (7)
| Name | Type | Description |
|---|---|---|
| IMAGE PROCEED | IMAGE | — |
| SELECTED FACE | SEGS | — |
| SEGS PROCESSED | SEGS | — |
| ENABLED | BOOLEAN | — |
| LOG | CMK_LOG_PIPE | — |
| VISUAL | CMK_VISUAL_PIPE | — |
| diagnostic | CMK_DIAGNOSTIC | — |