diff options
author | Taithrah <Taithrah@users.noreply.github.com> | 2023-01-08 20:58:53 +0000 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-01-08 20:58:53 +0000 |
commit | e9d7eff70a3429ee299cbdcae1aeb61fc4d2bcbf (patch) | |
tree | 2373cae4f4e4af72ed170647bf393015075791cc /modules/sd_hijack_clip.py | |
parent | 8a27730da5d5b25e28370e8ad94844856a839af9 (diff) | |
parent | 8850fc23b6e8a8e210bdfe4aade81516fb5770f3 (diff) | |
download | stable-diffusion-webui-gfx803-e9d7eff70a3429ee299cbdcae1aeb61fc4d2bcbf.tar.gz stable-diffusion-webui-gfx803-e9d7eff70a3429ee299cbdcae1aeb61fc4d2bcbf.tar.bz2 stable-diffusion-webui-gfx803-e9d7eff70a3429ee299cbdcae1aeb61fc4d2bcbf.zip |
Merge branch 'AUTOMATIC1111:master' into small-touch-up
Diffstat (limited to 'modules/sd_hijack_clip.py')
-rw-r--r-- | modules/sd_hijack_clip.py | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/modules/sd_hijack_clip.py b/modules/sd_hijack_clip.py index 5520c9b2..852afc66 100644 --- a/modules/sd_hijack_clip.py +++ b/modules/sd_hijack_clip.py @@ -247,9 +247,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
|