ComfyUI-AutomaticCFG

If your image was a pizza and the CFG the temperature of your oven: this is a thermostat that ensures it is always cooked like you want. Also adds a 30% speed i

What is ComfyUI-AutomaticCFG?

If your image was a pizza and the CFG the temperature of your oven: this is a thermostat that ensures it is always cooked like you want. Also adds a 30% speed increase. For ComfyUI / StableDiffusion

Overview of ComfyUI-AutomaticCFG

What it is

ComfyUI-AutomaticCFG is a custom node for ComfyUI and StableDiffusion that implements a self-rescaling CFG (Classifier-Free Guidance) mechanism to prevent image burning and artifacts. It also includes a warp drive node that can increase generation speed by up to 160% when used with the AYS scheduler. The node modifies the CFG behavior during sampling by rescaling it at each step based on the average min/max values, aiming for a desired output intensity. It is licensed under Apache-2.0 and is open source.

Key features

  • Self-rescaling CFG that prevents burns and artifacts by automatically adjusting the CFG scale at each step.
  • Warp drive node that uses the previous step to determine a negative, cutting generation time by half for approximately 3/4 of the steps, achieving up to 160% speed increase.
  • Boost toggle that turns off negative guidance when sigmas are near 1, doubling inference speed.
  • Negative strength lerp that interpolates between conditioned and unconditioned outputs.
  • Custom attention modifiers and presets (loaded from JSON files) that can modify attention mechanisms, with several built-in presets for different styles.
  • Works with SDXL, SD 1.5, PixArt Sigma, and SD3 (without boost features for SD3).

Use cases

  • Generating higher quality images with fewer artifacts and less burning compared to standard CFG.
  • Enabling more creative and varied outputs from prompts, especially at lower CFG scales (e.g., 4).
  • Speeding up inference significantly while maintaining or improving image quality.
  • Experimenting with different attention modifications and CFG behaviors through presets.

Getting started

See the repository README for installation and usage instructions.

License and pricing

This project is licensed under Apache-2.0 and is open source. No pricing information is provided beyond the open source license.

Based on the project's public README and repository metadata.

Add this badge to your README

Featured on YunoDB Badge styles & help

Maintain this project? Show that it is featured on YunoDB.

Markdown[![Featured on YunoDB](https://yunodb.com/badge/extraltodeuscomfyui-automaticcfg.svg)](https://yunodb.com/tools/extraltodeuscomfyui-automaticcfg?utm_source=github&utm_medium=badge)
HTML<a href="https://yunodb.com/tools/extraltodeuscomfyui-automaticcfg?utm_source=github&utm_medium=badge"><img src="https://yunodb.com/badge/extraltodeuscomfyui-automaticcfg.svg" alt="Featured on YunoDB" height="20"></a>