ComfyUI Node

PowerLawCFG

Implements 'Power-law CFG' as found in the same paper (2502.07849). Disables the speed optimization when `cfg=1`, as the negative term no longer cancels out.

By xxiiyu·Created 8 months ago·Updated 8 months ago· 0
PowerLawCFG
  • model
  • MODEL
alpha0.90
parameterizationscore
print_debugfalse
Categoryadvanced/guidance

Inputs (4)

NameTypeDefaultDescription
modelMODEL
alphaFLOAT0.90-0.99–100The exponent for the 'power law,' which finds a number to multiply `cfg` by at each step. Values > 0 are recommended by the paper authors. 0: disable <0: guidance which speeds up convergence to the target at early times >0: dampen guidance if positive and negative are similar; amplify guidance if positive and negative are dissimilar.
parameterizationCOMBOscoreThe space in which to calculate the scale. You do NOT have to match this with your model type, they can be different. In practice, `score` seems to be the most stable. score: The default implementation. x0: 'Rescaled Power-law CFG' in the paper. eps/v/flow: Other parameterizations for completeness's sake.
print_debugBOOLEANfalsePrint this node's calculations to console at each sampling step.

Outputs (1)

NameTypeDescription
MODELMODEL