CMK Sampler Prepare SDXL -Pipe-
The SDXL first pass, minus the twelve wires you'd normally forget
- MODEL
- PROCESS
- IMAGE
- LOG
- SAMPLER
- LOG
- diagnostic
CMK Sampler Prepare SDXL -Pipe- is the module-10 workhorse: everything that has to happen before a KSampler fires, bundled into one node whose only output is a SAMPLER pipe. Clip skip, LoRA, FreeU, PAG, the sampling mode, the seed, the empty latent or the inpaint latent, the Fooocus inpaint patch - if you've built this by hand in stock ComfyUI, you know it's a dozen nodes and two of them are always wired backwards.
The division of labour
The key design choice is that this node only prepares. CMK KSampler -Pipe- takes SAMPLER and nothing else, so an unprepared PROCESS physically cannot be plugged into a sampler, and the expensive compute node doesn't have to carry PROCESS, IMAGE or LOG across its surface. The result comes back as SAMPLED - a first-pass latent with its context - which is what the refiner needs, since a refiner works on the latent, not a decoded image.
Inside, the SDXL conditioning is encoded at the process's own width/height and size-conditioning factor, the clip is run through last-layer selection (stop_at_clip_layer, default -2), LoRA is applied, then PAG and the sampling mode (eps / v_prediction / lcm) are patched onto the model, and FreeU_V2 is applied when enabled (b1 1.3, b2 1.4, s1 0.9, s2 0.2 by default). Two complete branches - a normal empty-latent generation and an inpaint state - are built, and only the active one is chosen.
What you actually set, and what you should leave alone
MODEL,PROCESS,IMAGE, and optionallyLOG.MODELis read-only; the process is copied into an isolated working pipe.seed,steps_1st_pass(20),cfg(5.0),sampler(euler_ancestral),scheduler(karras). The everyday knobs.lora_name/strength_model/strength_clipfor one local LoRA, or leave it to the process's LoRA stack.- The inpaint block, if you're inpainting:
denoise,inpaint_noise_mask,context_reference_enabled/_expand/_blur, and the Fooocus resourcesfooocus_patchandfooocus_head. In the guided modes chosen back in01 START HEREmost of these are set for you -replace,removeandextendall forcedenoiseto 1.00 with noise mask on and pick their own fill and context-reference settings. In text-to-image the inpaint values are deliberately ignored so a stale saved workflow can't weaken a normal generation. replace_spatial_strength,remove_blend_radius,remove_mask_expand, and the two InstantID handoff steps - all tooltipped, all advanced, all worth leaving as shipped until you have a specific complaint.
Outputs: SAMPLER, LOG, diagnostic.
Installing
Manager: search CMK Flow, install the CMKFlow entry, 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
python3 cmk_nodes/scripts/check_cmk_resources.py --models-root "/path/to/shared/models"
The resource audit is worth running even if you only want text-to-image: it reports each expected file as FOUND or MISSING with the module that needs it, and can fetch the ones with a verified public source. Fooocus inpaint head and patch, SAM and Ultralytics detectors, InsightFace buffalo_l, GFPGAN and RealESRGAN are all in that list.
Traps
sampling is the sampling mode, not the sampler, and it defaults to lcm. If you're not running an LCM or LCM-LoRA-augmented SDXL, that's the first thing I'd look at when output looks soft - the neighbouring sampler dropdown is a different setting entirely, and the two get confused constantly.
Second: LoRAs come from two places. If the process carries a LoRA stack, this node applies it; a local lora_name sits on top. Stacking an unquantised SDXL LoRA after an LCM mode is a classic cause of blown contrast, and the log block will tell you exactly what was loaded - read it before you go changing cfg.
Third, the boring one: CMK needs the Vue Nodes / Nodes 2.0 frontend setting enabled. It's an unusual requirement in 2026, when most of the ecosystem is still working around that frontend rather than requiring it, but the dynamic dropdowns and node sizing here assume it.
Inputs (31)
| Name | Type | Default | Description |
|---|---|---|---|
| MODEL | CMK_MODEL_PIPE | — | |
| PROCESS | CMK_PROCESS_SDXL | — | |
| IMAGE | IMAGE | — | |
| stop_at_clip_layer | INT | -2-24–0 | — |
| fooocus_patch | STRING | inpaint_v25.fooocus.patch | — |
| fooocus_head | STRING | fooocus_inpaint_head.pth | — |
| lora_name | COMBO | None | 1 options: None |
| strength_model | FLOAT | 1.00-20–20 | — |
| strength_clip | FLOAT | 1.00-20–20 | — |
| freeu_enabled | BOOLEAN | true | — |
| freeu_b1 | FLOAT | 1.300–10 | — |
| freeu_b2 | FLOAT | 1.400–10 | — |
| freeu_s1 | FLOAT | 0.900–10 | — |
| freeu_s2 | FLOAT | 0.200–10 | — |
| steps_1st_pass | INT | 201–200 | — |
| cfg | FLOAT | 5.00–30 | — |
| sampler | COMBO | euler_ancestral | 44 options: euler, euler_cfg_pp, euler_ancestral, euler_ancestral_cfg_pp, heun, heunpp2, +38 |
| sampling | COMBO | lcm | 3 options: eps, v_prediction, lcm |
| zsnr | BOOLEAN | false | — |
| pag_scale | FLOAT | 2.500–20 | — |
| scheduler | COMBO | karras | 9 options: simple, sgm_uniform, karras, exponential, ddim_uniform, beta, +3 |
| seed | INT | 15653043660–18446744073709550000 | — |
| denoise | FLOAT | 1.000–1 | — |
| inpaint_noise_mask | BOOLEAN | false | — |
| context_reference_enabled | BOOLEAN | true | — |
| context_reference_expand | INT | 3-64–64 | — |
| context_reference_blur | FLOAT | 5.00–64 | — |
| replace_spatial_strength | FLOAT | 0.350–1 | Replace Object only. 0 gives the prompt maximum freedom; 1 gives Fooocus maximum spatial/reconstruction guidance. |
| remove_blend_radius | FLOAT | 240–64 | Remove Object only. Softens the sampler mask edge to blend colour and brightness into adjacent original surfaces. |
| remove_mask_expand | INT | 120–64 | Remove Object only. Expands the fully generated mask core outward before the soft colour transition is added. |
| LOGopt | CMK_LOG_PIPE | — |
Outputs (3)
| Name | Type | Description |
|---|---|---|
| SAMPLER | CMK_SAMPLER_PIPE | — |
| LOG | CMK_LOG_PIPE | — |
| diagnostic | CMK_DIAGNOSTIC | — |