Nodes/RES4LYF/ClownOptions SDE
ComfyUI Node Runs on cloud

ClownOptions SDE

Tune the noise injection for SDE sampling

By ClownsharkBatwing·Created 2 years ago·Updated 22 days ago· 1,222
ClownOptions SDE
  • etas
  • etas_substep
  • options
  • options
noise_type_sdegaussian
noise_type_sde_substepgaussian
noise_mode_sdehard
noise_mode_sde_substephard
eta0.50
eta_substep0.50
seed-1

SDE sampling is ODE sampling with noise added back after every step - a controlled, continuous re-injection that can sharpen detail and shake a generation out of a rut, at the cost of some reproducibility. ClownOptions SDE is the node that configures exactly how that noise gets added. It outputs an OPTIONS object that plugs into a RES4LYF sampler, and it bundles the SDE knobs - noise type, noise mode, and eta - into one clean node instead of leaving them scattered across the sampler's face.

You'd add it when you want SDE behavior with intent: a specific noise type, a stronger or gentler eta than the sampler's default, or different noise on substeps than on steps. It's an options module - chain it in when you need it, leave it out when the defaults are fine.

How it works

The three levers work together. eta sets how much noise is re-injected each step; noise_mode_sde sets how that eta is scaled into an actual amount (the modes are listed roughly in order of strength); and noise_type_sde sets the character of the noise itself. Each has a substep twin so you can treat the substeps of an s-family solver differently from the main steps. The result is packaged as OPTIONS and read by the sampler at run time.

The inputs and outputs that matter

  • eta (FLOAT, default 0.5) - the amount of SDE noise per step. This is the main dial. 0 turns SDE off (pure ODE); higher adds more. Note the README's warning: for most noise modes, eta at or above 1.0 triggers internal scaling to avoid NaN blowups - the exp mode is the exception that tolerates higher.
  • noise_mode_sde (default hard) - how eta is scaled. Options run hard, lorentzian, soft, softer, exp, and more, in increasing gentleness/strength; hard is the default and a strong effect.
  • noise_type_sde (default gaussian) - the noise distribution: gaussian, brownian, laplacian, perlin, pink, white, and a couple dozen others. gaussian is the safe default.
  • eta_substep / noise_mode_sde_substep / noise_type_sde_substep - the same three, for substeps.

The single output is options (OPTIONS) - feed it into your sampler (or chain it with other ClownOptions nodes through their options input).

Installing it

ComfyUI Manager: search RES4LYF, install, restart. Manually:

cd ComfyUI/custom_nodes
git clone https://github.com/ClownsharkBatwing/RES4LYF/
cd RES4LYF
pip install -r requirements.txt

pip install in the venv or portable Python, restart, hard-refresh (F5). No downloads.

Where people get tripped up

The NaN cliff is the one to know. Push eta to 1.0 or beyond on a normal noise mode and you're relying on internal clamping to save you; go too far and the sample can blow out to noise or NaNs anyway. If you want big eta values, use the exp mode, which is built for it - otherwise keep eta below 1.0 and let the mode do the shaping.

Second, SDE trades reproducibility for character. Because noise is injected every step, more steps keep changing the image rather than settling it, and the same seed won't behave like it does with a plain converging sampler. That's the point when you want variation or extra detail, and a nuisance when you're trying to A/B a single setting - for clean comparisons, set eta to 0 and sample ODE. And if none of the SDE knobs seem to matter, check that your sampler is actually in an SDE mode to begin with.

CategoryRES4LYF/sampler_options

Inputs (10)

NameTypeDefaultDescription
noise_type_sdeCOMBOgaussian25 options: none, brownian, gaussian, gaussian_backwards, laplacian, perlin, +19
noise_type_sde_substepCOMBOgaussian25 options: none, brownian, gaussian, gaussian_backwards, laplacian, perlin, +19
noise_mode_sdeCOMBOhardHow noise scales with the sigma schedule. Hard is the most aggressive, the others start strong and drop rapidly.
noise_mode_sde_substepCOMBOhardHow noise scales with the sigma schedule. Hard is the most aggressive, the others start strong and drop rapidly.
etaFLOAT0.50-100–100Calculated noise amount to be added, then removed, after each step.
eta_substepFLOAT0.50-100–100Calculated noise amount to be added, then removed, after each step.
seedINT-1-1–18446744073709550000
etasoptSIGMAS
etas_substepoptSIGMAS
optionsoptOPTIONS

Outputs (1)

NameTypeDescription
optionsOPTIONS