From 7325a08000479e2f5c5700c540957e68e1140b0d Mon Sep 17 00:00:00 2001 From: Tung Nguyen Date: Tue, 19 Sep 2023 16:34:57 +0700 Subject: [PATCH] fix weird bug on M1 chip when multiplication assignment does nothing --- control.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/control.py b/control.py index a756bf7..6c57b1a 100644 --- a/control.py +++ b/control.py @@ -246,13 +246,13 @@ class ControlNetAdvanced(ControlNet): # apply strength for each batched cond/uncond for b in range(batched_number): - x[(latent_count*b)+real_index] *= keyframe.strength + x[(latent_count*b)+real_index] = x[(latent_count*b)+real_index] * keyframe.strength # zero them out by multiplying by zero for batch_index in indeces_to_zero: # apply zero for each batched cond/uncond for b in range(batched_number): - x[(latent_count*b)+batch_index] *= 0.0 + x[(latent_count*b)+batch_index] = 0.0 def copy(self): c = ControlNetAdvanced(self.control_model, self.timestep_keyframes, global_average_pooling=self.global_average_pooling)