DynamicThresholdingFull(dynamicThresholdingFull)
DynamicThresholdingFull node from ComfyUI-Easy-Use.
dynamic Thresholding Full
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.0to100.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.0to1.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.0to100.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.0to100.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.0to100.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.0applies full dynamic thresholding, while lower values blend back toward normal CFG behavior.
Default:1, range:0.0to1.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_minto the same value as your intended CFG scale. mimic_scaledoes not need to match the sampler's CFG scale exactly; it controls the thresholding strength and can be tuned independently.threshold_percentileis a sensitive parameter. Start with the default and adjust gradually.- Enabling
separate_feature_channelscan preserve finer detail, but may also change the overall look of the result more dramatically than thresholding across all channels. interpolate_phiprovides 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.