ComfyUI Node: Automatic CFG - Advanced

Authored by Extraltodeus

Created

Updated

350 stars

Category

model_patches/Automatic_CFG

Inputs

model MODEL
automatic_cfg
  • None
  • soft
  • hard
  • hard_squared
  • range
skip_uncond BOOLEAN
fake_uncond_start BOOLEAN
uncond_sigma_start FLOAT
uncond_sigma_end FLOAT
lerp_uncond BOOLEAN
lerp_uncond_strength FLOAT
lerp_uncond_sigma_start FLOAT
lerp_uncond_sigma_end FLOAT
subtract_latent_mean BOOLEAN
subtract_latent_mean_sigma_start FLOAT
subtract_latent_mean_sigma_end FLOAT
latent_intensity_rescale BOOLEAN
latent_intensity_rescale_method
  • soft
  • hard
  • range
latent_intensity_rescale_cfg FLOAT
latent_intensity_rescale_sigma_start FLOAT
latent_intensity_rescale_sigma_end FLOAT
cond_exp BOOLEAN
cond_exp_normalize BOOLEAN
cond_exp_sigma_start FLOAT
cond_exp_sigma_end FLOAT
cond_exp_method
  • amplify
  • root
  • power
  • erf
  • erf_amplify
  • exp_erf
  • root_erf
  • sine
  • sine_exp
  • sine_exp_diff
  • sine_exp_diff_to_sine
  • sine_root
  • sine_root_diff
  • sine_root_diff_to_sine
  • theDaRkNeSs
  • cosine
  • sign
  • zero
  • previous_average
  • eval
  • attention_modifiers_input_using_cond
  • attention_modifiers_input_using_uncond
  • subtract_attention_modifiers_input_using_cond
  • subtract_attention_modifiers_input_using_uncond
cond_exp_value FLOAT
uncond_exp BOOLEAN
uncond_exp_normalize BOOLEAN
uncond_exp_sigma_start FLOAT
uncond_exp_sigma_end FLOAT
uncond_exp_method
  • amplify
  • root
  • power
  • erf
  • erf_amplify
  • exp_erf
  • root_erf
  • sine
  • sine_exp
  • sine_exp_diff
  • sine_exp_diff_to_sine
  • sine_root
  • sine_root_diff
  • sine_root_diff_to_sine
  • theDaRkNeSs
  • cosine
  • sign
  • zero
  • previous_average
  • eval
  • subtract_attention_modifiers_input_using_cond
  • subtract_attention_modifiers_input_using_uncond
uncond_exp_value FLOAT
fake_uncond_exp BOOLEAN
fake_uncond_exp_normalize BOOLEAN
fake_uncond_exp_method
  • cond_pred
  • previous_average
  • amplify
  • root
  • power
  • erf
  • erf_amplify
  • exp_erf
  • root_erf
  • sine
  • sine_exp
  • sine_exp_diff
  • sine_exp_diff_to_sine
  • sine_root
  • sine_root_diff
  • sine_root_diff_to_sine
  • theDaRkNeSs
  • cosine
  • sign
  • zero
  • eval
  • subtract_attention_modifiers_input_using_cond
  • subtract_attention_modifiers_input_using_uncond
  • attention_modifiers_input_using_cond
  • attention_modifiers_input_using_uncond
fake_uncond_exp_value FLOAT
fake_uncond_multiplier INT
fake_uncond_sigma_start FLOAT
fake_uncond_sigma_end FLOAT
auto_cfg_topk FLOAT
auto_cfg_ref FLOAT
attention_modifiers_global_enabled BOOLEAN
disable_cond BOOLEAN
disable_cond_sigma_start FLOAT
disable_cond_sigma_end FLOAT
save_as_preset BOOLEAN
preset_name STRING
eval_string_cond STRING
eval_string_uncond STRING
eval_string_fake STRING
args_filter STRING
attention_modifiers_positive ATTNMOD
attention_modifiers_negative ATTNMOD
attention_modifiers_fake_negative ATTNMOD
attention_modifiers_global ATTNMOD

Outputs

MODEL

STRING

Extension: ComfyUI-AutomaticCFG

My own version 'from scratch' of a self-rescaling CFG. It isn't much but it's honest work. TLDR: set your CFG at 8 to try it. No burned images and artifacts anymore. CFG is also a bit more sensitive because it's a proportion around 8. Low scale like 4 also gives really nice results since your CFG is not the CFG anymore. Also in general even with relatively low settings it seems to improve the quality.

Authored by Extraltodeus

Run ComfyUI workflows in the Cloud!

No downloads or installs are required. Pay only for active GPU usage, not idle time. No complex setups and dependency issues

Learn more