Builder Sampler
A KSampler with CFG curves that fall, and a self-correction polish pass
- model
- positive
- negative
- vae
- latent_image
- latent
- preview_image
A sampler is a sampler, right? Mostly. Builder Sampler (MEC) is a KSampler with one genuinely useful twist: the CFG scale doesn't have to sit flat. You can schedule it - start high to lock in structure, ease it down as the image forms - plus opt into a 2-step self-correction polish pass at the end. It's the pack's "finish the image" sampler, built to sit at the end of the paint pipeline.
The scheduling idea isn't new (CFG ramp is an old trick, and the KB's troubleshooting doc will happily tell you that too-high CFG late in sampling is how you get oversaturated, burned-out images), but most ComfyUI users never set it because it takes a custom sampler to do it. This node puts it behind a dropdown.
How it works
It's ComfyUI's own comfy.samplers.sample_custom under the hood - the docstring is explicit that it honors your sampler_name/scheduler exactly like the built-in KSampler; it only overrides cond_scale per step. The inputs are the KSampler set you know - model, positive, negative, steps, cfg, sampler_name (44 options), scheduler, denoise, seed - plus the extras:
cfg_mode-Constant(default, behaves like normal KSampler),Linear, orEase Down.cfg_finish- where CFG ends up at the last step (used by Linear and Ease Down). Default 4.cfg_pivot- the knee for Ease Down. Default 5.self_correction- runs a 2-step polish pass after the main sampling. Costs a couple of extra steps, can clean up residual noise artifacts.resolution_preset-SDXL (1024x1024),SD1.5 (512x512), orCustomwithcustom_width/custom_height. It just sizes the empty latent when none is supplied.
Outputs: latent (with polish pass applied if enabled) and preview_image - a VAE-decoded preview if you wire a vae; zero image otherwise. Note the latent_image input for img2img: omit it and an empty latent is created at the preset resolution.
The judgment call
For most people, leave cfg_mode at Constant - a plain KSampler clone - and let the pack's FaceFixer/ToneRefiner do the detail work. Where Ease Down earns its keep: high-CFG prompting where the late steps keep over-saturating. Start at cfg 8, cfg_finish 4, cfg_mode Ease Down, and see if the colors stop blowing out. It's not a magic quality dial; it's a specific tool for a specific failure.
Install
cd ComfyUI/custom_nodes
git clone https://github.com/Code2Collapse/ComfyUI-CustomNodePacks.git
pip install opencv-python>=4.7.0 scipy>=1.10.0
or ComfyUI Manager → search "CustomNodePacks", restart, confirm [MEC] Loaded .... No extra dependencies - it's a wrapper over ComfyUI core's sampler. If preview_image is black, you didn't wire a VAE, and that's expected behavior, not a bug.
Inputs (18)
| Name | Type | Default | Description |
|---|---|---|---|
| model | MODEL | Diffusion model to sample with. | |
| positive | CONDITIONING | Positive conditioning. | |
| negative | CONDITIONING | Negative conditioning. | |
| steps | INT | 201–200 | Number of sampling steps. |
| cfg | FLOAT | 8.00–30 | Starting CFG scale (also constant CFG when cfg_mode is Constant). |
| sampler_name | COMBO | Sampler algorithm. | |
| scheduler | COMBO | Sigma schedule. | |
| denoise | FLOAT | 1.000–1 | Denoise strength (1.0 = full sampling, lower = partial img2img). |
| cfg_mode | COMBO | Constant | Adaptive CFG curve shape across steps. |
| cfg_finish | FLOAT | 4.00–30 | Final CFG value at the end of the schedule (used by Linear / Ease Down). |
| cfg_pivot | FLOAT | 5.00–30 | Pivot CFG value used by Ease Down to control the curve knee. |
| self_correction | BOOLEAN | false | Run a 2-step polish pass after the main sampling. |
| resolution_preset | COMBO | SD1.5 (512x512) | Preset resolution; choose Custom to use custom_width/custom_height. |
| custom_width | INT | 51264–4096 | Custom output width in pixels (used when preset is Custom). |
| custom_height | INT | 51264–4096 | Custom output height in pixels (used when preset is Custom). |
| seed | INT | 00–18446744073709550000 | Random seed. |
| vaeopt | VAE | Optional VAE; when provided, decodes the latent into preview_image. | |
| latent_imageopt | LATENT | Optional input latent (img2img). When omitted, an empty latent is created. |
Outputs (2)
| Name | Type | Description |
|---|---|---|
| latent | LATENT | Sampled latent (with optional polish pass applied). |
| preview_image | IMAGE | VAE-decoded preview image when a VAE is provided (zero image otherwise). |