ComfyUI Node

sum_Ksampler

Sum_Ksampler

By cardenluo·Created 2 years ago·Updated 5 days ago· 327
sum_Ksampler
  • context
  • model
  • positive
  • negative
  • latent_stack
  • lowCpu
  • ksample_type
  • funtion
  • context
  • image
  • resample
seed0
denoise1.00
image_outputPreview

If the Apt_Preset context is a pipeline, sum_Ksampler is the destination. Everything upstream - loader, editor, LoRA, stack - spends its time stuffing values into the context, and this is the node that finally reads them out and actually runs the diffusion. It's the pack's sampler in the Loader → Controller → Sampler framework, and the good news is you barely have to touch it, because it inherits steps, CFG, sampler, and scheduler straight from the context you already built.

So what's left to set on the node itself? Seed, denoise, and how the output gets handled. That's a nicer surface than the stock KSampler, which makes you re-enter every sampling parameter every single time.

What it actually does

It pulls model, positive/negative conditioning, latent, VAE, steps, CFG, sampler, and scheduler from the context (each with a sensible fallback), runs common_ksampler, then VAE-decodes the result to an image. That part is one click of work. What makes it interesting are the two optional inputs that give you the pack's "special function" sampling:

  • ksample_type (KS_STACK) - a pre-configured sampling token from another pack node. The code handles two shapes: an 8-value bundle (add_noise, steps, cfg, sampler, scheduler, start/end step, leftover-noise flag) for advanced step control, and a 5-value bundle for the SamplerCustomAdvanced path with explicit noise, guider, and sigmas objects. This is how the pack's refine and upscale passes get wired in without spaghetti.
  • funtion (FUNTION) - two-mode special function: a 10-value two-stage sampler (sample to a mid step with one setup, then finish with a second - the classic secondary-sampling repair), or a 7-value dual-paint path (mask, smoothness, separate denoise for masked vs unmasked areas, plus an optional refine pass). This is the "secondary sampling repair and refine enlargement in one step" the README brags about.

The inputs that matter

  • seed - required, full 64-bit range. Standard.
  • denoise - 0 to 1. At 1.0, full generation; below that, a re-paint of whatever latent came in - your img2img / refine knob.
  • image_output - Hide, Preview, Save, or Hide/Save. Default Preview; Save embeds workflow metadata into the PNG.
  • latent_stack - optional, lets you sample over a stack of latents from the pack's latent tools.
  • lowCpu - optional VAEDecodeTiled token for tiled decoding when VRAM is tight.

The outputs that matter

context (updated with the result), image (the decoded output - wire this to a Save/Preview node), and resample (RESAMPLE), a bundle of model/conditioning/vae/steps/cfg/sampler/scheduler/CLIP/latent meant to be fed into a refinement pass. The resample output is the pack's answer to hires-fix: keep it, feed a second stage, get your upscale.

Installing it

cd ComfyUI/custom_nodes
git clone https://github.com/cardenluo/ComfyUI-Apt_Preset.git
cd ComfyUI-Apt_Preset
pip install -r requirements.txt   # Windows: double-click install.bat

Or ComfyUI Manager → ComfyUI-Apt_Preset.

Common issues

The most reported gotcha is expectation mismatch: this node is an output node, so people expect it to show images immediately - and it does, via the image_output setting. Set it to Hide and you'll see nothing and think it's broken. It's also easy to miss that image_output sits in the required list, since samplers rarely have an output-handling field. If your sampling settings don't seem to take effect, remember they come from the context: a value set on sum_load_simple beats anything you tweak in a downstream editor that you forgot to connect. Check the loader, not the sampler.

CategoryApt_Preset/chx_ksample

Inputs (11)

NameTypeDefaultDescription
contextRUN_CONTEXT
seedINT00–18446744073709550000
denoiseFLOAT1.000–1
image_outputCOMBOPreview4 options: Hide, Preview, Save, Hide/Save
modeloptMODEL
positiveoptCONDITIONING
negativeoptCONDITIONING
latent_stackoptLATENT_STACK
lowCpuoptVAEDecodeTiled
ksample_typeoptKS_STACK
funtionoptFUNTION

Outputs (3)

NameTypeDescription
contextRUN_CONTEXT
imageIMAGE
resampleRESAMPLE