added SamplerHeunCFGpp
I just slapped the Heun part at the end of EulerCFGpp and it slapped me back.
To compare:
Heun / HeunCFGpp / EulerCFGpp
The fact that the Heun part rolls over the result of the CFGpp method seems to rebalance the effect of the CFG scale, which is also appreciable (basically burns less).
temp = [0]
def post_cfg_function(args):
temp[0] = args["uncond_denoised"]
return args["denoised"]
this hack is unnecessary, it can just be written as:
uncond = None
def post_cfg_function(args):
nonlocal uncond
uncond = args["uncond_denoised"]
return args["denoised"]
edit: i guess this is also the alternative version, not the official CFG++.
Hello, indeed I simply took the Euler version as it can be found here. Would you prefer it if I adapted the function before any merging?
Would you prefer it if I adapted the function before any merging?
i'm just a random person suggesting there's a more idiomatic way to extract the uncond into a variable. i have no authority whatsoever. :)
oh okay! :)
I added it to a new repository along with a sampler of mine,