Nodes/CMK Flow/CMK SEGS CONCAT
ComfyUI Node

CMK SEGS CONCAT

Merging three detail branches without turning your image into confetti

By CMKFlow·Created 3 months ago·Updated a day ago· 6
CMK SEGS CONCAT
  • image
  • segs
  • segs_2
  • segs_3
  • segs_4
  • segs_5
  • segs_6
  • segs_7
  • segs_8
  • segs_9
  • segs_10
  • segs_11
  • segs_12
  • segs_13
  • segs_14
  • segs_15
  • segs_16
  • segs_17
  • segs_18
  • segs_19
  • segs_20
  • segs_21
  • segs_22
  • segs_23
  • segs_24
  • segs_25
  • segs_26
  • segs_27
  • segs_28
  • segs_29
  • segs_30
  • segs_31
  • segs_32
  • VISUAL
  • IMAGE
  • VISUAL
◄feather5►
◄alpha255►

CMK SEGS CONCAT takes one authoritative image plus up to 32 SEGS collections and gives you back a single composited image. If you've ever run two FaceDetailer passes over the same picture and watched source and processed pixels interleave into a salt-and-pepper mess, this node exists specifically to prevent that, and it says so in the pack's own notes.

Two kinds of input, two strategies

The interesting part is that it detects what it's been handed.

Ordinary SEGS - Impact Pack's container, or anything shaped like it - get native sequential paste semantics. In plain terms: each segment already identifies its own contribution, so paste it into place as-is. The pack is emphatic that a pixel-difference mask is the wrong tool here, because comparing source and result pixelwise is exactly what interleaves them into a speckled mess.

CMK stable branches - the ones produced inside this pack's parallel detailer, FaceProcess and FaceSwap modules - come with three things: a precomposed branch image, a spatial support mask covering only the SEG crop regions that branch actually processed, and a source signature. The branch image is copied in only inside that support. Everything outside stays as the authoritative image. If the branch's stored signature doesn't match the image you're merging onto, you get a loud runtime error - "the branch cache must be recomputed" - rather than a silently wrong composite. That's a cache-integrity check, and it's the kind of failure you want to be loud.

Where two genuinely processed branches overlap, input order is priority and the later input wins. Unchanged sibling segments don't overwrite anything.

Inputs: image (the authoritative full image), segs (required), feather (5) and alpha (255) - both advanced, and they tune the soft-mask edge and opacity used when pasting. Then segs_2 through segs_32, all optional. There's also an optional VISUAL.

Outputs: IMAGE and VISUAL. The node inspects its upstream wiring to work out whether it's merging a Detailer, FaceProcess or FaceSwap family, and registers itself with the visualizer under the right label and sequence so the before/after pair lands in the correct module register. If no branch has actual content, the authoritative image passes through untouched.

Installing

Manager: search CMK Flow → install the CMKFlow entry → restart. Manually:

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

You don't need Impact Pack to use this node - it reads and writes the SEGS container format but ships its own pasteback engine. Bringing your own SEGS from Impact Pack works fine; the paste path just switches to sequential. Enable Vue Nodes / Nodes 2.0, which CMK requires.

Practical notes

Every input has to be valid SEGS or the node raises, naming which slot failed - so a None is fine (skipped), but a malformed tuple isn't.

The pack's architecture notes make one rule explicit that's worth repeating here: this node only ever composites complete branch images over their real crop support. There is no per-pixel blending of source and result, on purpose. If you're merging SEGS from an arbitrary third-party pipeline and getting speckle anyway, the SEGS probably carry a branch artefact this node can't interpret - feed the raw detector SEGS instead of a post-processed collection.

And the honest framing from the wider detailing discussion: three parallel detailers only beat one if they're doing genuinely different work - faces, hands, eyes with different detectors and prompts. Run three passes over the same region and you'll spend three times the time rearranging the same pixels.

CategoryCMK/Toolbox/Mask & SEGS

Inputs (36)

NameTypeDefaultDescription
imageIMAGE—
segsSEGS—
featherINT50–100—
alphaINT2550–255—
segs_2optSEGS—
segs_3optSEGS—
segs_4optSEGS—
segs_5optSEGS—
segs_6optSEGS—
segs_7optSEGS—
segs_8optSEGS—
segs_9optSEGS—
segs_10optSEGS—
segs_11optSEGS—
segs_12optSEGS—
segs_13optSEGS—
segs_14optSEGS—
segs_15optSEGS—
segs_16optSEGS—
segs_17optSEGS—
segs_18optSEGS—
segs_19optSEGS—
segs_20optSEGS—
segs_21optSEGS—
segs_22optSEGS—
segs_23optSEGS—
segs_24optSEGS—
segs_25optSEGS—
segs_26optSEGS—
segs_27optSEGS—
segs_28optSEGS—
segs_29optSEGS—
segs_30optSEGS—
segs_31optSEGS—
segs_32optSEGS—
VISUALoptCMK_VISUAL_PIPE—

Outputs (2)

NameTypeDescription
IMAGEIMAGE—
VISUALCMK_VISUAL_PIPE—