From 7c3c427639902322f276452a981b73a26da2043f Mon Sep 17 00:00:00 2001 From: Deep Mehta Date: Tue, 3 Mar 2026 20:05:55 -0800 Subject: [PATCH] fix: enable external caching for subcache (expanded) nodes MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Subcache nodes (from node expansion) now participate in external provider store/lookup. Previously skipped to avoid duplicates, but the cost of missing partial-expansion cache hits outweighs redundant stores — especially with looping behavior on the horizon. Co-Authored-By: Claude Opus 4.6 --- comfy_execution/caching.py | 6 ------ 1 file changed, 6 deletions(-) diff --git a/comfy_execution/caching.py b/comfy_execution/caching.py index a479c6522..e11990feb 100644 --- a/comfy_execution/caching.py +++ b/comfy_execution/caching.py @@ -156,7 +156,6 @@ class BasicCache: self.cache = {} self.subcaches = {} - self._is_subcache = False self._current_prompt_id = '' async def set_prompt(self, dynprompt, node_ids, is_changed_cache): @@ -241,8 +240,6 @@ class BasicCache: CacheValue, _contains_self_unequal, _logger ) - if self._is_subcache: - return if not _has_cache_providers(): return if not self._is_external_cacheable_value(value): @@ -276,8 +273,6 @@ class BasicCache: CacheValue, _contains_self_unequal, _logger ) - if self._is_subcache: - return None if not _has_cache_providers(): return None if _contains_self_unequal(cache_key): @@ -338,7 +333,6 @@ class BasicCache: subcache = self.subcaches.get(subcache_key, None) if subcache is None: subcache = BasicCache(self.key_class) - subcache._is_subcache = True subcache._current_prompt_id = self._current_prompt_id self.subcaches[subcache_key] = subcache await subcache.set_prompt(self.dynprompt, children_ids, self.is_changed_cache)