Nodes/Restart Sampling/KSampler With Restarts (Custom)
ComfyUI Node

KSampler With Restarts (Custom)

Plug your own sampler in

By ssitu·Created 3 years ago·Updated 9 months ago· 89
KSampler With Restarts (Custom)
  • model
  • sampler
  • positive
  • negative
  • latent_image
  • output
  • denoised_output
add_noise
noise_seed0
steps20
cfg8.00
scheduler
start_at_step0
end_at_step10000
return_with_leftover_noise
segments[3,2,0.06,0.30],[3,1,0.30,0.59]
restart_scheduler
chunked_modetrue

Every other restart node in this pack makes you pick your sampler from a dropdown. This one doesn't: like ComfyUI's built-in SamplerCustom, KSampler With Restarts (Custom) takes a SAMPLER object as an input instead of a sampler name. That matters if you've built your sampler of choice with SamplerCustom-style plumbing - say a custom sampler node from another pack - and you want restart behavior wrapped around it without giving up your setup.

The rest of the input list is the Advanced node's: model, seed (noise_seed here, plus add_noise), steps, cfg, scheduler, positive, negative, latent_image, start_at_step, end_at_step, return_with_leftover_noise, then the restart trio of segments, restart_scheduler, and chunked_mode. The scheduler dropdown stays a string selection because schedules are still generated internally; only the sampler is handed to you as an object.

One genuinely useful difference: this node outputs two latents, output and denoised_output - the final samples and the denoised estimate - mirroring SamplerCustom. If you've been chaining the denoised output into further processing in your custom sampling graphs, you can keep doing that with restarts enabled.

The caveat that comes with the freedom

The README is upfront about it: "it is possible to input samplers that don't work properly or are incompatible with Restart sampling like SDE and UniPC samplers." With the dropdown nodes the pack can filter to sane choices; here it can't see your object until runtime, so it trusts you. Restart sampling is an ODE technique - it re-injects noise at higher noise levels and expects the sampler to handle that gracefully. SDE samplers add their own noise on top, and UniPC-type high-order samplers aren't designed for noise level jumps, so results can come out degraded or plain wrong without any error. The author's own guidance: this is unlikely to be an improvement over normal sampling with those samplers.

In practice that means: if you feed in an euler- or heun-family sampler (or anything else that treats the sigma schedule as given), you get exactly the restart behavior you'd expect from the dropdown nodes. If you're determined to use dpmpp_2m, leave chunked_mode on - calling it one step at a time loses its second-order state. If you're feeding something exotic, do a side-by-side against the plain node on a fixed seed before you trust it.

Install and get going

Same trivial install as the rest of the pack - no requirements.txt, no model downloads:

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

Restart ComfyUI (or use Manager, search "Restart Sampling"). It's under sampling in the node menu. And if you don't already have a reason to be in custom-sampling territory, the simpler KRestartSampler gives you 90% of this without the SAMPLER plumbing - grab that first.

Categorysampling

Inputs (16)

NameTypeDefaultDescription
modelMODEL
add_noiseCOMBO2 options: enable, disable
noise_seedINT00–18446744073709550000
stepsINT201–10000
cfgFLOAT8.000–100
samplerSAMPLER
schedulerCOMBO10 options: normal, karras, exponential, sgm_uniform, simple, ddim_uniform, +4
positiveCONDITIONING
negativeCONDITIONING
latent_imageLATENT
start_at_stepINT00–10000
end_at_stepINT100000–10000
return_with_leftover_noiseCOMBO2 options: disable, enable
segmentsSTRING[3,2,0.06,0.30],[3,1,0.30,0.59]
restart_schedulerCOMBO7 options: normal, karras, exponential, simple, ddim_uniform, sgm_uniform, +1
chunked_modeBOOLEANtrue

Outputs (2)

NameTypeDescription
outputLATENT
denoised_outputLATENT