EasyUse/PreSamplinggenerated

DynamicThresholdingFull(dynamicThresholdingFull)

DynamicThresholdingFull node from ComfyUI-Easy-Use.

dynamic Thresholding Full

model
MODEL
mimic_scale
7.0
threshold_percentile
1.00
mimic_mode
COMBO
mimic_scale_min
0.0
cfg_mode
COMBO
cfg_scale_min
0.0
sched_val
1.00
separate_feature_channels
COMBO
scaling_startpoint
COMBO
variability_measure
COMBO
interpolate_phi
1.00
Easy Use

Description

The DynamicThresholdingFull node applies dynamic thresholding to the model's classifier-free guidance (CFG) predictions. It is designed to reduce oversaturation and artifacts that can occur with high CFG scales by dynamically clipping the predicted latent values, based on a percentile of the current noise prediction. The node also supports scheduling the effective CFG scale and the mimic scale over the sampling steps, as well as separate feature channel handling for finer control.

This node belongs to the EasyUse/PreSampling category and outputs a modified MODEL for use in the sampling pipeline.

Inputs

  • model: The input diffusion model to which dynamic thresholding will be applied.

  • mimic_scale: The CFG scale that the dynamic thresholding mechanism mimics. This is the scale level used for the thresholding calculation.
    Default: 7, range: 0.0 to 100.0, step: 0.5.

  • threshold_percentile: The percentile used to determine the clipping threshold. A lower value clips more aggressively, while a higher value allows larger latent values to pass through.
    Default: 1, range: 0.0 to 1.0, step: 0.01.

  • mimic_mode: Selects the scheduling mode for the mimic scale over the sampling steps. This controls how the mimic scale changes from its initial value toward mimic_scale_min.

  • mimic_scale_min: The minimum value that the scheduled mimic scale can reach.
    Default: 0, range: 0.0 to 100.0, step: 0.5.

  • cfg_mode: Selects the scheduling mode for the CFG scale over the sampling steps. This controls how the effective CFG scale changes toward cfg_scale_min.

  • cfg_scale_min: The minimum value that the scheduled CFG scale can reach.
    Default: 0, range: 0.0 to 100.0, step: 0.5.

  • sched_val: A general scheduling value used by the selected scheduling modes to control how quickly or smoothly the scales progress.
    Default: 1, range: 0.0 to 100.0, step: 0.01.

  • separate_feature_channels: Whether to apply dynamic thresholding separately to each feature channel or across all channels together.
    Options: enable, disable.
    Default: enable.

  • scaling_startpoint: Determines the starting point for scaling calculations. This affects how the dynamic thresholding normalizes the latent values.

  • variability_measure: Selects the statistical measure used to quantify variability when computing the dynamic threshold. Common options are based on deviation measures such as average deviation or standard deviation.

  • interpolate_phi: Blending factor between the original CFG prediction and the dynamic-thresholded prediction. A value of 1.0 applies full dynamic thresholding, while lower values blend back toward normal CFG behavior.
    Default: 1, range: 0.0 to 1.0, step: 0.01.

Outputs

  • MODEL: The modified model with dynamic thresholding applied. Connect this model to a sampler in place of the original model.

Usage Notes

  • Dynamic thresholding is most useful when using high CFG scales, where standard samplers may produce oversaturated or burnt-out results.
  • If you do not want the CFG scale to be scheduled downward during sampling, set cfg_scale_min to the same value as your intended CFG scale.
  • mimic_scale does not need to match the sampler's CFG scale exactly; it controls the thresholding strength and can be tuned independently.
  • threshold_percentile is a sensitive parameter. Start with the default and adjust gradually.
  • Enabling separate_feature_channels can preserve finer detail, but may also change the overall look of the result more dramatically than thresholding across all channels.
  • interpolate_phi provides a convenient way to blend between standard CFG and dynamic thresholding without changing the other parameters.

Comments

Sign in with GitHub to join the discussion.

Loading comments…