additional minor cleaning

This commit is contained in:
Alex "mcmonkey" Goodwin
2023-10-29 08:14:45 -07:00
parent 83f619ab37
commit 5cce1c8e11
2 changed files with 7 additions and 7 deletions
+6 -6
View File
@@ -29,17 +29,17 @@ class DynamicThresholdingComfyNode:
dynamic_thresh = DynThresh(mimic_scale, threshold_percentile, mimic_mode, mimic_scale_min, cfg_mode, cfg_scale_min, sched_val, 0, 999, separate_feature_channels == "enable", scaling_startpoint, variability_measure, interpolate_phi)
def sampler_dyn_thrash(args):
x_out = args["cond"]
def sampler_dyn_thresh(args):
cond = args["cond"]
uncond = args["uncond"]
cond_scale = args["cond_scale"]
time_step = args["timestep"]
dynamic_thresh.step = 999 - time_step[0]
return dynamic_thresh.dynthresh(x_out, uncond, cond_scale, None)
return dynamic_thresh.dynthresh(cond, uncond, cond_scale, None)
m = model.clone()
m.set_model_sampler_cfg_function(sampler_dyn_thrash)
m.set_model_sampler_cfg_function(sampler_dyn_thresh)
return (m, )
class DynamicThresholdingSimpleComfyNode:
@@ -62,7 +62,7 @@ class DynamicThresholdingSimpleComfyNode:
dynamic_thresh = DynThresh(mimic_scale, threshold_percentile, "CONSTANT", 0, "CONSTANT", 0, 0, 0, 999, False, "MEAN", "AD", 1)
def sampler_dyn_thrash(args):
def sampler_dyn_thresh(args):
cond = args["cond"]
uncond = args["uncond"]
cond_scale = args["cond_scale"]
@@ -72,5 +72,5 @@ class DynamicThresholdingSimpleComfyNode:
return dynamic_thresh.dynthresh(cond, uncond, cond_scale, None)
m = model.clone()
m.set_model_sampler_cfg_function(sampler_dyn_thrash)
m.set_model_sampler_cfg_function(sampler_dyn_thresh)
return (m, )
+1 -1
View File
@@ -212,7 +212,7 @@ class CustomCFGDenoiser(cfgdenoisekdiff):
weights = torch.tensor(conds_list, device=uncond.device).select(2, 1)
weights = weights.reshape(*weights.shape, 1, 1, 1)
self.main_class.step = self.step
if self.main_class.experiment_mode >= 4 and self.main_class.experiment_mode <= 5:
# https://arxiv.org/pdf/2305.08891.pdf "Rescale CFG". It's not good, but if you want to test it, just set experiment_mode = 4 + phi.
denoised = torch.clone(denoised_uncond)