ComfyUI Out of Memory Fix: DynamicVRAM & Batch Leaks
ComfyUI’s 2026 DynamicVRAM and AIMDO allocator made pre-March --lowvram flags useless—introducing second-run non-OOM crashes, WSL Shared GPU memory locks, and HostBuffer errors. Here is the symptom-by-symptom CLI and BatchPipe fix.

THE STORY IN THREE POINTS
- Legacy --lowvram flags no longer fix most 2026 ComfyUI crashes: upstream option definitions confirm --lowvram has no effect while DynamicVRAM is enabled, and --reserve-vram is silently ignored in favor of --vram-headroom N.
- For second-generation crashes (VRAM Allocation failed (non OOM) on QwenImage), HostBuffer.read_file_slice CUDA errors, or WSL pinning models into slow Shared GPU memory, pass --disable-dynamic-vram and cap RAM buffers with --cache-ram 4.
- For 500-frame animation queues and long batches that crash near completion from gradual tensor accumulation, update the BatchPipe custom node (November 17, 2026 release) and enable Empty VRAM Cache to flush PyTorch memory after each iteration.
Why pre-March 2026 --lowvram guides fail under DynamicVRAM and AIMDO
If you updated ComfyUI in mid-to-late 2026 and found classic memory flags doing nothing, the underlying memory manager changed. ComfyUI replaced static upfront memory estimation with DynamicVRAM backed by the comfy-aimdo allocator, which streams model blocks dynamically between host RAM and VRAM. As 42 UK’s November 8 low-VRAM troubleshooter points out, ComfyUI’s current upstream option definitions explicitly state that --lowvram has no effect while DynamicVRAM is active.
The same architectural shift broke another staple launch flag: Local AI Master’s DynamicVRAM audit documents that --reserve-vram is accepted silently at startup and ignored under DynamicVRAM (issue #15666), having been superseded by --vram-headroom N (PR #14480). Worse, DynamicVRAM relies on rapid paging, so keeping safetensors weights on a mechanical HDD instead of an NVMe SSD creates severe stall-and-timeout pseudo-OOM failures.
Symptom-to-fix tree: non-OOM second-run crashes and HostBuffer exhaustion
Symptom 1 — First generation succeeds, second generation crashes with VRAM Allocation failed (non OOM) and Fault failed: 2: Tracked in ComfyUI issue #15269 (AIMDO 0.4.11, frequently hitting QwenImage workflows, echoing March’s #12943), this is an allocator state regression rather than actual capacity exhaustion. Add --disable-dynamic-vram to python main.py or your Windows run_nvidia_gpu.bat launch line so ComfyUI reverts to deterministic estimation-based loading (where --lowvram also regains effect).
Symptom 2 — HostBuffer.read_file_slice failed followed by torch.AcceleratorError: CUDA error: out of memory, or climbing system RAM on LoRAs: Reported heavily in issue #15255, streaming failures respond immediately to --disable-dynamic-vram (adding --cuda-device 0 or --disable-pinned-memory on multi-GPU hosts). If host RAM climbs across LoRA-heavy prompts (#15575), cap host caching with --cache-ram 4; if you hit RuntimeError: HostBuffer.truncate failed inside partially_unload_ram on comfy-kitchen 0.2.31 (seen with MiniMax H3), pin pip install comfy-kitchen==0.2.30.
Fixing 500-frame video and batch VRAM leaks with BatchPipe Empty VRAM Cache
Ambitious animation queues and 500-frame video workflows suffer a separate failure mode from DynamicVRAM: silent inter-frame memory creep where lingering PyTorch allocator blocks accumulate until frame 499 throws an OOM. As detailed in MyUP’s November 17 batch VRAM leak guide, an update to the BatchPipe custom node directly resolves this leak.
Install or update BatchPipe via ComfyUI-Manager, wire the node directly ahead of your Save Image or Video Combine output stage, and enable its Empty VRAM Cache checkbox to force PyTorch to purge retained cache tensors between every batch step. Pair that hygiene with quantized video checkpoints detailed in our local video generation VRAM guide and hardware headroom sizing in our GPU VRAM buyer’s guide and live benchmarks hub.
Sources: ComfyUI Out of Memory: HostBuffer & DynamicVRAM Fix|Local AI Master ↗ ComfyUI Out of Memory? RAM & VRAM Troubleshooter|42 UK ↗ ComfyUI batch generation VRAM leak fix: a practical guide|MyUP ↗ Issue #15255: Dynamic VRAM streaming crashes with HostBuffer.read_file_slice failed|Comfy-Org/ComfyUI ↗ Issue #15269: DynamicVRAM + AIMDO 0.4.11 VRAM Allocation failed (non OOM)|Comfy-Org/ComfyUI ↗ Issue #15679: DynamicVRAM on WSL pins model set into Shared GPU memory|Comfy-Org/ComfyUI ↗
THE BROADER CONTEXT · FRONTIER LABS DOSSIER
Explore full product specifications, pricing analysis, and continuous coverage in the Frontier Labs Desk Hub and Others Dossier. Independent benchmarks available on the AI Intelligence Index and Coding Agents Leaderboard.


