2024-08-12 10:16:58 +02:00
2024-07-20 17:40:54 +02:00
2024-08-12 10:15:44 +02:00
2024-08-12 10:15:44 +02:00
2024-07-22 15:56:40 +02:00
2024-08-12 10:16:58 +02:00

quick note: This is still a work in progress and some a lot of things may change.

The readme is not up to date and there is more than this.

The node named "Pre CFG gradient scaling" can do some similar stuff to controlnet without inferences.

Pre CFG nodes

A set of nodes to prepare the noise predictions before the CFG function

All can be chained and repeated within the same workflow!

They are to be highly compatible with most nodes.

The order matters and depends on your needs.

The best chaining order is therefore to be determined by your own preferences.

All are to be used like any model patching node, right after the model loader.

Nodes:

Pre CFG automatic scale

image

mode:

  • Automatic CFG: applies the same predictable scaling as my other nodes based on this logic
  • Strict scaling: applies a scaling which will always give the exact desired value. This tends to create artifacts and random blurs if carried through the end.

Support empty uncond:

If you use the already available node named ConditioningSetTimestepRange you can stop generating a negative prediction earlier by letting your negative conditioning go through it while setting it like this:

image

This speeds up your generation speed by two for the steps where there is no negative.

The only issue if you do this is that the CFG function will weight your positive prediction times your CFG scale against nothing and you will get a black image.

"support_empty_uncond" therefore divides your positive prediction by your CFG scale and avoids this issue.

Doing this combination is similar to the "boost" feature of my original automatic CFG node. It can also let you avoid artifacts if you want to use the strict scaling.

If you want to use this option in a chained setup using this node multiple times I recommand to use it only once and on the last.

Pre CFG perp-neg

image

Applies the already known perp-neg logic.

Code taken and adapted from ComfyAnon implementation.

The context length (added after the screenshot of the node) can be set to a higher value if you are using a tensor rt engine requiring a higher context length.

For more details you can check my node related to this "Conditioning crop or fill" where I explain a bit more about this.

Pre CFG sharpening (experimental)

image

Subtract from the current step something from the previous step. This tends to make the images sharper and less saturated.

A negative value can be set.

Pre CFG consensus sharpening (experimental)

image

Using a custom algorithm based on euclidean distances, taking all steps into consideration.

Subtract from the current step something from the result of the custom function. This tends to make the images sharper and less saturated too.

A negative value can be set.

Pre CFG exponentiation (experimental)

image

A value lower than one will simplify the end result and enhance the saturation / contrasts.

A value higher than one will do the opposite and if pushed too far will most likely make a mess.

Pro tip:

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! 😁

Also.. Ironically my repository Automatic-CFG is incompatible with these as it replaces what makes these nodes possible. Hence the auto-cfg node here :)

S
Description
No description provided
Readme
6.7 MiB
Languages
Python 100%