add hash and fix undo hijack bug

Signed-off-by: zhaohu xing <920232796@qq.com>
This commit is contained in:
zhaohu xing
2022-12-06 16:04:50 +08:00
parent a25dfebeed
commit 5dcc22606d
4 changed files with 11 additions and 6 deletions

View File

@@ -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