DynamicThresholdingFull
Mcmonkey's CFG Scale Fix, along for the ride in Easy-Use
- model
- MODEL
This node isn't originally Easy-Use's - the pack's own credits table names it straight: it's sd-dynamic-thresholding, ported in. That project is Alex "mcmonkey" Goodwin's - the same person who now runs SwarmUI, was an SD3 paper co-author, and left Stability in 2024. He built Dynamic Thresholding (also known by its friendlier name, "CFG Scale Fix") back in January 2023, wrapping a latent-clamping technique credited to Birch-san. Easy-Use just bundles the ComfyUI port so you don't need a second custom node pack installed to use it.
What problem this actually solves
Push CFG (classifier-free guidance) high enough on an SD 1.5 or SDXL-era model and you don't get "more prompt adherence for free" - you get color and contrast damage. Blown highlights, oversaturation, a generally "cooked" look, because the guidance math amplifies extremes in the latent faster than the model can keep them sane. Dynamic Thresholding fixes this by clamping latent values between denoising steps, so you can push your actual sampling cfg well past where it would normally break, while this node keeps the output looking like it was generated at a lower, saner guidance scale.
Mechanically, that's what mimic_scale is: the guidance level the clamping pretends you're at, even while your real sampling cfg runs higher. threshold_percentile controls how aggressive the clamp is - at 1 it's effectively off, lower values clamp harder against a percentile of the latent's value distribution rather than its literal max, which tends to look better than a hard clip.
The inputs that matter, and the ones that don't
model in, MODEL out - this node patches your model directly, so it slots in right after your loader and before your sampler, the same place a LoRA loader would sit.
mimic_mode and cfg_mode are schedule-curve shapes (Constant, Linear/Cosine/Power/Sawtooth variants, up or down or repeating) controlling how the clamping strength changes across the sampling run rather than staying fixed - paired with mimic_scale_min/cfg_scale_min as floors those curves taper toward, and sched_val tuning the curve's exponent. Honestly, most people never touch these - Constant on both, defaults everywhere else, gets you 90% of the benefit.
separate_feature_channels, scaling_startpoint (MEAN vs ZERO), and variability_measure (AD vs STD) are the internal statistics the clamp is computed from. These are genuinely deep-cut - leave them at their defaults unless you're specifically chasing a known fix from the sd-dynamic-thresholding project's own docs for a particular artifact. interpolate_phi blends between two internal clamping methods, another one worth leaving alone on a first pass.
Installing it
ComfyUI Manager: search ComfyUI Easy Use, install, restart - this node comes along with the rest of the pack, no separate install needed. By hand:
cd ComfyUI/custom_nodes
git clone https://github.com/yolain/ComfyUI-Easy-Use
Windows: double-click install.bat. Linux/Mac: run pip install -r requirements.txt yourself. Restart ComfyUI.
Where people get stuck
The most common mistake is expecting this node to change how the image looks at your normal cfg - it won't, because at a normal cfg there's nothing to clamp. The whole point is running your sampler's cfg noticeably higher than you normally would (think well past the usual 6–8 territory) and letting this node keep the output sane; if you leave cfg where it always was, you've just added an inert patch to your graph. Second: because mimic_scale defaults to 7, if your actual sampling cfg is lower than that, the clamp can end up doing very little or behaving oddly - this node is built for the "I want to push cfg way up" use case, not for tuning at normal guidance levels. And if colors still look blown out after adding it, drop threshold_percentile below its default of 1 before touching any of the curve-shape parameters - that's the one setting that actually controls clamp strength.
Inputs (12)
| Name | Type | Default | Description |
|---|---|---|---|
| model | MODEL | — | |
| mimic_scale | FLOAT | 7.00–100 | — |
| threshold_percentile | FLOAT | 1.000–1 | — |
| mimic_mode | COMBO | 12 options: Constant, Linear Down, Cosine Down, Half Cosine Down, Linear Up, Cosine Up, +6 | |
| mimic_scale_min | FLOAT | 0.00–100 | — |
| cfg_mode | COMBO | 12 options: Constant, Linear Down, Cosine Down, Half Cosine Down, Linear Up, Cosine Up, +6 | |
| cfg_scale_min | FLOAT | 0.00–100 | — |
| sched_val | FLOAT | 1.000–100 | — |
| separate_feature_channels | COMBO | 2 options: enable, disable | |
| scaling_startpoint | COMBO | 2 options: MEAN, ZERO | |
| variability_measure | COMBO | 2 options: AD, STD | |
| interpolate_phi | FLOAT | 1.000–1 | — |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| MODEL | MODEL | — |