đź’€Prepack Ksampler Advanced
The advanced sampler that hands back a latent — a faithful KSamplerAdvanced, repackaged
- model
- positive
- negative
- latent_image
- LATENT
ComfyUI's native KSamplerAdvanced is the sampler you use when you want control over which part of the denoising process runs - and this node is a drop-in copy of it with the Prepack label. The pack's sibling đź’€Prepack Ksampler samples and decodes to an image in one node; this one deliberately does the opposite, returning the raw latent so you can chain passes, cut steps, or hand the half-denoised result to something else. Its own description says it plainly: "returns latent instead of decoded image, matching native behavior exactly."
If you're new, the honest framing is: don't start here. Start with the plain Prepack Ksampler or the native KSampler. Reach for this node when you actually need advanced step control, which is a "level two" workflow skill.
How it works
This is about as faithful as a reimplementation gets - the source file's comment literally says the implementation is a complete copy of ComfyUI's native advanced sampler (完全照抄), and reading it confirms it: it delegates to the same comfy.sample.sample call the built-in node uses. What that buys you is predictability: it behaves exactly like the node you already know, just under a Prepack label, so you can swap it in without changing your results.
The inputs worth understanding:
add_noise- enable/disable. "disable" feeds a zero-noise latent, which is how you do things like latent upscaling without adding fresh noise. Disabling noise means the sampler only refines what's already there.start_at_step/end_at_step- the window of the denoising schedule to run. This is the "advanced" superpower: you can run only the early steps, or only the late steps, and feed the partial result onward. It's how two-stage hires workflows carve up the schedule.return_with_leftover_noise- enable leaves the latent with residual noise (for a follow-up pass that will finish it); disable forces full denoise so the output is a "finished" latent.noise_seed,steps,cfg,sampler_name,scheduler- the usual sampler settings, identical to the plain version.
The single output is LATENT. No image, no info string - you take the latent and decode it yourself with a VAEDecode when you're ready.
Where it fits
The concrete use case: two-pass upscaling. First pass samples your base latent; you upscale the latent and run a second pass with add_noise disabled and a partial step window, then decode once at the end. The advanced sampler makes that possible because it hands you latents at every stage. The plain Prepack Ksampler can't do any of this - it decodes too early.
The gotcha is the mirror image of the plain node's: here you never get an image out, so a beginner who wires this into a preview node expecting pixels will get a confusing error. Add VAEDecode (or the pack's Ksampler's philosophy in reverse) before anything that wants an IMAGE.
Installing it
It's in the Prepack pack:
cd ComfyUI/custom_nodes
git clone https://github.com/S4MUEL-404/ComfyUI-Prepack.git
pip install -r ComfyUI-Prepack/requirements.txt
Or search "Prepack" in ComfyUI Manager. Dependencies: PyTorch, NumPy, Pillow - already present. Restart, look under đź’€Prepack. No models, no config.
If your workflow suddenly produces no visible output, you've almost certainly expected an image where this node correctly gives a latent - check that the LATENT output is wired through a VAEDecode before reaching any preview or save node.
Inputs (13)
| Name | Type | Default | Description |
|---|---|---|---|
| model | MODEL | — | |
| add_noise | COMBO | 2 options: enable, disable | |
| noise_seed | INT | 00–18446744073709550000 | — |
| steps | INT | 201–10000 | — |
| cfg | FLOAT | 8.00–100 | — |
| sampler_name | COMBO | 44 options: euler, euler_cfg_pp, euler_ancestral, euler_ancestral_cfg_pp, heun, heunpp2, +38 | |
| scheduler | COMBO | 9 options: simple, sgm_uniform, karras, exponential, ddim_uniform, beta, +3 | |
| positive | CONDITIONING | — | |
| negative | CONDITIONING | — | |
| latent_image | LATENT | — | |
| start_at_step | INT | 00–10000 | — |
| end_at_step | INT | 100000–10000 | — |
| return_with_leftover_noise | COMBO | 2 options: disable, enable |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| LATENT | LATENT | — |