8000 Dependency Aware Node Caching for low RAM/VRAM machines by Chargeuk · Pull Request #7509 · comfyanonymous/ComfyUI · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

Dependency Aware Node Caching for low RAM/VRAM machines #7509

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

Merged
merged 5 commits into from
Apr 11, 2025

Conversation

Chargeuk
Copy link
Contributor
@Chargeuk Chargeuk commented Apr 6, 2025

Adds a new node caching option that will offload a cached node once all of it's children have executed in order to reduce the amount of RAM/VRAM a workflow needs. The downside is that a workflow will fully execute each time, so for an end user, it will seem like there is no cache at all.

This caching option is enabled using a new --cache-none flag (the name was chosen as for users, it seems like no caching occurs at all).

I created this pull request due to the resources that the new video models use. see: #7465

Chargeuk added 4 commits April 6, 2025 11:51
…of its decendents have executed. This allows users with lower RAM to run workflows they would otherwise not be able to run. The downside is that every workflow will fully run each time even if no nodes have changed.
@Kosinkadink
Copy link
Collaborator

Tested locally and appears to work as expected. Re-running the same workflow seems to cause a temporary rise in RAM before getting cleaned up, but that might be a quirk of python garbage collection.

A 'proper' solution in the future would be to have a way to mark which nodes should not cache their results/display used RAM/VRAM of cache on each node, but the --cache-none option should be useful on low RAM devices regardless of any more precise implementations. Looks good to me.

@Kosinkadink Kosinkadink self-requested a review April 9, 2025 08:50
Kosinkadink
Kosinkadink previously approved these changes Apr 9, 2025
@comfyanonymous
Copy link
Owner
8000

Can you fix the ruff check?

Copy link
Collaborator
@Kosinkadink Kosinkadink left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I figured out how to commit to the PR branch - ruff should now be passing @comfyanonymous

@Kosinkadink
Copy link
Collaborator

I did the commit wrong the first time, but here was the passing ruff run for it: https://github.com/comfyanonymous/ComfyUI/actions/runs/14392860510

Should be good to merge now

@comfyanonymous comfyanonymous merged commit ed945a1 into comfyanonymous:master Apr 11, 2025
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.

3 participants
0