← See All Custom Node Packs

sd-dynamic-thresholding

1227

Run ComfyUI Easily with InstaSD

Skip the complex setup and run ComfyUI online. InstaSD helps creative professionals build workflows and deploy them to the world:

  • One-click deployment
  • Any model, any node
  • Powerful GPUs for rapid iteration
Get Started

DynamicThresholdingFull

DynamicThresholdingFull Node Documentation

Overview

The DynamicThresholdingFull node is a component of the Dynamic Thresholding (CFG Scale Fix) extension for ComfyUI. This extension has been designed to address issues that arise when using higher classifier-free guidance (CFG) scales in Stable Diffusion models, particularly concerning color discrepancies. The node operates by clamping the latent variables between diffusion steps, ensuring that the generation process remains stable and produces more visually consistent results.

Functionality

What This Node Does

This node applies dynamic thresholding to the latent spaces during the image generation process, allowing users to push the CFG scales higher without encountering the usual associated problems. This means that you can achieve more pronounced image features and sharper contrasts without suffering from color issues or artifacts that typically occur at high CFG scales.

Inputs

The DynamicThresholdingFull node accepts the following primary input:

  • Model: This input requires a reference to the Stable Diffusion model, which the node will modify by adding its dynamic thresholding capabilities. The model should be linked from the preceding node in your workflow.

Outputs

The node produces the following output:

  • Modified Model: The output is a version of the inputted Stable Diffusion model that includes the dynamic thresholding adjustments. This modified model can then be connected to subsequent nodes, such as sampling nodes, to continue the image generation process.

Usage in ComfyUI Workflows

How to Use

  1. Installation: First, ensure that the Dynamic Thresholding extension is installed and ComfyUI is correctly set up. You can install the extension by cloning the repository into the ComfyUI/custom_nodes directory.
  2. Node Integration: Within ComfyUI, locate and add the DynamicThresholdingFull node from the node menu, typically found under advanced/mcmonkey/.
  3. Node Connection: Connect your model to the DynamicThresholdingFull node. Then, connect the output of this node to the model input of your KSampler or another compatible rendering node.
  4. Enable and Configure: Ensure the node is enabled. Configure the node's parameters (if any are exposed via the ComfyUI interface) according to your desired CFG scale and other image generation requirements.
  5. Generate: Once configured, run your workflow. The dynamic thresholding will allow you to utilize high CFG scales without the typical issues.

Special Features and Considerations

Compatibility

  • The DynamicThresholdingFull node works seamlessly with any variant of the KSampler node, making it highly compatible with custom workflows. This flexibility ensures that you can incorporate dynamic thresholding without needing to modify existing sampling functions.

Considerations

  • Performance: While dynamic thresholding allows for more aggressive CFG scale settings, it's essential to balance the parameters according to your hardware's capabilities and the desired output quality.
  • Underlying Mechanics: The node modifies the internals of the model process, which might introduce slight deviations in expected outcomes compared to non-thresholded workflows. It’s recommended to experiment with different settings to find the optimal balance for your projects.

Overall, the DynamicThresholdingFull node offers an effective way to enhance the capabilities of your Stable Diffusion image generation process by improving results generated with high CFG scales.

Related nodes in sd-dynamic-thresholding

Want to try sd-dynamic-thresholding without installing anything? Run ComfyUI online on InstaSD's cloud GPUs — no setup required.