Nodes/CMK Flow/CMK Smart Detailer -Pipe-
ComfyUI Node

CMK Smart Detailer -Pipe-

Running three detail passes at once and only paying for the ones that changed

By CMKFlow·Created 3 months ago·Updated a day ago· 6
CMK Smart Detailer -Pipe-
  • DETAILER
  • opt_log
  • VISUAL
  • opt_diagnostic
  • SEGS DETECTED
  • SEGS PROCEED
  • IMAGE PROCEED
  • LOG
  • VISUAL
  • diagnostic
  • DETAILER IMAGE
◄enabletrue►
◄output_image_proceedtrue►
◄model_name▾►
◄bbox_threshold0.50►
◄bbox_dilation0►
◄crop_factor3.0►
◄drop_size10►
◄guide_size512►
◄guide_size_fortrue►
◄max_size768►
◄denoise80►
◄noise_masktrue►
◄force_inpainttrue►

CMK Smart Detailer -Pipe- is the same detect-crop-resample-paste loop as the standalone CMK Smart Detailer, reshaped for parallel use. You might run one instance on faces with a face detector and a face-aware prompt, a second on hands with a hand model, and a third on eyes at a different guide size - all fed from the same shared DETAILER context, then merged back into one image. That's the whole reason it exists, and the interesting engineering is in not re-rendering the branches you didn't touch.

The contract

Input is DETAILER, from CMK Detailer Prepare -Pipe-: an immutable shared working context carrying the model, vae, conditioning and source image, plus global enable. It's supplied to every instance in parallel rather than threaded through them serially, so instance two can't accidentally see instance one's results. Local settings (model_name, bbox_threshold, bbox_dilation, crop_factor, drop_size, guide_size, guide_size_for, max_size, denoise, noise_mask, force_inpaint) live on the instance and don't leak back.

Outputs: SEGS DETECTED, SEGS PROCEED, IMAGE PROCEED, LOG, VISUAL, diagnostic, and DETAILER IMAGE.

output_image_proceed controls whether IMAGE PROCEED actually carries the image - turn it off in a parallel setup and you save the transport without breaking anything, which is why the pack documents it as the intended choice for advanced modules. The optional opt_log and opt_diagnostic inputs are documentation-only: several instances can thread their logs through them, but neither influences a single pixel or the cache key.

The split is deliberate. SEGS PROCEED is what the merges consume - CMK's SEGS CONCAT composites each branch's segments over their own spatial support, so several detailers can contribute without fighting. IMAGE PROCEED is a convenience output for the single-instance case and can be left unwired in parallel ones. DETAILER IMAGE is the internal full result for preview and provider paths - it must not replace the merged output, because a boundary downstream is what publishes the authoritative image.

denoise is a percentage here, and that's the point

Everything matches the standalone node except denoise, which is a 50–100 sampling entry in percent, default 80, with the tooltip spelling out the semantics: later entry preserves the original content, earlier entry rebuilds it more strongly. It gets converted to a real denoise value internally and still passes through the central 0.5 cap - the pack made that limit a documented architecture rule after finding that the theoretical 0–1 range made fine control impossible and that values at 0.5 already amounted to a full reinterpretation of the detected area. So 80% ≈ 0.2 denoise, 65% ≈ 0.35. If you're used to typing 0.35 in Impact Pack's FaceDetailer, you want about 65 here.

enable is the local switch; the global one lives in the DETAILER pipe and the pack prints which of the two is off. Off means a true passthrough - detection skipped, detailing skipped, cache skipped, and the diagnostic says so.

Caching, and why your second parallel instance is fast

Each instance computes a cache key from the detailer context plus its own run settings and fingerprints its branch. If nothing in the dependency chain changed, the result comes back from the branch cache inside the same ComfyUI session, marked HIT. Change one branch's parameters and its merge and boundary update while its unmodified sibling still resolves from cache. The cache lives under ComfyUI/temp/cmk/, and a restart empties it - first run after a restart is always a MISS → STORED, which is expected, not a fault.

One source-level note that explains a lot: on a cached hit, ComfyUI's lazy execution deliberately doesn't materialise the shared DETAILER input, so the node resolves the cached result before validating that input rather than after. If you're writing tests against this node, don't assume the input is populated.

Installing

Manager: search CMK Flow → install → restart. Manual:

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

Detector weights go in models/ultralytics/bbox (or segm); the resource script can fetch them alongside SAM and InsightFace. Vue Nodes / Nodes 2.0 should be enabled.

Where it bites

Running two detailers over overlapping regions isn't magic - input order decides priority, and the later input wins where supports genuinely overlap. And the usual phrasing of the rule applies: this is for regions that are actually too small for the model to resolve. Detail a large, already-good face and you'll change it, not improve it.

CategoryCMK/Flow/PostProcess

Inputs (17)

NameTypeDefaultDescription
DETAILERCMK_DETAILER_PIPE—
enableBOOLEANtrue—
output_image_proceedBOOLEANtrue—
model_nameCOMBO0 options:
bbox_thresholdFLOAT0.500–1—
bbox_dilationINT0-512–512—
crop_factorFLOAT3.01–100—
drop_sizeINT101–8192—
guide_sizeFLOAT51264–8192—
guide_size_forBOOLEANtrue—
max_sizeFLOAT76864–8192—
denoiseFLOAT8050–100Sampling entry in percent. Later entry preserves the original content; earlier entry rebuilds it more strongly.
noise_maskBOOLEANtrue—
force_inpaintBOOLEANtrue—
opt_logoptCMK_LOG_PIPE—
VISUALoptCMK_VISUAL_PIPE—
opt_diagnosticoptCMK_DIAGNOSTIC—

Outputs (7)

NameTypeDescription
SEGS DETECTEDSEGS—
SEGS PROCEEDSEGS—
IMAGE PROCEEDIMAGE—
LOGCMK_LOG_PIPE—
VISUALCMK_VISUAL_PIPE—
diagnosticCMK_DIAGNOSTIC—
DETAILER IMAGEIMAGE—