switched the token counter to use hidden buttons instead of api call

This commit is contained in:
Liam
2022-09-27 19:29:53 -04:00
parent 981fe9c4a3
commit e5707b66d6
4 changed files with 25 additions and 64 deletions

View File

@@ -273,8 +273,7 @@ class StableDiffusionModelHijack:
def tokenize(self, text):
max_length = self.clip.max_length - 2
_, remade_batch_tokens, _, _, _, token_count = self.clip.process_text([text])
return {"tokens": remade_batch_tokens[0], "token_count":token_count, "max_length":max_length}
return remade_batch_tokens[0], token_count, max_length
class FrozenCLIPEmbedderWithCustomWords(torch.nn.Module):
def __init__(self, wrapped, hijack):