fix weird bug on M1 chip when multiplication assignment does nothing

This commit is contained in:
Tung Nguyen
2023-09-19 16:34:57 +07:00
parent 00a7870a41
commit 7325a08000
+2 -2
View File
@@ -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)