Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Optimize recursive_output_delete_if_changed and recursive_will_execute increasing speed by 1000x + #1503

Closed
wants to merge 0 commits into from

Conversation

rgthree
Copy link

@rgthree rgthree commented Sep 13, 2023

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 rgthree changed the title Optimize recursive_output_delete_if_changed increasing speed by 1000x + Optimize recursive_output_delete_if_changed and recursive_will_execute increasing speed by 1000x + Sep 13, 2023
@rgthree
Copy link
Author

rgthree commented Sep 14, 2023

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.

@nidefawl
Copy link

nidefawl commented Jan 1, 2024

Looking forward to this PR getting merged

@rgthree
Copy link
Author

rgthree commented Jan 2, 2024

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!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

ComfyUI Queue hangs when (re-)executing complex workflows
2 participants