diff --git a/comfy_execution/caching.py b/comfy_execution/caching.py index 41224ce3b82e..350a5247beb9 100644 --- a/comfy_execution/caching.py +++ b/comfy_execution/caching.py @@ -418,8 +418,13 @@ async def ensure_subcache_for(self, node_id, children_ids): The subcache object for the node. """ subcache = await super()._ensure_subcache(node_id, children_ids) + await self.cache_key_set.add_keys(children_ids) for child_id in children_ids: + if child_id not in self.descendants: + self.descendants[child_id] = set() self.descendants[node_id].add(child_id) + if child_id not in self.ancestors: + self.ancestors[child_id] = set() self.ancestors[child_id].add(node_id) return subcache