mirror of
https://github.com/Comfy-Org/ComfyUI-Manager.git
synced 2026-11-05 07:47:25 +00:00
[PR #2836] [CLOSED] Add ComfyUI Pipeline Memory Barrier node #2817
Labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
Comfy-Org/ComfyUI-Manager#2817
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
📋 Pull Request Information
Original PR: https://github.com/Comfy-Org/ComfyUI-Manager/pull/2836
Author: @brosequist
Created: 4/29/2026
Status: ❌ Closed
Base:
main← Head:add-pipeline-barrier📝 Commits (1)
44e9dc7Add ComfyUI Pipeline Memory Barrier node📊 Changes
1 file changed (+46760 additions, -46440 deletions)
View changed files
📝
custom-node-list.json(+46760 -46440)📄 Description
New custom node: ComfyUI Pipeline Memory Barrier
Repo: https://github.com/brosequist/ComfyUI-PipelineBarrier
What it does
Inserts an explicit GPU cache flush between pipeline stages in a ComfyUI workflow. The node calls:
comfy.model_management.soft_empty_cache(force=True)gc.collect()torch.cuda.empty_cache()+torch.cuda.synchronize()on every visible GPUthen logs GPU allocated/reserved and system RAM before and after.
Why it's needed
Multi-stage workflows (e.g. WanVideo two-pass I2V with ComfyUI-MultiGPU and BlockSwap) can OOM-kill the process at the start of the next stage even after model offload completes. PyTorch's CUDA allocator caches freed blocks rather than returning them to the OS immediately. This node flushes those caches so the OS sees the free memory before the next stage loads its models.
Usage
Wire it on any latent (or any typed) connection between pipeline stages. The input passes through unchanged. Works with any wire type via the
_AnyTypesentinel.No additional pip dependencies (uses
psutilwhich is already in the base ComfyUI environment).🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.