aboutsummaryrefslogtreecommitdiffstats
path: root/modules
diff options
context:
space:
mode:
authorAUTOMATIC1111 <16777216c@gmail.com>2023-07-26 10:03:52 +0000
committerAUTOMATIC1111 <16777216c@gmail.com>2023-07-26 10:03:52 +0000
commit8284ebd94c4d4f7e7141ebb47af206faab66ffed (patch)
tree5790bbc65f4df4951db12f56ca8704300830613f /modules
parentdeed8439d5979714c2d49d8a8bb45e9940fdf81a (diff)
downloadstable-diffusion-webui-gfx803-8284ebd94c4d4f7e7141ebb47af206faab66ffed.tar.gz
stable-diffusion-webui-gfx803-8284ebd94c4d4f7e7141ebb47af206faab66ffed.tar.bz2
stable-diffusion-webui-gfx803-8284ebd94c4d4f7e7141ebb47af206faab66ffed.zip
fix autograd which i broke for no good reason when implementing SDXL
Diffstat (limited to 'modules')
-rw-r--r--modules/sd_hijack_clip.py4
1 files changed, 2 insertions, 2 deletions
diff --git a/modules/sd_hijack_clip.py b/modules/sd_hijack_clip.py
index 5443e609..990533fe 100644
--- a/modules/sd_hijack_clip.py
+++ b/modules/sd_hijack_clip.py
@@ -273,9 +273,9 @@ class FrozenCLIPEmbedderWithCustomWordsBase(torch.nn.Module):
# restoring original mean is likely not correct, but it seems to work well to prevent artifacts that happen otherwise
batch_multipliers = torch.asarray(batch_multipliers).to(devices.device)
original_mean = z.mean()
- z *= batch_multipliers.reshape(batch_multipliers.shape + (1,)).expand(z.shape)
+ z = z * batch_multipliers.reshape(batch_multipliers.shape + (1,)).expand(z.shape)
new_mean = z.mean()
- z *= (original_mean / new_mean)
+ z = z * (original_mean / new_mean)
return z