aboutsummaryrefslogtreecommitdiff
path: root/modules/sd_hijack.py
diff options
context:
space:
mode:
authorAUTOMATIC <16777216c@gmail.com>2023-01-07 01:45:28 +0300
committerAUTOMATIC <16777216c@gmail.com>2023-01-07 01:46:13 +0300
commit79e39fae6110c20a3ee6255e2841c877f65e8cbd (patch)
tree8211b701f49da2b970d653789b3b008ef69a4c38 /modules/sd_hijack.py
parent3246a2d6b898da6a98fe9df4dc67944635a41bd3 (diff)
CLIP hijack rework
Diffstat (limited to 'modules/sd_hijack.py')
-rw-r--r--modules/sd_hijack.py6
1 files changed, 3 insertions, 3 deletions
diff --git a/modules/sd_hijack.py b/modules/sd_hijack.py
index fa2cd4bb..71cc145a 100644
--- a/modules/sd_hijack.py
+++ b/modules/sd_hijack.py
@@ -150,10 +150,10 @@ class StableDiffusionModelHijack:
def clear_comments(self):
self.comments = []
- def tokenize(self, text):
- _, remade_batch_tokens, _, _, _, token_count = self.clip.process_text([text])
+ def get_prompt_lengths(self, text):
+ _, token_count = self.clip.process_texts([text])
- return remade_batch_tokens[0], token_count, sd_hijack_clip.get_target_prompt_token_count(token_count)
+ return token_count, self.clip.get_target_prompt_token_count(token_count)
class EmbeddingsWithFixes(torch.nn.Module):