fix model loading twice in some situations

This commit is contained in:
AUTOMATIC
2023-05-14 13:27:50 +03:00
parent 5f5435eb1a
commit 1a43524018
2 changed files with 6 additions and 0 deletions

View File

@@ -216,6 +216,9 @@ class StableDiffusionModelHijack:
self.comments = []
def get_prompt_lengths(self, text):
if self.clip is None:
return "-", "-"
_, token_count = self.clip.process_texts([text])
return token_count, self.clip.get_target_prompt_token_count(token_count)