Nodes/ComfyUI Essentials/πŸ”§ KSampler Stochastic Variations
ComfyUI Node Runs on cloud

πŸ”§ KSampler Stochastic Variations

KSampler Stochastic Variations β€” nudge a seed you like without losing it

By cubiqΒ·Created 3 years agoΒ·Updated about a year agoΒ· 1,152
πŸ”§ KSampler Stochastic Variations
  • model
  • latent_image
  • positive
  • negative
  • variation_seed
  • LATENT
β—„noise_seed0β–Ί
β—„steps25β–Ί
β—„cfg7.0β–Ί
β—„samplerβ–Ύβ–Ί
β—„schedulerβ–Ύβ–Ί
β—„variation_strength0.20β–Ί
β—„cfg_scale1.00β–Ί

You've got a seed you love. The composition's right, the pose is right, but you want to see the neighbors - the same image, slightly different - without rolling a fresh seed and losing everything. That's what this sampler is for. It's a KSampler with a second seed bolted on that blends a controlled amount of variation noise into your main seed, so you explore around a result instead of jumping to a random new one.

If you used Automatic1111, this is the "variation seed / variation strength" idea, ported into a ComfyUI sampler node.

How it works

A normal KSampler starts from noise defined by one seed. This node starts from your noise_seed, then mixes in a second noise pattern from variation_seed, weighted by variation_strength. At strength 0 you get your original image exactly. Crank strength toward 1 and the variation seed takes over, drifting further from the original. The sweet spot is small - a strength of 0.1 to 0.3 gives you recognisable siblings of your image rather than strangers.

So the workflow is: lock noise_seed to the image you like, then sweep variation_seed (1, 2, 3…) at a fixed small variation_strength to generate a family of near-variations. Or hold the variation seed and slowly raise strength to watch one image morph away from the original.

The inputs that matter

It takes the usual sampler wiring - model, positive, negative, latent_image, plus steps, cfg, sampler, and scheduler (the full core lists: 44 samplers, 9 schedulers). On top of that:

  • noise_seed - your anchor. The base image.
  • variation_seed - the second seed. Change this to get different neighbors.
  • variation_strength - how far to wander (0–1, default 0.2). This is the dial you'll actually tune.
  • cfg_scale - a 0–1 factor (default 1) that scales the guidance behavior for this stochastic path. Leave it at 1 unless you're deliberately experimenting.

Output is a LATENT, same as any sampler - send it to a VAE Decode.

When you'd reach for it

Refinement and selection. You've done a big batch, one result stands out, and you want a handful of close alternatives to pick the best from - this beats re-rolling because every variation shares the winner's DNA. It's also nice for subtle "same character, slightly different expression" nudges where a whole new seed would give you a whole new person.

For everyday generation it's overkill; use a plain KSampler. Reach for this specifically when you're circling a result you already like.

Installing it

Ships in ComfyUI Essentials by cubiq (Matteo Spinelli, author of ComfyUI_IPAdapter_plus):

  • ComfyUI Manager: search "ComfyUI Essentials" β†’ Install β†’ restart.
  • Manual: cd ComfyUI/custom_nodes && git clone https://github.com/cubiq/ComfyUI_essentials, install requirements.txt, restart.

Gotchas

Strength is touchy - the useful range is the bottom fifth of the slider. If your "variations" look like completely unrelated images, you've set strength too high; it's behaving like a fresh seed, which defeats the purpose. Drop it back under 0.3.

Remember the base image only stays put if noise_seed stays put. If you change both seeds you're not making variations, you're making random images.

Pack note: cubiq set Essentials to maintenance-only in April 2025. It still works, but this is a more complex node than most in the pack, so it's a likelier candidate to snag on a big ComfyUI sampler-side update. If it errors after an update, roll ComfyUI back or patch the file - nothing's coming from upstream. A red "missing node" box means the pack didn't load at all; check the startup log and reinstall via Manager.

Categoryessentials/sampling

Inputs (12)

NameTypeDefaultDescription
modelMODELβ€”
latent_imageLATENTβ€”
noise_seedINT00–18446744073709550000β€”
stepsINT251–10000β€”
cfgFLOAT7.00–100β€”
samplerCOMBO44 options: euler, euler_cfg_pp, euler_ancestral, euler_ancestral_cfg_pp, heun, heunpp2, +38
schedulerCOMBO9 options: simple, sgm_uniform, karras, exponential, ddim_uniform, beta, +3
positiveCONDITIONINGβ€”
negativeCONDITIONINGβ€”
variation_seedINT:seed00–18446744073709550000β€”
variation_strengthFLOAT0.200–1β€”
cfg_scaleFLOAT1.000–1β€”

Outputs (1)

NameTypeDescription
LATENTLATENTβ€”