From 7a0fb40daa800b77f44683027a9319f35806b097 Mon Sep 17 00:00:00 2001 From: Rattus Date: Wed, 25 Mar 2026 22:52:00 +1000 Subject: [PATCH] caching: add set_local implementation for LRU and RAM pressure --- comfy_execution/caching.py | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/comfy_execution/caching.py b/comfy_execution/caching.py index 5236fdcc4..4ce125645 100644 --- a/comfy_execution/caching.py +++ b/comfy_execution/caching.py @@ -475,6 +475,10 @@ class LRUCache(BasicCache): self._mark_used(node_id) return await self._set_immediate(node_id, value) + def set_local(self, node_id, value): + self._mark_used(node_id) + BasicCache.set_local(self, node_id, value) + async def ensure_subcache_for(self, node_id, children_ids): # Just uses subcaches for tracking 'live' nodes await super()._ensure_subcache(node_id, children_ids) @@ -521,6 +525,10 @@ class RAMPressureCache(LRUCache): self.timestamps[self.cache_key_set.get_data_key(node_id)] = time.time() return await super().get(node_id) + def set_local(self, node_id, value): + self.timestamps[self.cache_key_set.get_data_key(node_id)] = time.time() + super().set_local(node_id, value) + def poll(self, ram_headroom): def _ram_gb(): return psutil.virtual_memory().available / (1024**3)