From c904585f87d29063e26f99db0ae4f4cb66d86870 Mon Sep 17 00:00:00 2001 From: CalamitousFelicitousness Date: Sun, 6 Sep 2026 19:12:41 +0100 Subject: [PATCH] fix(prompt): cache list prompts again 0dbe27c37 keyed the prompt cache on the negative prompt and the cfg flag and hashed both prompts to tuples for it. The positive prompt was hashed before the list check that builds the key, so a list prompt, which is what every pipeline passes, was never stored or found and the text encoder ran on every generation. Only the negative prompt needs hashing. --- modules/sd_hijack_te.py | 2 -- 1 file changed, 2 deletions(-) diff --git a/modules/sd_hijack_te.py b/modules/sd_hijack_te.py index 2c43f516c..0e949c3fa 100644 --- a/modules/sd_hijack_te.py +++ b/modules/sd_hijack_te.py @@ -22,7 +22,6 @@ class PromptCache: self.cache.clear() self.id = id(shared.sd_model) log.debug(f'Encode: prompt cache activate id={self.id} depth={len(self.cache)}') - prompt = self._hashable(prompt) negative_prompt = self._hashable(negative_prompt) if (isinstance(prompt, list) and len(prompt) == 1 and isinstance(prompt[0], str)): cached = self.cache.get((prompt[0], negative_prompt, cfg_enabled), None) @@ -41,7 +40,6 @@ class PromptCache: if len(self.cache) >= self.max: oldest_key = next(iter(self.cache)) del self.cache[oldest_key] - prompt = self._hashable(prompt) negative_prompt = self._hashable(negative_prompt) if (isinstance(prompt, list) and len(prompt) == 1 and isinstance(prompt[0], str)): self.cache[(prompt[0], negative_prompt, cfg_enabled)] = encoded