ComfyUI
ComfyUI copied to clipboard
Fix unintended exponential algorithm in recursive_will_execute
The intention of recursive_will_execute
is to count the number of nodes that will be executed given some target nodes. However, the implementation used a list instead of a set for the count, so nodes were unintentionally getting duplicated. The count of each node ended up being the number of paths that reach that node instead of just 1. In general, there may be exponentially many paths which led to OOM errors with deeper graphs.
Friendly ping
Are any further changes required? If you're uncomfortable landing as-is, I can revert the changes in recursive_output_delete_if_changed and only keep the changes in recursive_will_execute, and the issue will still be fixed.