Iterative Mixing KSampler Advanced
The legacy mixer with the debug outputs
- model
- positive
- negative
- latent_image_batch
- mixed_latents
- noised_latents
- intermediate_latents
- plot_image
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 thelatent_batchoutput of aBatch 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.stopsqueezes the schedule so blending ends at a fraction of steps (values above 1.0 stretch it, for "interesting results");clampjust 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 yourc1blending curve. Before you touchalpha_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 modernIterativeMixingSamplerinstead. denoiseis unreliable here - the author is "not sure if this does anything." Don't rely on it.- Inpainting via
VAEEncodeForInpaintbreaks 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_batchon and let the batch size definesteps.
Inputs (15)
| Name | Type | Default | Description |
|---|---|---|---|
| model | MODEL | — | |
| seed | INT | 00–18446744073709550000 | — |
| cfg | FLOAT | 8.00–100 | — |
| sampler_name | COMBO | 27 options: euler, euler_cfg_pp, euler_ancestral, euler_ancestral_cfg_pp, heun, heunpp2, +21 | |
| scheduler | COMBO | 6 options: normal, karras, exponential, sgm_uniform, simple, ddim_uniform | |
| positive | CONDITIONING | — | |
| negative | CONDITIONING | — | |
| latent_image_batch | LATENT | — | |
| denoise | FLOAT | 1.000–1 | — |
| alpha_1 | FLOAT | 2.400.05–100 | — |
| reverse_input_batch | BOOLEAN | true | — |
| blending_schedule | COMBO | cosine | 3 options: cosine, linear, logistic |
| stop_blending_at_pct | FLOAT | 1.00 | — |
| clamp_blending_at_pct | FLOAT | 1.00 | — |
| blending_function | COMBO | addition | 3 options: addition, norm_only, slerp |
Outputs (4)
| Name | Type | Description |
|---|---|---|
| mixed_latents | LATENT | — |
| noised_latents | LATENT | — |
| intermediate_latents | LATENT | — |
| plot_image | IMAGE | — |