Nodes/Dynamic Thresholding/DynamicThresholdingFull
ComfyUI Node Runs on cloud

DynamicThresholdingFull

DynamicThresholdingFull - ComfyUI Node

By mcmonkeyprojects·Created 4 years ago·Updated about a year ago· 1,224
DynamicThresholdingFull
  • model
  • MODEL
mimic_scale7.0
threshold_percentile1.00
mimic_mode
mimic_scale_min0.0
cfg_mode
cfg_scale_min0.0
sched_val1.00
separate_feature_channels
scaling_startpoint
variability_measure
interpolate_phi1.00

Crank CFG scale up high enough to actually make a model obey your prompt, and you usually pay for it in blown-out colors, crunchy contrast, and faces that start melting - the "deep fried" look. Dynamic Thresholding (the "CFG Scale Fix") exists specifically to let you run CFG hot without that tax, and DynamicThresholdingFull is the version that hands you every dial the technique has, rather than the two-slider version (DynamicThresholdingSimple) most people actually need.

The mechanism. This is a MODEL patch node - it wraps your checkpoint's sampling function so CFG gets computed differently at every step. Alongside your real, aggressive CFG prediction, it also computes a "mimicked" prediction at a gentler guidance scale, then clamps the extreme values in the real prediction back toward that milder reference before advancing to the next step. That's the "dynamic thresholding" in the name - clamping outlier values to a percentile rather than letting them run wild, the same trick Google used in Imagen to keep high-guidance samples from saturating. The technique itself traces to Birch-san's original research; mcmonkey (Alex Goodwin, also the developer behind SwarmUI) built the extension, gave it a UI, and did further development plus the ComfyUI and SwarmUI ports. It's been shipping since January 2023, so this is one of the older tools still kicking around the ecosystem - genuinely useful if you're on SD1.5, SDXL, Pony, or Illustrious pushing CFG past 10; largely irrelevant if you're on a 2026-era distilled checkpoint that already runs CFG pinned near 1, where there's nothing to clamp.

What Full adds over Simple. The two shared knobs work the same way: mimic_scale (default 7) sets the CFG value the mimicked reference pass targets, and threshold_percentile (default 1) sets how hard the clamp bites. Full's extra inputs are all about turning those from fixed numbers into something that changes across the sampling run:

  • mimic_mode and cfg_mode - each a 12-option curve shape (Constant, Linear Up/Down, Cosine Up/Down, Power Up/Down, Sawtooth, and a few more) that schedules how the mimic scale and the real CFG scale ramp across your sampling steps, instead of sitting fixed the whole time.
  • mimic_scale_min and cfg_scale_min - the floor each of those schedules ramps down to (or up from), paired with mimic_scale/original CFG as the other end of the curve.
  • sched_val - a tuning value that shapes the curves above (exponent/period-style parameter for the power and repeating modes).
  • separate_feature_channels (enable/disable) - whether the clamping math treats each latent channel independently or the tensor as a whole.
  • scaling_startpoint (MEAN or ZERO) - whether the clamp centers on the mean of the values or on zero.
  • variability_measure (AD or STD) - average deviation vs. standard deviation as the statistic used to judge how far a value has to be from center before it gets clamped.
  • interpolate_phi (default 1, 0-1) - blends between the fully-clamped result and the untouched one, softening the effect instead of applying it at full strength everywhere.

The single output, same as Simple, is MODEL - wire it straight into your KSampler's model input. And the same rule applies: none of this does anything if your KSampler's CFG is left at a normal value. You still have to actually push CFG up on the sampler for there to be something worth clamping.

Installing it. No documented Manager steps in the README (marked TODO there), though it's an established enough pack that searching "Dynamic Thresholding" in ComfyUI Manager is worth a shot first. The manual path the README walks through:

cd ComfyUI/custom_nodes
git clone https://github.com/mcmonkeyprojects/sd-dynamic-thresholding

Restart ComfyUI, then find the node under advanced/mcmonkey in the add-node menu (or search "dynamic thresholding" on the canvas). No model files to download and no extra Python dependencies - it's a pure sampling-function patch, so it's about as cheap an install as custom nodes get.

Where people get stuck. Most of the confusion with Full isn't installation, it's that the extra parameters look like they should be the primary controls when they're really fine-tuning on top of mimic_scale and threshold_percentile. If you're not deliberately trying to schedule the effect across steps, leave mimic_mode/cfg_mode at Constant and the _min fields alone - start with just the two Simple-equivalent values and only reach for the rest once you know what you're chasing. The one real compatibility note from the README: this works with essentially any KSampler variant, including custom ones, as long as that sampler wraps ComfyUI's internal sampling function rather than fully replacing it - which covers most custom samplers, but is the first thing to suspect if you've wired this in and truly nothing changes.

Categoryadvanced/mcmonkey

Inputs (12)

NameTypeDefaultDescription
modelMODEL
mimic_scaleFLOAT7.00–100
threshold_percentileFLOAT1.000–1
mimic_modeCOMBO12 options: Constant, Linear Down, Cosine Down, Half Cosine Down, Linear Up, Cosine Up, +6
mimic_scale_minFLOAT0.00–100
cfg_modeCOMBO12 options: Constant, Linear Down, Cosine Down, Half Cosine Down, Linear Up, Cosine Up, +6
cfg_scale_minFLOAT0.00–100
sched_valFLOAT1.000–100
separate_feature_channelsCOMBO2 options: enable, disable
scaling_startpointCOMBO2 options: MEAN, ZERO
variability_measureCOMBO2 options: AD, STD
interpolate_phiFLOAT1.000–1

Outputs (1)

NameTypeDescription
MODELMODEL