ComfyUI Sampler Paints a Blue Blob, and Negative Momentum Cuts Error by 11–21%
A sampler turns noise into an image over dozens of steps, but the momentum version in ComfyUI on the Anima flow model produced a pale blue silhouette. Momentum is not the culprit: the code was written for a different class of models and adds noise of the wrong strength. A negative momentum coefficient reduces error (deviation from a reference image) by 11–21% at the same step count, while a positive one increases it by up to 61%. The bottom line is modest: you need 1.2 times fewer steps, not half as many.
AI-processed from Habr AI; edited by Hamidun News
A sampler in ComfyUI is an algorithm that turns random noise into an image step by step over 20–30 steps. "Momentum" is a technique in which each step accounts not only for the model's current prediction but also for the previous ones, as if smoothing the path. The ComfyUI-Extra-Samplers collection includes variants with the "momentumized" prefix.
It sounds like free acceleration, but the author of the Habr analysis ran dpmpp_dualsde_momentumized on the Anima flow model (bf16, CFG 8, 30 steps) and got a pale blue silhouette instead of a picture. The same prompt on the standard dpmpp_2m_sde_gpu produced a clean image. He then worked out what was broken and tested whether momentum can actually reduce error, meaning the deviation of the result from a reference image, at the same number of network calls.
It can: the reduction was 11–21%.
What is broken in the sampler
The defect is not related to momentum: through the standard KSampler its coefficient is zero, meaning it does nothing. The sampler was written for models where noise of increasing strength is simply added to the image (variance-exploding). In a flow model, the image and noise are mixed differently: the more noise, the less signal. As a result, the noise-injection step in the sampler gets the wrong variance, meaning the wrong spread of noise. With eta = 1 (the parameter setting the share of random noise), the latent blows up: its standard deviation reaches 3–4.5 instead of 1.2. With eta = 0, the same code draws a cat without trouble.
The evidence is indirect, and the author acknowledges this: the same 2S SDE algorithm in a form correct for flow models, taken from ComfyUI's core (dpmpp_sde), produces a clean image. He did not isolate the mechanism itself in a separate experiment.
There are other defects. The sampler takes a full second-order step with two network calls and additionally adds a third-order multistep correction, so the correction is computed twice. Even without noise, it is 2–35 times worse than dpmpp_2m at the same number of calls. In addition, the variable r is overwritten inside the function, and the midpoint of the stage drifts away from 1/2. To switch each defect on and off separately, the author made an exact port and checked it against the original to 1e-10 on a toy model.
Which momentum helps
In the original, "momentum" is an exponential moving average of the data prediction: D̄ = m·D̄_prev + (1 − m)·D. This is similar to smoothing a currency exchange rate chart. With positive m the curve is smooth but lags behind reality, and for a sampler lag means a worse solution. With negative m the same formula anticipates where the solution is heading, that is, it extrapolates. At m = −1/2 and uniform steps, this yields the classic second-order Adams–Bashforth method. The recursion is stable only when |m| < 1: at m = −0.9 the gain disappears, and at m = −1.2 everything diverges.
Measurements: Anima, bf16, 576×768, CFG 5, 15 units (5 prompts × 3 seeds), from 8 to 24 network calls, paired bootstrap, reference being the converged solution of the same type. The author registered nine hypotheses before taking measurements: four were confirmed and five were refuted, including his initial suspicion that the third-order correction was the culprit.
- Deterministic case (no random noise). ema with m = −0.6 reduces error by 11–21% relative to dpmpp_2m at the same step count. At 8 steps the gain shows up in 14 of 15 units, and at 16 steps in 15 of 15. This amounts to roughly 1.2 times fewer steps for the same error. By the LPIPS metric against the decoded reference, the result is better in 14 of 15 cases at 8 steps.
- Positive momentum always hurts: up to +61% error at m = 0.6.
- Case with noise. Strong extrapolation stops helping: the injected noise is unpredictable, and extrapolation amplifies the error it causes. Damped extrapolation (beta = 0.5) gives 7–10% lower error than dpmpp_2m_sde, and mild ema with m = −0.3 gives 6–15% lower.
- One call versus two. The best single-call variant beats the two-call dpmpp_sde at the same number of calls by 16–29%.
Limitations and what to try
The gain is modest: at 30 steps it amounts to about 25 network calls at the same error. Everything was checked on a single model and 15 units, and some findings, such as the time-dependent shape at m = −0.5, were obtained after the fact. On the settings of the original problem (CFG 8, 1216×832), mild ema produced a blue tint, while damped extrapolation did not. A static step schedule tuned on four short prompts did not help a held-out natural-language prompt and broke the 8-step image at CFG 8, so in the package it is kept as an experimental node.
The author lists predecessors: Heavy Ball momentum (Wizadwongsa et al., ICLR 2024), an Adam-like sampler, TADA, the sonar and Seren Sampler packages. He read only the abstracts and READMEs and did not run their code, so his conclusion about positive coefficients does not refute those works: they use different models, solvers and metrics.
In practice: install the package and restart ComfyUI. ddim_momentum and dpmpp_2m_sde_damped will appear in the list, and the Sampler Momentum node lets you set the mode and coefficient manually. There is also a filter node for samplers with one model call per step, plus <base>_momentumized entries for 19 samplers. That part has not been evaluated on the model, and in a smoke test at 8 steps, lms_momentumized and ipndm_v_momentumized at standard strength produced a latent with std around 10. For those, use a milder strength or skip them altogether. The code, 13 CPU tests and tables are on GitHub (YakovSava/momentum-cfg-samplers-research).
- Nov 2, 2026Adaptive noise in an SDE sampler improved texture by only 1–2% on Flux 3 Klein
- Nov 12, 2026Sampler Steps at Equal Turning Angles Cut Flow-Model Error by 30–43%
- Nov 21, 2026MiniMax H3 Image in ComfyUI: Three Fixes Remove the "Crunchy" Skin Without Changing the Model
- Nov 8, 2026Qwen-Image 2.1 Omni Fits Into 4 GB of VRAM With Almost No Speed Loss
Key Questions Answered
What is broken in the sampler?
The defect is not related to momentum: through the standard KSampler its coefficient is zero, meaning it does nothing. The sampler was written for models where noise of increasing strength is simply added to the image (variance-exploding). In a flow model, the image and noise are mixed differently: the more noise, the less signal. As a result, the noise-injection step in the sampler gets the wrong variance, meaning the wrong spread of noise.
Which momentum helps?
In the original, "momentum" is an exponential moving average of the data prediction: D̄ = m·D̄_prev + (1 − m)·D. This is similar to smoothing a currency exchange rate chart. With positive m the curve is smooth but lags behind reality, and for a sampler lag means a worse solution. With negative m the same formula anticipates where the solution is heading, that is, it extrapolates. At m = −1/2 and uniform steps, this yields the classic second-order Adams–Bashforth method.
What are the key details on Limitations and what to try?
The gain is modest: at 30 steps it amounts to about 25 network calls at the same error. Everything was checked on a single model and 15 units, and some findings, such as the time-dependent shape at m = −0.5, were obtained after the fact. On the settings of the original problem (CFG 8, 1216×832), mild ema produced a blue tint, while damped extrapolation did not.
Test Frontier LLMs & Autonomous Agents in One Workspace
Run Claude Opus 5.5, GPT-6, Gemini 3.1, and DeepSeek side-by-side in Nomad AI (nomadnet.ai) — unified model routing, deep research, and multimodal workflows under one subscription.
Daily 60-sec AI Voice Brief + Weekly Production AI Agent Playbook
Listen to a 60-second AI news brief every morning and get a weekly hands-on playbook for shipping AI agents to production — tools, MCP servers and patterns that work. Curated by Jemal Hamidun, Head of AI at Alpina Digital.
