From 2ff92a845b99bafb5cb6be24e7adac2ec3429dcc Mon Sep 17 00:00:00 2001 From: comfyanonymous <121283862+comfyanonymous@users.noreply.github.com> Date: Wed, 17 May 2023 02:01:21 -0400 Subject: [PATCH] Update sampler_rescalecfg.py --- sampler_rescalecfg.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sampler_rescalecfg.py b/sampler_rescalecfg.py index 6e1289f..784c9b1 100644 --- a/sampler_rescalecfg.py +++ b/sampler_rescalecfg.py @@ -14,7 +14,7 @@ class RescaleClassifierFreeGuidance: def patch(self, model, multiplier): - def sampler_tonemap_reinhard(cond, uncond, cond_scale): + def rescale_cfg(cond, uncond, cond_scale): x_cfg = uncond + cond_scale * (cond - uncond) ro_pos = torch.std(cond, dim=(1,2,3), keepdim=True) ro_cfg = torch.std(x_cfg, dim=(1,2,3), keepdim=True) @@ -25,7 +25,7 @@ class RescaleClassifierFreeGuidance: return x_final m = model.clone() - m.set_model_sampler_cfg_function(sampler_tonemap_reinhard) + m.set_model_sampler_cfg_function(rescale_cfg) return (m, )