Nodes/ComfyUI-sonar/KRestartSamplerCustomNoise
ComfyUI Node

KRestartSamplerCustomNoise

Restart sampling, but you get to choose the noise each restart injects

By blepping·Created 3 years ago·Updated 8 days ago· 49
KRestartSamplerCustomNoise
  • model
  • sampler
  • positive
  • negative
  • latent_image
  • custom_noise_opt
  • output
  • denoised_output
add_noiseenable
noise_seed0
steps20
cfg8.000
scheduler
start_at_step0
end_at_step10000
return_with_leftover_noisedisable
segments
restart_scheduler
chunked_modetrue

Restart sampling is the trick that gives ODE-sampler speed with SDE-sampler quality: you run a converging sampler like Euler or DPM++ 2M, but periodically re-inject noise at low noise levels and denoise back down, "restarting" to burn off the accumulated discretization error. The paper is Xu et al. 2023, and the canonical ComfyUI implementation lives in ssitu's ComfyUI_restart_sampling - the kind of thing that makes normal KSampler output look a bit mushy in comparison once you've seen it.

KRestartSamplerCustomNoise is that node, with one extra socket. It's a drop-in clone of ssitu's KRestartSampler - the full KSampler-style restart node - except it adds an optional custom_noise_opt input so you can feed it a SONAR_CUSTOM_NOISE chain from the rest of this pack (or an OCS_NOISE from a compatible pack). That's the entire point: instead of whatever noise the restart segments would normally inject, you can inject pyramid noise, brownian, or a blend you built out of Sonar noise nodes. Blepping built it as a bridge between his noise toybox and restart sampling, and it only exists in the node list if you have a recent enough version of ComfyUI_restart_sampling installed.

Install is two packs, not one. The node lives in ComfyUI-sonar but refuses to exist without the restart_sampling pack, so grab both:

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

Restart ComfyUI (or install both via Manager - search "ComfyUI-sonar" and "restart sampling"). No model downloads, no heavy Python deps.

If you've used a KSampler, the required inputs are familiar: model, positive/negative, latent_image, steps, cfg, sampler, scheduler, noise_seed, plus add_noise, start_at_step, end_at_step and return_with_leftover_noise for the advanced crowd. The restart-specific ones are where the beginner gets lost:

  • segments - the restart schedule. Format is comma-separated arrays of [N_Restart, K, t_min, t_max], e.g. [3,2,0.06,0.30],[3,1,0.30,0.59]. Leave it blank for the default; a1111 emulates the A1111 extension's segment calculation.
  • restart_scheduler - scheduler used for the denoising inside restart segments.
  • chunked_mode - leave this on (true). It lets the sampler run in chunks up to the next segment instead of one step at a time, which matters for stateful samplers like DPM++ 2M.

Outputs are two latents: output and denoised_output (the no-leftover-noise variant). Wire output into your VAE decode.

Where people get burned: restart sampling is an ODE technique, so don't feed it SDE or momentum samplers - ssitu's own docs say that's not an improvement. And if you set custom_noise_opt, that overrides whatever noise type the node would otherwise pick, so don't fight it by also trying to set a noise type somewhere. Finally, this is a sonar pack, so apply the standard sonar caveat: inputs change between versions, and if you want a reproducible generation, note the git revision you used.

Categorysampling

Inputs (17)

NameTypeDefaultDescription
modelMODEL
add_noiseCOMBOenable2 options: enable, disable
noise_seedINT00–18446744073709550000Seed to use for generated noise
stepsINT201–10000
cfgFLOAT8.0000–10000
samplerSAMPLER
schedulerCOMBO0 options:
positiveCONDITIONING
negativeCONDITIONING
latent_imageLATENT
start_at_stepINT00–10000
end_at_stepINT100000–10000
return_with_leftover_noiseCOMBOdisable2 options: disable, enable
segmentsSTRING
restart_schedulerCOMBO0 options:
chunked_modeBOOLEANtrue
custom_noise_optoptSONAR_CUSTOM_NOISE,OCS_NOISEOptional custom noise input. The following input types are supported: SONAR_CUSTOM_NOISE, OCS_NOISE

Outputs (2)

NameTypeDescription
outputLATENT
denoised_outputLATENT