CMK Flow · InstantID Face Rebuild · Pasteback
The pipe version, with a real bypass
- MODEL
- PROCESS
- IMAGE
- LOG
- TARGET ORIGINAL
- PASTEBACK MASK
- REBUILD CONTEXT
- MODEL
- PROCESS
- IMAGE
- LOG
- diagnostic
Same job as the discrete CMK InstantID Face Rebuild · Pasteback, but shaped for a CMK pipe: it carries MODEL, PROCESS and LOG through so nothing in the flow gets orphaned, and - the part that actually matters day to day - it has a genuine bypass.
Why a bypass is the feature
CMK splits its nodes into two families, and the README is explicit about it: -Pipe- nodes are the closed, guided ecosystem; everything else is the open toolbox. In the guided ecosystem you're expected to be able to switch a module off inside the data, not by bypassing nodes on the canvas and hoping nothing downstream breaks.
So this node checks PROCESS["face_rebuild_enabled"] first. If it's off, it doesn't run the composite at all: it logs Pasteback : BYPASSED, Target : pixel-exact passthrough, and returns the TARGET ORIGINAL unchanged, with a diagnostic you can still preview. No resample, no VAE round-trip, no mask apply. That's why it takes TARGET ORIGINAL as a separate input from IMAGE in the first place.
Wiring
Inputs: MODEL, PROCESS, IMAGE (the rebuilt ROI coming back from the detailer), LOG, TARGET ORIGINAL, PASTEBACK MASK, REBUILD CONTEXT, PASTEBACK NECK.
Outputs: MODEL, PROCESS, IMAGE, LOG, diagnostic - an unbroken pipe.
When it does run, the behaviour is the same as its discrete sibling: it rebuilds the mask from the context geometry rather than trusting the incoming mask, applies it only inside the ROI, and verifies that every pixel outside the mask came back identical (Outside Unchanged : PASS/FAIL in the log). The only knob is PASTEBACK NECK, which is off by default and, per its tooltip, exists so the generated neck ellipse can be included without resampling the rebuilt ROI.
Install
One install covers the whole pack:
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
Or via the Manager: search CMK Flow (registry package cmk-flow, publisher CMKFlow), install, restart ComfyUI. Manual clones don't run pip - that second command is what installs insightface, onnxruntime, ultralytics, segment-anything, nudenet and opencv-python, and it finishes with a CMK dependency check: OK you should wait for.
CMK was verified against ComfyUI 0.38.2 with frontend 1.53.6 and wants Vue Nodes / Nodes 2.0 turned on. It also has a resource checker for model files, which is a genuinely nice touch given how many face models this chain touches:
python3 custom_nodes/cmk_nodes/scripts/check_cmk_resources.py --models-root "/path/to/ComfyUI-Shared"
That script prints FOUND/MISSING per resource and can fetch the ones with a clear public source. If you installed via Manager, it lives at custom_nodes/cmk-flow/scripts/check_cmk_resources.py.
Traps
The pairing is rigid. REBUILD CONTEXT must come from the matching prepare node - hand it a context from a different image and the ROI coordinates point at the wrong place. Both nodes validate the type and the batch must be exactly 1, but neither can know the context describes this frame.
And if a node further down complains that your image is missing rather than wrong, check whether FaceRebuild was toggled off upstream: Prepare propagates that flag into the process pipe, and this node will hand you the target pixels untouched while logging a bypass. That's working as designed - the pipeline tells you what it did in the LOG pipe, which is the whole reason CMK threads a log through every module instead of relying on console noise.
Inputs (8)
| Name | Type | Default | Description |
|---|---|---|---|
| MODEL | CMK_MODEL_PIPE | — | |
| PROCESS | CMK_RESULT_PROCESS | — | |
| IMAGE | IMAGE | — | |
| LOG | CMK_LOG_PIPE | — | |
| TARGET ORIGINAL | IMAGE | — | |
| PASTEBACK MASK | MASK | — | |
| REBUILD CONTEXT | CMK_FACE_REBUILD | — | |
| PASTEBACK NECK | BOOLEAN | false | Include the generated neck ellipse in final pasteback without resampling the rebuilt ROI. |
Outputs (5)
| Name | Type | Description |
|---|---|---|
| MODEL | CMK_MODEL_PIPE | — |
| PROCESS | CMK_RESULT_PROCESS | — |
| IMAGE | IMAGE | — |
| LOG | CMK_LOG_PIPE | — |
| diagnostic | CMK_DIAGNOSTIC | — |