aboutsummaryrefslogtreecommitdiffstats
path: root/modules/sd_hijack.py
diff options
context:
space:
mode:
authorAUTOMATIC1111 <16777216c@gmail.com>2022-09-07 19:29:44 +0000
committerGitHub <noreply@github.com>2022-09-07 19:29:44 +0000
commit296d012423f8d1862a63680443bb88b7d904ba4e (patch)
treef0dcc162fb3b3fa97d84d9c9ac7922203fc11df9 /modules/sd_hijack.py
parentee29bb77bfe3d2095bc08861bcdebeea20b890f1 (diff)
parentba1124b326280202cb583bbdc669fb5303bbd3e3 (diff)
downloadstable-diffusion-webui-gfx803-296d012423f8d1862a63680443bb88b7d904ba4e.tar.gz
stable-diffusion-webui-gfx803-296d012423f8d1862a63680443bb88b7d904ba4e.tar.bz2
stable-diffusion-webui-gfx803-296d012423f8d1862a63680443bb88b7d904ba4e.zip
Merge pull request #108 from xeonvs/mps-support
Added support for launching on Apple Silicon M1/M2
Diffstat (limited to 'modules/sd_hijack.py')
-rw-r--r--modules/sd_hijack.py2
1 files changed, 1 insertions, 1 deletions
diff --git a/modules/sd_hijack.py b/modules/sd_hijack.py
index 2d26b5f7..1084e248 100644
--- a/modules/sd_hijack.py
+++ b/modules/sd_hijack.py
@@ -232,7 +232,7 @@ class FrozenCLIPEmbedderWithCustomWords(torch.nn.Module):
z = outputs.last_hidden_state
# restoring original mean is likely not correct, but it seems to work well to prevent artifacts that happen otherwise
- batch_multipliers = torch.asarray(np.array(batch_multipliers)).to(device)
+ batch_multipliers = torch.asarray(batch_multipliers).to(device)
original_mean = z.mean()
z *= batch_multipliers.reshape(batch_multipliers.shape + (1,)).expand(z.shape)
new_mean = z.mean()