Reduce repeated calls of get_immediate_node_signature in cache
CacheKeySetInputSignature.get_immediate_node_signature is called multiple times for the same node as ancestors of different nodes.
Most nodes are fine, but when there are time-consuming operations in class_def.INPUT_TYPES(), such as get_filename_list, the performance of cache.set_prompt becomes quite bad on machines with poor disk performance.
On one of my devices, set_prompt of caches.outputs and caches.ui took 500+ms before modification, and it would be worse if there were more time-consuming nodes. This PR reduces the time to 80ms on average
@guill #4882
(Automated Bot Message) CI Tests are running, you can view the results at https://ci.comfy.org/?branch=4871%2Fmerge
(Automated Bot Message) CI Tests are running, you can view the results at https://ci.comfy.org/?branch=4871%2Fmerge
Had to revert this because: https://github.com/comfyanonymous/ComfyUI/issues/4914
Had to revert this because: #4914
I found the problem and will submit a PR for another optimization method later.