diff options
author | AUTOMATIC1111 <16777216c@gmail.com> | 2023-01-28 15:44:36 +0000 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-01-28 15:44:36 +0000 |
commit | fecb990debdae2cc99b64808d22ba902e34e575b (patch) | |
tree | 5531204920675c2bbb9189e41cf331554b92f062 /modules/sd_hijack.py | |
parent | 41e76d12093dd78315925f923bb1cc0f541e5f54 (diff) | |
parent | f9edd578e9e29d160e6d56038bb368dc49895d64 (diff) | |
download | stable-diffusion-webui-gfx803-fecb990debdae2cc99b64808d22ba902e34e575b.tar.gz stable-diffusion-webui-gfx803-fecb990debdae2cc99b64808d22ba902e34e575b.tar.bz2 stable-diffusion-webui-gfx803-fecb990debdae2cc99b64808d22ba902e34e575b.zip |
Merge pull request #7309 from brkirch/fix-embeddings
Fix embeddings, upscalers, and refactor `--upcast-sampling`
Diffstat (limited to 'modules/sd_hijack.py')
-rw-r--r-- | modules/sd_hijack.py | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/modules/sd_hijack.py b/modules/sd_hijack.py index 03897b2a..8fdc5990 100644 --- a/modules/sd_hijack.py +++ b/modules/sd_hijack.py @@ -173,7 +173,7 @@ class EmbeddingsWithFixes(torch.nn.Module): vecs = []
for fixes, tensor in zip(batch_fixes, inputs_embeds):
for offset, embedding in fixes:
- emb = embedding.vec
+ emb = devices.cond_cast_unet(embedding.vec)
emb_len = min(tensor.shape[0] - offset - 1, emb.shape[0])
tensor = torch.cat([tensor[0:offset + 1], emb[0:emb_len], tensor[offset + 1 + emb_len:]])
|