ComfyUI Node

Builder Sampler

A KSampler with CFG curves that fall, and a self-correction polish pass

By Code2Collapse·Created 6 months ago·Updated a day ago· 52
Builder Sampler
  • model
  • positive
  • negative
  • vae
  • latent_image
  • latent
  • preview_image
steps20
cfg8.0
sampler_name
scheduler
denoise1.00
cfg_modeConstant
cfg_finish4.0
cfg_pivot5.0
self_correctionfalse
resolution_presetSD1.5 (512x512)
custom_width512
custom_height512
seed0

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, or Ease 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), or Custom with custom_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.

CategoryC2C/Paint

Inputs (18)

NameTypeDefaultDescription
modelMODELDiffusion model to sample with.
positiveCONDITIONINGPositive conditioning.
negativeCONDITIONINGNegative conditioning.
stepsINT201–200Number of sampling steps.
cfgFLOAT8.00–30Starting CFG scale (also constant CFG when cfg_mode is Constant).
sampler_nameCOMBOSampler algorithm.
schedulerCOMBOSigma schedule.
denoiseFLOAT1.000–1Denoise strength (1.0 = full sampling, lower = partial img2img).
cfg_modeCOMBOConstantAdaptive CFG curve shape across steps.
cfg_finishFLOAT4.00–30Final CFG value at the end of the schedule (used by Linear / Ease Down).
cfg_pivotFLOAT5.00–30Pivot CFG value used by Ease Down to control the curve knee.
self_correctionBOOLEANfalseRun a 2-step polish pass after the main sampling.
resolution_presetCOMBOSD1.5 (512x512)Preset resolution; choose Custom to use custom_width/custom_height.
custom_widthINT51264–4096Custom output width in pixels (used when preset is Custom).
custom_heightINT51264–4096Custom output height in pixels (used when preset is Custom).
seedINT00–18446744073709550000Random seed.
vaeoptVAEOptional VAE; when provided, decodes the latent into preview_image.
latent_imageoptLATENTOptional input latent (img2img). When omitted, an empty latent is created.

Outputs (2)

NameTypeDescription
latentLATENTSampled latent (with optional polish pass applied).
preview_imageIMAGEVAE-decoded preview image when a VAE is provided (zero image otherwise).