ComfyUI icon indicating copy to clipboard operation
ComfyUI copied to clipboard

Optimize `recursive_output_delete_if_changed` and `recursive_will_execute` increasing speed by 1000x +

Open rgthree opened this issue 1 year ago • 2 comments

This change fixes #1502, increasing execution speed of re-executed workflows by a significant amount (scales exponentially as more nodes are added).

The change caches the to_delete value by a given node's output at the prompt level (in execute) allowing recursive_output_delete_if_changed to skip nodes whose outputs have already been recursively evaluated.

(While outputs already pops nodes off effectively stopping evaluation for already deleted nodes, this change caches a to_delete = False value, allowing the execution to reuse that work)

rgthree avatar Sep 13 '23 03:09 rgthree

Hey @comfyanonymous wdyt about optimizing these calls? If it’s a no go, I can just (sloppily) patch it for https://github.com/rgthree/rgthree-comfy node users there, but it feels like a valuable optimization for everyone.

rgthree avatar Sep 14 '23 21:09 rgthree

Looking forward to this PR getting merged

nidefawl avatar Jan 01 '24 17:01 nidefawl

Looking forward to this PR getting merged

Yea, I've stopped holding my breath. Good news is if you're already using rgthree-comfy then these have been patched and optimized since September!

rgthree avatar Jan 02 '24 04:01 rgthree