h4 - Double Sampler (Advanced)
The two-pass sampler with CFG sliding, stutter, and a chaos engine
- model
- positive
- negative
- latent_image
- clip
- vae
- latent
- preview
- processed_prompt
- seed_out
- steps_out
- cfg_out
- sampler_str
- scheduler_str
H4_DoubleSampler is the monster truck of samplers, and its display name ("Advanced") is earned. Where a stock KSampler does one pass, this node can do two (primary plus a refiner stage), slide your CFG down across the steps, and - if you're feeling chaotic - inject prompt mutations via a "chaos engine." It's h4_Live's answer to "I want a fancy sampling pipeline without wiring six nodes." The trade is that it's a big node with a lot of knobs, and most of them are optional, gated behind three toggles.
The parts you'll actually use
The core is a normal sampler: model, positive, negative, latent_image, seed, steps, cfg, sampler_name, scheduler, denoise. Those behave exactly like a KSampler, so start there and pretend the rest doesn't exist. euler with a normal scheduler at 20 steps is a fine default.
The interesting stuff is gated:
- enable_stage_2 - turns on the refiner pass: its own
stage_2_steps(default 10),stage_2_denoise(0.35),stage_2_cfg, sampler, and scheduler. Classic primary-then-refine: run the main pass, then a light low-denoise pass on top. This is the two-pass engine the name promises. - cfg_sliding_scale - when on, CFG shifts from your starting
cfgdown tocfg_end(default 4) across the steps. The idea, per the tooltip: lower CFG near the end gives the image more "air." It's a cheap way to get crisper early structure with less color-fry at the end. - enable_chaos_engine - the weird one. It mutates prompts across the run (or spawns
chaos_batchvariants), withchaos_modechoosing the injection pattern (Pure Chaos, Odds, Evens, every Nth, Random Pulse),chaos_rangethe weight spectrum (negative values "try to delete concepts"), andchaos_denoisehow strongly variants rewrite the original. This is exploration/dada territory - great for finding happy accidents, terrible if you want reproducibility.
The outputs
Beyond the obvious latent and preview, it hands back telemetry you can actually use: processed_prompt (the prompt after stutter/chaos editing), seed_out, steps_out, cfg_out, sampler_str, scheduler_str. So you can log exactly what ran - which matters when the chaos engine was on and the "real" prompt is whatever came out the other end.
There are also optional text inputs (positive_text, negative_text, wildcard_text) and optional clip/vae - wire those in and the node can do its own prompt encoding instead of taking pre-built conditioning. And prompt_stutter randomly repeats tokens to force emphasis - the tooltip calls it "deep-fried emphasis levels," which is a fair warning.
Installing
ComfyUI Manager → search "h4_Live", or:
cd ComfyUI/custom_nodes
git clone https://github.com/m3rr/h4_Live
restart. Pure PyTorch, no extra deps.
Where people get burned
The traps are all about the toggles. Stage 2 with default stage_2_denoise 0.35 is gentle; if you set it high, the refiner rewrites the image and you'll wonder why your output stopped matching your prompt. The chaos engine and stutter are off by default for a reason - turn them on, and seeds stop being reproducible, which confuses anyone who treats this like a normal sampler. And the honest caveat: this is a young, in-development node in a pack the author calls a "Massive project." The two-pass and CFG-slide features are genuinely useful; treat the chaos engine as a toy until it's been battle-tested. Start with stage 2 only, get comfortable, then decide if you want your samples to grow tentacles.
Inputs (35)
| Name | Type | Default | Description |
|---|---|---|---|
| model | MODEL | — | |
| positive | CONDITIONING | — | |
| negative | CONDITIONING | — | |
| latent_image | LATENT | — | |
| seed | INT | 00–18446744073709550000 | — |
| steps | INT | 201–10000 | — |
| cfg | FLOAT | 8.00–100 | — |
| sampler_name | COMBO | euler | 44 options: euler, euler_cfg_pp, euler_ancestral, euler_ancestral_cfg_pp, heun, heunpp2, +38 |
| scheduler | COMBO | normal | 9 options: simple, sgm_uniform, karras, exponential, ddim_uniform, beta, +3 |
| denoise | FLOAT | 1.000–1 | — |
| enable_stage_2 | BOOLEAN | false | — |
| enable_chaos_engine | BOOLEAN | false | — |
| enable_extra_options | BOOLEAN | false | — |
| stage_2_sampleropt | COMBO | euler | 44 options: euler, euler_cfg_pp, euler_ancestral, euler_ancestral_cfg_pp, heun, heunpp2, +38 |
| stage_2_scheduleropt | COMBO | normal | 9 options: simple, sgm_uniform, karras, exponential, ddim_uniform, beta, +3 |
| stage_2_stepsopt | INT | 101–10000 | — |
| stage_2_denoiseopt | FLOAT | 0.350–1 | — |
| stage_2_cfgopt | FLOAT | 8.00–100 | — |
| cfg_sliding_scaleopt | BOOLEAN | false | When ON, the CFG will shift from its start value to the CFG End value over the course of the steps. |
| cfg_endopt | FLOAT | 4.00–100 | The landing target for the CFG slide. Lower values give more 'air' to the image near the end. |
| prompt_stutteropt | FLOAT | 0.000–1 | Probability of randomly repeating tokens to trick the model into deep-fried emphasis levels. |
| seed_variationopt | FLOAT | 0.000–1 | Global chaos delta. Higher values force the seed to drift away from the baseline pattern. |
| variation_seedopt | INT | 00–18446744073709550000 | The core of the noise drift. Change this to explore a different flavor of chaos. |
| chaos_modeopt | COMBO | OFF | Pick your injection pattern. 'Pure Chaos' hits everything; 'Odds/Evens' creates structured noise; 'Every #nth number' gives you frequency control; 'Random Pulse' keeps it weird. |
| chaos_everyopt | INT | 31–100 | The specific input for your 'nth' number. 3 means every 3rd word gets hammered by the chaos logic. |
| chaos_rangeopt | STRING | -1.0-1.5 | Min-Max weight spectrum. High values (1.5+) explode detail; Negative values (-1.0) try to delete concepts. |
| chaos_batchopt | INT | 11–64 | How many unique chaos variants to spawn in a single execution. |
| chaos_denoiseopt | FLOAT | 0.450–1 | The 'Mutation Strength' for Chaos variants. High values (0.7+) allow the chaos to completely overwrite the original; low values (0.3) just add subtle weirdness. |
| show_legendopt | BOOLEAN | false | Burn the diagnostic stats directly onto the top-left of the preview image. |
| label_seedopt | BOOLEAN | false | Explicitly output the seed used for each specific batch index. |
| clipopt | CLIP | — | |
| vaeopt | VAE | — | |
| positive_textopt | STRING | — | |
| negative_textopt | STRING | — | |
| wildcard_textopt | STRING | — |
Outputs (8)
| Name | Type | Description |
|---|---|---|
| latent | LATENT | — |
| preview | IMAGE | — |
| processed_prompt | STRING | — |
| seed_out | INT | — |
| steps_out | INT | — |
| cfg_out | FLOAT | — |
| sampler_str | STRING | — |
| scheduler_str | STRING | — |