aboutsummaryrefslogtreecommitdiffstats
path: root/modules/sd_hijack.py
diff options
context:
space:
mode:
authorInvincibleDude <81354513+InvincibleDude@users.noreply.github.com>2023-01-29 11:36:10 +0000
committerGitHub <noreply@github.com>2023-01-29 11:36:10 +0000
commitee3d63b6beb88e63542976a1095d4c8aa97388bd (patch)
treecf891130682c343107ae0a0f8cec309aea16807a /modules/sd_hijack.py
parent44c0e6b993d00bb2f441f0fde409bcb79136f034 (diff)
parent00dab8f10defbbda579a1bc89c8d4e972c58a20d (diff)
downloadstable-diffusion-webui-gfx803-ee3d63b6beb88e63542976a1095d4c8aa97388bd.tar.gz
stable-diffusion-webui-gfx803-ee3d63b6beb88e63542976a1095d4c8aa97388bd.tar.bz2
stable-diffusion-webui-gfx803-ee3d63b6beb88e63542976a1095d4c8aa97388bd.zip
Merge branch 'master' into master
Diffstat (limited to 'modules/sd_hijack.py')
-rw-r--r--modules/sd_hijack.py4
1 files changed, 3 insertions, 1 deletions
diff --git a/modules/sd_hijack.py b/modules/sd_hijack.py
index f9652d21..8fdc5990 100644
--- a/modules/sd_hijack.py
+++ b/modules/sd_hijack.py
@@ -131,6 +131,8 @@ class StableDiffusionModelHijack:
m.cond_stage_model.wrapped.model.token_embedding = m.cond_stage_model.wrapped.model.token_embedding.wrapped
m.cond_stage_model = m.cond_stage_model.wrapped
+ undo_optimizations()
+
self.apply_circular(False)
self.layers = None
self.clip = None
@@ -171,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:]])