Nodes/h4_Live/h4 - Double Sampler (Advanced)
ComfyUI Node

h4 - Double Sampler (Advanced)

The two-pass sampler with CFG sliding, stutter, and a chaos engine

By m3rr·Created 9 months ago·Updated 10 days ago· 1
h4 - Double Sampler (Advanced)
  • model
  • positive
  • negative
  • latent_image
  • clip
  • vae
  • latent
  • preview
  • processed_prompt
  • seed_out
  • steps_out
  • cfg_out
  • sampler_str
  • scheduler_str
seed0
steps20
cfg8.0
sampler_nameeuler
schedulernormal
denoise1.00
enable_stage_2false
enable_chaos_enginefalse
enable_extra_optionsfalse
stage_2_samplereuler
stage_2_schedulernormal
stage_2_steps10
stage_2_denoise0.35
stage_2_cfg8.0
cfg_sliding_scalefalse
cfg_end4.0
prompt_stutter0.00
seed_variation0.00
variation_seed0
chaos_modeOFF
chaos_every3
chaos_range-1.0-1.5
chaos_batch1
chaos_denoise0.45
show_legendfalse
label_seedfalse
positive_text
negative_text
wildcard_text

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 cfg down to cfg_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_batch variants), with chaos_mode choosing the injection pattern (Pure Chaos, Odds, Evens, every Nth, Random Pulse), chaos_range the weight spectrum (negative values "try to delete concepts"), and chaos_denoise how 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.

Categoryh4_Live/Generation

Inputs (35)

NameTypeDefaultDescription
modelMODEL
positiveCONDITIONING
negativeCONDITIONING
latent_imageLATENT
seedINT00–18446744073709550000
stepsINT201–10000
cfgFLOAT8.00–100
sampler_nameCOMBOeuler44 options: euler, euler_cfg_pp, euler_ancestral, euler_ancestral_cfg_pp, heun, heunpp2, +38
schedulerCOMBOnormal9 options: simple, sgm_uniform, karras, exponential, ddim_uniform, beta, +3
denoiseFLOAT1.000–1
enable_stage_2BOOLEANfalse
enable_chaos_engineBOOLEANfalse
enable_extra_optionsBOOLEANfalse
stage_2_sampleroptCOMBOeuler44 options: euler, euler_cfg_pp, euler_ancestral, euler_ancestral_cfg_pp, heun, heunpp2, +38
stage_2_scheduleroptCOMBOnormal9 options: simple, sgm_uniform, karras, exponential, ddim_uniform, beta, +3
stage_2_stepsoptINT101–10000
stage_2_denoiseoptFLOAT0.350–1
stage_2_cfgoptFLOAT8.00–100
cfg_sliding_scaleoptBOOLEANfalseWhen ON, the CFG will shift from its start value to the CFG End value over the course of the steps.
cfg_endoptFLOAT4.00–100The landing target for the CFG slide. Lower values give more 'air' to the image near the end.
prompt_stutteroptFLOAT0.000–1Probability of randomly repeating tokens to trick the model into deep-fried emphasis levels.
seed_variationoptFLOAT0.000–1Global chaos delta. Higher values force the seed to drift away from the baseline pattern.
variation_seedoptINT00–18446744073709550000The core of the noise drift. Change this to explore a different flavor of chaos.
chaos_modeoptCOMBOOFFPick 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_everyoptINT31–100The specific input for your 'nth' number. 3 means every 3rd word gets hammered by the chaos logic.
chaos_rangeoptSTRING-1.0-1.5Min-Max weight spectrum. High values (1.5+) explode detail; Negative values (-1.0) try to delete concepts.
chaos_batchoptINT11–64How many unique chaos variants to spawn in a single execution.
chaos_denoiseoptFLOAT0.450–1The '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_legendoptBOOLEANfalseBurn the diagnostic stats directly onto the top-left of the preview image.
label_seedoptBOOLEANfalseExplicitly output the seed used for each specific batch index.
clipoptCLIP
vaeoptVAE
positive_textoptSTRING
negative_textoptSTRING
wildcard_textoptSTRING

Outputs (8)

NameTypeDescription
latentLATENT
previewIMAGE
processed_promptSTRING
seed_outINT
steps_outINT
cfg_outFLOAT
sampler_strSTRING
scheduler_strSTRING