HostBuffer.read_file_slice failed (crash caused by the new Dynamic VRAM memory management)
Since ComfyUI 0.30, all generations for some users fail with this error, even though everything worked before. It is related to the new memory management “Dynamic VRAM” (package comfy-aimdo); there is no official fix yet, but there are several working startup flags.
The message
RuntimeError: HostBuffer.read_file_slice failed
torch.AcceleratorError: CUDA error: out of memory
Affects: ComfyUI
Why is this happening?
Dynamic VRAM loads model parts on demand from RAM or directly from the hard drive into the graphics card. The copy into VRAM fails in the process. According to the developers, this is likely a CUDA error that has been reported to NVIDIA; it could mainly be reproduced on systems with multiple graphics cards. It has been reported, among others, with ComfyUI 0.30.0, 0.30.1, 0.34.0, and 0.37.0.
How to fix it
- Disable Dynamic VRAM by starting ComfyUI with
--disable-dynamic-vram(in the portable version, add the flag to the launch line inrun_nvidia_gpu.bat). This has helped several users. - If you have more than one graphics card in your PC, limit ComfyUI to one:
--cuda-device 0. This is the workaround from the official note in the issue. - Alternatively, for some people
--disable-pinned-memoryhelps (may make it slower), or--fast-disk, which according to the developer switches back to the older loading strategy. - If you start with
--use-sage-attention, try without it. One user with an RTX 5090 found that the old SageAttention version 1.0.6 was the cause. - If none of that helps, switching to ComfyUI 0.29.x or 0.36 was a workaround for affected users. Keep an eye on the issue to see whether a fix appears.
Better not: Do not reinstall ComfyUI completely – the error is in the memory management or in CUDA and will reappear with the same version. Instead, try one startup flag at a time in a targeted way.
Set up from scratch again
If it still doesn’t work after that, a fresh setup step by step often helps:
- Set up and maintain ComfyUI on Windows
Desktop or Portable, where the models belong, sharing models with other programs, safely installing custom nodes, updates, startup options … - Your First Image with ComfyUI
Install Comfy Desktop, learn the interface, and create your first AI image with FLUX.2 [small] 4B or Z-Image Turbo. - Your First AI Video with LTX in ComfyUI
Use LTX-2.3 in ComfyUI to create short videos with sound from text or an image. Template, files, settings, and license.
Terms for this
Similar errors
- CUDA out of memory (VRAM full)
- Allocation on device (ComfyUI reports too little VRAM)
- OSError: [WinError 1455] The paging file is too small for this operation to complete (Windows paging file is too small)
- Warning: Ran out of memory when regular VAE decoding, retrying with tiled VAE decoding (VAE decoding falls back to tiles)
- Expected all tensors to be on the same device (data partly on GPU, partly on CPU)
Sources
- https://github.com/Comfy-Org/ComfyUI/issues/15255
- https://github.com/comfyanonymous/ComfyUI/blob/master/comfy/cli_args.py
Checked on Oct 28, 2026. Didn't help? Ask in the forum and name the graphics card, program, and the full message.