From 3293b2b8df7c2a769e0835175785bf4ac1ef80e9 Mon Sep 17 00:00:00 2001 From: lllyasviel Date: Sun, 28 Jan 2024 08:19:18 -0800 Subject: [PATCH] i --- modules_forge/controlnet.py | 2 +- modules_forge/patch_basic.py | 2 -- 2 files changed, 1 insertion(+), 3 deletions(-) diff --git a/modules_forge/controlnet.py b/modules_forge/controlnet.py index 20997d8d..48e924fa 100644 --- a/modules_forge/controlnet.py +++ b/modules_forge/controlnet.py @@ -72,8 +72,8 @@ def compute_controlnet_weighting( return control cond_or_uncond = transformer_options['cond_or_uncond'] - cond_or_uncond_size = transformer_options['cond_or_uncond_size'] sigmas = transformer_options['sigmas'] + cond_or_uncond_size = int(sigmas.shape[0]) if advanced_sigma_weighting is not None: advanced_sigma_weighting = advanced_sigma_weighting(sigmas) diff --git a/modules_forge/patch_basic.py b/modules_forge/patch_basic.py index 02666386..d5ba3f89 100644 --- a/modules_forge/patch_basic.py +++ b/modules_forge/patch_basic.py @@ -129,7 +129,6 @@ def patched_calc_cond_uncond_batch(model, cond, uncond, x_in, timestep, model_op patches = p.patches batch_chunks = len(cond_or_uncond) - cond_or_uncond_size = int(timestep.shape[0]) input_x = torch.cat(input_x) c = cond_cat(c) timestep_ = torch.cat([timestep] * batch_chunks) @@ -151,7 +150,6 @@ def patched_calc_cond_uncond_batch(model, cond, uncond, x_in, timestep, model_op transformer_options["cond_or_uncond"] = cond_or_uncond[:] transformer_options["sigmas"] = timestep - transformer_options["cond_or_uncond_size"] = cond_or_uncond_size c['transformer_options'] = transformer_options