ComfyUI Extension: Skimmed_CFG

Authored by Extraltodeus

Created

Updated

152 stars

A powerful anti-burn allowing much higher CFG scales for latent diffusion models (for ComfyUI)

Custom Nodes (0)

    README

    Skimmed_CFG

    A powerful anti-burn allowing much higher CFG scales for latent diffusion models (for ComfyUI)

    CFG below at: 6/8/12/16/24/32, skimming scale at 6

    6_8_12_16_24_32

    Simply plug after the model loader (same for all the fours nodes):

    image

    Tested with SD3.5 turbo. To make it work set the skimming scale at 2~2.5

    nodes:

    • Skimmed CFG: My version first version of this, works like a charm!
    • Skimmed CFG - replace: replace the values within the negative by those in the positive prediction, nullifying (actually giving an equivalent scale of 1) the effect of values targeted by the filter.
    • Skimmed CFG - linear interpolation: instead of replacing, does a linear interpolation in between the values. Highly recommanded!
    • Skimmed CFG - linear interpolation dual scales: Two scales. One named "positive" and one.. well "negative". The name is more related to a visualy intuitive relation rather than fully from the predictions. A higher positive will tend to go towards high saturations and vice versa with the other slider.
    • Skimmed CFG - Difference CFG: Other algorithms based on changes depending on the scale. Brings back what goes too far in comparison.
    • Skimmed CFG - Timed flip: To be used with normal scales. Enhances the randomness and overall quality of the image. A bit less of an antiburn and a lot more of an enhancer. SDE Samplers react extremely well to it.

    special option (first node only):

    • full_skim_negative: fully skim some part of the conflicting influence.
    • disable_flipping_filter: the skimming CFG will have much more control. It is meant to be used with the full_skim_negative toggle on. (the last image of this readme is an example)

    Side-effects:

    • better prompt adherence
    • sharper images
    • less mess / more randomness due to less conflicts in between the positive and negative predictions
    • something something sometimes fused fingers with too low skimming CFG scale and too low amount of steps.

    Tips:

    • The skimming scale is basically how much do you like them burned. 3 was the intended scale but suit to your needs.
    • The SDE samplers can still burn a little but much less
    • The SDE samplers can still totaly do nonsense with low steps (not with the node named "Timed flip")
    • A too low skimming scale may require to do more steps
    • Recommanded skim: 2-3 for maximum antiburn, 5-7 for colorful/strong style. 4 is cruise scale.
    • a good negative prompt is a style negative prompt
    • to use super high scales it is not a bad idea to cut the negative before the end. You can find in this repository a node named "Support empty uncond". Plug it after the skimmed cfg node. Then menu>advanced>conditioning>ConditioningSetTimestepRange and set the and at ~65%. This will avoid potential artifacts.

    Pro tip:

    It would be actually nice to have some support! because like this I will continue to share my findings!

    Did you know that my first activity is to write creative model merging functions?

    While the code is too much of a mess to be shared, I do expose and share my models. You can find them in this gallery! 😁

    Other examples with a CFG at 100

    Base image 🤭

    00417UI_00001_

    Linear interpolation dual scale 10/0

    00409UI_00001_

    Linear interpolation dual scale 5/0

    00416UI_00001_

    Linear interpolation scale 5

    00407UI_00001_

    Replace

    00405UI_00001_

    Skimmed CFG node skimming scale at 4

    00419UI_00001_

    Skimmed CFG node skimming scale at 4 with razor skim

    00420UI_00001_

    full_skim_negative / disable_flipping_filter / skimming scale at 6 / CFG scale at 32

    00002UI_00002_

    do not lick the screen