From 45e56c300380e069914ec6a66a32c08296c8c48f Mon Sep 17 00:00:00 2001 From: zhiselfly Date: Fri, 23 Aug 2024 21:41:11 +0800 Subject: [PATCH] Fixed the "doesn't match the broadcast shape" issue in ControlNet++ (Multi) when there are two or more Inputs due to insufficient memory --- adv_control/control_plusplus.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/adv_control/control_plusplus.py b/adv_control/control_plusplus.py index b4da295..a6f5ca9 100644 --- a/adv_control/control_plusplus.py +++ b/adv_control/control_plusplus.py @@ -323,8 +323,8 @@ class ControlNetPlusPlusAdvanced(ControlNet, AdvancedControlBase): if self.cond_hint[i] is not None: if x_noisy.shape[0] != self.cond_hint[i].shape[0]: self.cond_hint[i] = broadcast_image_to_extend(self.cond_hint[i], x_noisy.shape[0], batched_number) - if self.cond_hint_types is not None: - self.cond_hint_types = broadcast_image_to_extend(self.cond_hint_types, x_noisy.shape[0], batched_number) + if self.cond_hint_types is not None and x_noisy.shape[0] != self.cond_hint_types.shape[0]: + self.cond_hint_types = broadcast_image_to_extend(self.cond_hint_types, x_noisy.shape[0], batched_number, False) # prepare mask_cond_hint self.prepare_mask_cond_hint(x_noisy=x_noisy, t=t, cond=cond, batched_number=batched_number, dtype=dtype)