Skip to content

Commit 949843e

Browse files
authored
Merge PR #165 from zhiselfly/main - ControlNet++ shape fix
Fixed the "doesn't match the broadcast shape" issue in ControlNet++ (…
2 parents 1b3cb5f + 45e56c3 commit 949843e

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

adv_control/control_plusplus.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -323,8 +323,8 @@ def get_control_advanced(self, x_noisy: Tensor, t, cond, batched_number):
323323
if self.cond_hint[i] is not None:
324324
if x_noisy.shape[0] != self.cond_hint[i].shape[0]:
325325
self.cond_hint[i] = broadcast_image_to_extend(self.cond_hint[i], x_noisy.shape[0], batched_number)
326-
if self.cond_hint_types is not None:
327-
self.cond_hint_types = broadcast_image_to_extend(self.cond_hint_types, x_noisy.shape[0], batched_number)
326+
if self.cond_hint_types is not None and x_noisy.shape[0] != self.cond_hint_types.shape[0]:
327+
self.cond_hint_types = broadcast_image_to_extend(self.cond_hint_types, x_noisy.shape[0], batched_number, False)
328328

329329
# prepare mask_cond_hint
330330
self.prepare_mask_cond_hint(x_noisy=x_noisy, t=t, cond=cond, batched_number=batched_number, dtype=dtype)

0 commit comments

Comments
 (0)