diff options
author | AUTOMATIC <16777216c@gmail.com> | 2023-01-06 22:45:28 +0000 |
---|---|---|
committer | AUTOMATIC <16777216c@gmail.com> | 2023-01-06 22:46:13 +0000 |
commit | 79e39fae6110c20a3ee6255e2841c877f65e8cbd (patch) | |
tree | 8211b701f49da2b970d653789b3b008ef69a4c38 /modules/sd_hijack.py | |
parent | 3246a2d6b898da6a98fe9df4dc67944635a41bd3 (diff) | |
download | stable-diffusion-webui-gfx803-79e39fae6110c20a3ee6255e2841c877f65e8cbd.tar.gz stable-diffusion-webui-gfx803-79e39fae6110c20a3ee6255e2841c877f65e8cbd.tar.bz2 stable-diffusion-webui-gfx803-79e39fae6110c20a3ee6255e2841c877f65e8cbd.zip |
CLIP hijack rework
Diffstat (limited to 'modules/sd_hijack.py')
-rw-r--r-- | modules/sd_hijack.py | 6 |
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):
|