Nodes/Restart Sampling/RestartSampler
ComfyUI Node

RestartSampler

The wrapper that turns climbing sigmas into noise

By ssitu·Created 3 years ago·Updated 9 months ago· 89
RestartSampler
  • sampler
  • SAMPLER
chunked_modetrue

RestartSampler is the other half of the pack's custom sampling pair, and it's almost comically simple on the surface: it takes a SAMPLER in, has a single chunked_mode boolean, and hands you a SAMPLER back out. All the actual work is delegated to whatever sampler you plug in. Its partner node RestartScheduler builds the zig-zag sigma schedule - normal denoising, then a jump back up to a higher noise level, then down again. RestartSampler's job is to spot those climbs in the schedule and inject the matching amount of noise when the latent goes back up, then let your chosen sampler do the denoising as usual.

That's why it feels like a pass-through: it's a wrapper. Under the hood it replaces your sampler with a wrapped version whose inner loop splits the sigmas into descending chunks. Whenever a new chunk starts at a higher sigma than the last one ended, that's a restart point, and it re-noises the latent accordingly. The mechanism is standard diffusion physics - to jump from a lower sigma to a higher one you scale the latent and add Gaussian noise sized to the sigma gap - so it plays nice with the ordinary samplers you're used to. If you've ever wanted to see restart sampling drawn out, pipe this node's output into a sigmas viewer: the climbing noise levels tell the whole story.

The inputs that matter

Just two, really:

  • sampler - the SAMPLER object to wrap. This is where you choose your algorithm, so the same advice as the dropdown nodes applies: ODE samplers (euler, heun, dpmpp_2m...) are what restart sampling is built for. The node can't stop you from plugging in an SDE or momentum sampler, but the author's guidance is that those are likely not an improvement over normal sampling.
  • chunked_mode - when on (default), the wrapped sampler is called with as many steps as it can run up to the next restart, preserving state across steps. When off, it's called one step at a time, which loses state for second-order and momentum samplers like dpmpp_2m. Leave it on unless you're chasing a specific behavior.

The output is a SAMPLER that slots into any node expecting one - SamplerCustom style plumbing - as long as you feed it the restart-annotated sigmas from RestartScheduler. Feed it a plain schedule and the climbs never happen, so neither does any re-noising; the pair genuinely has to travel together.

Who this is for

Strictly the custom sampling crowd. If you're not already wiring SamplerCustom graphs with explicit sampler objects, the standalone KSampler With Restarts nodes do the exact same thing with far less ceremony - grab those. But if you're in custom sampling territory and want restart behavior folded into a pipeline that already builds its samplers as objects, this is the clean way to get it, and it adds no dependencies to your install:

cd ComfyUI/custom_nodes
git clone https://github.com/ssitu/ComfyUI_restart_sampling

Restart ComfyUI (or install via Manager, searching "Restart Sampling"), and the node appears under sampling/custom_sampling/samplers. Troubleshooting is the same as everywhere else in this pack: set COMFYUI_VERBOSE_RESTART_SAMPLING=1 to have the plan printed to the console, and if nothing appears to restart, check that the sigmas feeding the graph actually came from RestartScheduler.

Categorysampling/custom_sampling/samplers

Inputs (2)

NameTypeDefaultDescription
samplerSAMPLER
chunked_modeBOOLEANtrue

Outputs (1)

NameTypeDescription
SAMPLERSAMPLER