From b066e1b9f6f1e7df9d1fd84dfd827403ebaf3011 Mon Sep 17 00:00:00 2001 From: lllyasviel Date: Sun, 28 Jan 2024 08:14:59 -0800 Subject: [PATCH] i --- modules_forge/controlnet.py | 1 + modules_forge/patch_basic.py | 2 ++ 2 files changed, 3 insertions(+) diff --git a/modules_forge/controlnet.py b/modules_forge/controlnet.py index 0936807a..20997d8d 100644 --- a/modules_forge/controlnet.py +++ b/modules_forge/controlnet.py @@ -72,6 +72,7 @@ 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'] if advanced_sigma_weighting is not None: diff --git a/modules_forge/patch_basic.py b/modules_forge/patch_basic.py index d5ba3f89..02666386 100644 --- a/modules_forge/patch_basic.py +++ b/modules_forge/patch_basic.py @@ -129,6 +129,7 @@ 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) @@ -150,6 +151,7 @@ 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