Random_Sampler
A KSampler that changes its own steps, CFG and denoise
- model
- positive
- negative
- LATENT
- LATENT
Random_Sampler is a KSampler that refuses to commit. It takes everything a normal sampler does - model, conditioning, latent, sampler, scheduler, seed - but instead of steps, cfg and denoise, you give it ranges, and every run it rolls fresh values inside them. Same prompt, same seed, and the generation conditions themselves shift each time.
If you're deep in the "just explore the space" mindset - batch out sixty images and curate - this is actually a smart division of labor. You keep the prompt fixed, randomize the sampling parameters, and see how much of your image quality is steps, how much is CFG, and how much is the prompt itself. The alternative is manual sweeps one node at a time, which is soul-crushing. The one genuinely useful pattern is coupling this with a wildcard encoder from the same pack: random prompt and random sampler settings in one queue, which is about as close to "press button, get surprised" as ComfyUI got in 2023.
Inputs
The sampler-side inputs you'll actually touch:
steps_min/steps_max(default 20–30) - integer steps rolled in range.cfg_min/cfg_max(default 5–9) - CFG rolled in half-step increments.denoise_min/denoise_max(default 0.5–1.0) - denoise strength rolled as a float.
Plus model, positive, negative, LATENT, sampler_name (full KSampler list), scheduler (all nine standard schedules) and seed. The output is a LATENT - same as the stock KSampler - so it slots into any existing graph that expects sampler output.
Two source-level notes. The seed input is passed to common_ksampler but never seeds the parameter rolls, so the rolls are random regardless of seed - fine for exploration, useless for reproducibility. And the CFG roll has a subtle quirk: it draws an integer, then halves it, so you can get half-step values like 6.5.
Install and when to skip it
Clone and restart; ComfyUI Manager finds it by searching "Lilly":
cd ComfyUI/custom_nodes
git clone https://github.com/lilly1987/ComfyUI_node_Lilly
Restart after cloning. No model downloads; rich/chardet auto-install on first load.
When to skip it: modern model families have broken the old "CFG 7 is default" assumption - on guidance-distilled models the correct CFG is 1 and randomizing it upward just burns images. This node is built for the SD 1.5 / SDXL DDPM world where CFG 4–9 meant something. For those models it's a fun and honest exploration tool; for 2026 models, set your ranges to their fixed correct values and let the wildcards do the randomizing. The pack is unmaintained, so expect no updates.
Inputs (13)
| Name | Type | Default | Description |
|---|---|---|---|
| model | MODEL | — | |
| positive | CONDITIONING | — | |
| negative | CONDITIONING | — | |
| LATENT | LATENT | — | |
| sampler_name | COMBO | 34 options: euler, euler_cfg_pp, euler_ancestral, euler_ancestral_cfg_pp, heun, heunpp2, +28 | |
| scheduler | COMBO | 9 options: normal, karras, exponential, sgm_uniform, simple, ddim_uniform, +3 | |
| seed | INT | 00–18446744073709550000 | — |
| steps_min | INT | 201–10000 | — |
| steps_max | INT | 301–10000 | — |
| cfg_min | FLOAT | 5.00–100 | — |
| cfg_max | FLOAT | 9.00–100 | — |
| denoise_min | FLOAT | 0.500.01–1 | — |
| denoise_max | FLOAT | 1.000.01–1 | — |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| LATENT | LATENT | — |