Fix the issue where subgraph does not work under --cache-none mode (#…#10354
Fix the issue where subgraph does not work under --cache-none mode (#…#10354HelloClyde wants to merge 3 commits intoComfy-Org:masterfrom
Conversation
|
Hi @Kosinkadink 👋 |
Thanks for the detailed explanation — you’re right, this PR only provides a minimal fix to prevent the exception. My test cases are as follows: NodeExpansion: |
|
Hey @HelloClyde, we just merged @rattus128's PR #10368 for the --cache-none issue that should resolve all previous issues + make more features possible! He and I actually started talking about adding a RAM-aware caching method a few days before you submitted this PR, so work was already underway to fix --cache-none as a part of that effort. Thank you for your contribution nonetheless! |


Summary
This PR fixes an issue where subgraph execution fails when running with the
--cache-nonemode.Root Cause
When running with DependencyAwareCache, the ensure_subcache_for function in comfy_execution/caching.py tries to access self.ancestors[child_id] before it exists, leading to a KeyError.
Solution
Added a safe initialization for the subcache object under --cache-none mode to ensure ancestors and related mappings are properly created before use.
Related issue
Fixes #10329