aboutsummaryrefslogtreecommitdiffstats
path: root/modules/sd_hijack.py
diff options
context:
space:
mode:
authorVladimir Repin <32306715+mezotaken@users.noreply.github.com>2023-01-08 09:51:38 +0000
committerGitHub <noreply@github.com>2023-01-08 09:51:38 +0000
commitcf2f6f20042af79037dac2032294a7ba74cc17b8 (patch)
tree5576ad30a7fb8f46aabec133a71c2e8724251f15 /modules/sd_hijack.py
parentcabd95015b1085e989d9655ea805dbe5e33f5286 (diff)
parent085427de0efc9e9e7a6e9a5aebc6b5a69f0365e7 (diff)
downloadstable-diffusion-webui-gfx803-cf2f6f20042af79037dac2032294a7ba74cc17b8.tar.gz
stable-diffusion-webui-gfx803-cf2f6f20042af79037dac2032294a7ba74cc17b8.tar.bz2
stable-diffusion-webui-gfx803-cf2f6f20042af79037dac2032294a7ba74cc17b8.zip
Merge branch 'AUTOMATIC1111:master' into master
Diffstat (limited to 'modules/sd_hijack.py')
-rw-r--r--modules/sd_hijack.py7
1 files changed, 4 insertions, 3 deletions
diff --git a/modules/sd_hijack.py b/modules/sd_hijack.py
index cfdb09d6..6b0d95af 100644
--- a/modules/sd_hijack.py
+++ b/modules/sd_hijack.py
@@ -83,10 +83,12 @@ class StableDiffusionModelHijack:
clip = None
optimization_method = None
- embedding_db = modules.textual_inversion.textual_inversion.EmbeddingDatabase(cmd_opts.embeddings_dir)
+ embedding_db = modules.textual_inversion.textual_inversion.EmbeddingDatabase()
- def hijack(self, m):
+ def __init__(self):
+ self.embedding_db.add_embedding_dir(cmd_opts.embeddings_dir)
+ def hijack(self, m):
if type(m.cond_stage_model) == xlmr.BertSeriesModelWithTransformation:
model_embeddings = m.cond_stage_model.roberta.embeddings
model_embeddings.token_embedding = EmbeddingsWithFixes(model_embeddings.word_embeddings, self)
@@ -117,7 +119,6 @@ class StableDiffusionModelHijack:
self.layers = flatten(m)
def undo_hijack(self, m):
-
if type(m.cond_stage_model) == xlmr.BertSeriesModelWithTransformation:
m.cond_stage_model = m.cond_stage_model.wrapped