From 1a43524018ea3e64b93be2abc2a49b6159515442 Mon Sep 17 00:00:00 2001 From: AUTOMATIC <16777216c@gmail.com> Date: Sun, 14 May 2023 13:27:50 +0300 Subject: fix model loading twice in some situations --- modules/sd_hijack.py | 3 +++ 1 file changed, 3 insertions(+) (limited to 'modules/sd_hijack.py') diff --git a/modules/sd_hijack.py b/modules/sd_hijack.py index 7e50f1ab..14e7f799 100644 --- a/modules/sd_hijack.py +++ b/modules/sd_hijack.py @@ -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) -- cgit v1.2.1