aboutsummaryrefslogtreecommitdiff
path: root/modules/sd_hijack.py
diff options
context:
space:
mode:
authorZac Liu <liuguang@baai.ac.cn>2022-12-06 16:16:29 +0800
committerGitHub <noreply@github.com>2022-12-06 16:16:29 +0800
commit9a5c689c4960259f32cf627384ef5691ded5c017 (patch)
tree67ff3ae6cbe774c40ade0aa440ca1e4e15eca06e /modules/sd_hijack.py
parenta25dfebeed5b3411f2dc0f558c2b87a7c1cda420 (diff)
parent965fc5ac5a6ccdf38342e21c97183011a04e799e (diff)
Merge pull request #4 from 920232796/master
add hash and fix undo hijack bug
Diffstat (limited to 'modules/sd_hijack.py')
-rw-r--r--modules/sd_hijack.py6
1 files changed, 5 insertions, 1 deletions
diff --git a/modules/sd_hijack.py b/modules/sd_hijack.py
index 9b5890e7..9fed1b6f 100644
--- a/modules/sd_hijack.py
+++ b/modules/sd_hijack.py
@@ -112,7 +112,11 @@ class StableDiffusionModelHijack:
self.layers = flatten(m)
def undo_hijack(self, m):
- if type(m.cond_stage_model) == sd_hijack_clip.FrozenCLIPEmbedderWithCustomWords:
+
+ if shared.text_model_name == "XLMR-Large":
+ m.cond_stage_model = m.cond_stage_model.wrapped
+
+ elif type(m.cond_stage_model) == sd_hijack_clip.FrozenCLIPEmbedderWithCustomWords:
m.cond_stage_model = m.cond_stage_model.wrapped
model_embeddings = m.cond_stage_model.transformer.text_model.embeddings