Skip to content

Commit 5c8f91b

Browse files
committed
fix autograd which i broke for no good reason when implementing SDXL
1 parent 6b877c3 commit 5c8f91b

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

modules/sd_hijack_clip.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -273,9 +273,9 @@ def process_tokens(self, remade_batch_tokens, batch_multipliers):
273273
# restoring original mean is likely not correct, but it seems to work well to prevent artifacts that happen otherwise
274274
batch_multipliers = torch.asarray(batch_multipliers).to(devices.device)
275275
original_mean = z.mean()
276-
z *= batch_multipliers.reshape(batch_multipliers.shape + (1,)).expand(z.shape)
276+
z = z * batch_multipliers.reshape(batch_multipliers.shape + (1,)).expand(z.shape)
277277
new_mean = z.mean()
278-
z *= (original_mean / new_mean)
278+
z = z * (original_mean / new_mean)
279279

280280
return z
281281

0 commit comments

Comments
 (0)