Nodes/ComfyUI Iterative Mixing Nodes/Iterative Mixing KSampler Advanced
ComfyUI Node Runs on cloud

Iterative Mixing KSampler Advanced

The legacy mixer with the debug outputs

By ttulttul·Created 3 years ago·Updated about a year ago· 120
Iterative Mixing KSampler Advanced
  • model
  • positive
  • negative
  • latent_image_batch
  • mixed_latents
  • noised_latents
  • intermediate_latents
  • plot_image
seed0
cfg8.0
sampler_name
scheduler
denoise1.00
alpha_12.40
reverse_input_batchtrue
blending_schedulecosine
stop_blending_at_pct1.00
clamp_blending_at_pct1.00
blending_functionaddition

Where the plain Iterative Mixing KSampler hides its machinery, this one shows you the plumbing. It's the "manual" version of the same legacy technique: instead of generating the noise batch internally, it takes a latent_image_batch straight from the Batch Unsampler and de-noises it while blending in a declining fraction of the noised latents at each step. It's deprecated - this is the KSampler-era approach that produces grainy output, the one the author abandoned for the SamplerCustom route - but it's also the node with the best self-diagnostics in the pack, which makes it genuinely educational.

How it works

The math is the DemoFusion "skip residual" idea: at each step, blend denoised × (1 - c1) + noised × c1, where c1 is a curve that starts near 1.0 (lots of noised latent guiding the structure) and decays toward zero as sampling finishes. alpha_1 shapes that curve's steepness; blending_schedule picks cosine, linear, or logistic; blending_function chooses how the blend happens (addition, slerp, or norm_only - slerp and norm_only tend to produce fewer artifacts).

The inputs that matter

The unique bit is that there is no steps input. The step count is inferred from the length of the latent_image_batch you feed it - one de-noising step per unsampled latent. That's the defining quirk of this node.

  • latent_image_batch - wire in the latent_batch output of a Batch Unsampler.
  • reverse_input_batch - keep True. The unsampler emits least-noisy-first; sampling wants noisiest-first. The default is correct, the README is emphatic, leave it alone.
  • alpha_1 - curve steepness; the README suggests 0.1–2.0 here (the simple version allows higher).
  • stop_blending_at_pct / clamp_blending_at_pct - both default 1.0. stop squeezes the schedule so blending ends at a fraction of steps (values above 1.0 stretch it, for "interesting results"); clamp just caps the curve at 1.0 after a fraction. Similar effect, different mechanics - the README notes clamp can be more effective.
  • Everything else - model, seed, cfg, sampler_name, scheduler, positive, negative, denoise - is a standard sampler control.

The outputs (this is the good part)

Four outputs, and three of them are debug gold:

  • mixed_latents - the final result. VAE-decode this.
  • noised_latents - the z-prime batch as it was fed in, unmodified.
  • intermediate_latents - every step of the mix, so you can watch the structure lock in (or collapse).
  • plot_image - an actual plot of your c1 blending curve. Before you touch alpha_1, run this once and look at what the curve is doing. It's the fastest way to build intuition for the parameter.

Install

cd ComfyUI/custom_nodes
git clone https://github.com/ttulttul/ComfyUI-Iterative-Mixer
# restart ComfyUI

Or use ComfyUI Manager and search "ComfyUI Iterative Mixing Nodes." Nothing to download beyond the code; matplotlib (for the plot output) and scipy are the notable Python deps, both standard requirements.txt entries.

Where people get burned

  • It's grainy, by design. The author's own diagnosis: this method calls the underlying sample() inside ComfyUI, and the output carries residual noise the model was never trained to clean. Plan a cleanup KSampler at denoise 0.05–0.25, or use the modern IterativeMixingSampler instead.
  • denoise is unreliable here - the author is "not sure if this does anything." Don't rely on it.
  • Inpainting via VAEEncodeForInpaint breaks the concept - the encoder wipes the masked area, so there's nothing to blend with.
  • If you reverse the batch or feed mismatched shapes, the blending schedule silently stretches and you get nonsense. Keep reverse_input_batch on and let the batch size define steps.
Categorytest

Inputs (15)

NameTypeDefaultDescription
modelMODEL
seedINT00–18446744073709550000
cfgFLOAT8.00–100
sampler_nameCOMBO27 options: euler, euler_cfg_pp, euler_ancestral, euler_ancestral_cfg_pp, heun, heunpp2, +21
schedulerCOMBO6 options: normal, karras, exponential, sgm_uniform, simple, ddim_uniform
positiveCONDITIONING
negativeCONDITIONING
latent_image_batchLATENT
denoiseFLOAT1.000–1
alpha_1FLOAT2.400.05–100
reverse_input_batchBOOLEANtrue
blending_scheduleCOMBOcosine3 options: cosine, linear, logistic
stop_blending_at_pctFLOAT1.00
clamp_blending_at_pctFLOAT1.00
blending_functionCOMBOaddition3 options: addition, norm_only, slerp

Outputs (4)

NameTypeDescription
mixed_latentsLATENT
noised_latentsLATENT
intermediate_latentsLATENT
plot_imageIMAGE