OOM / HostBuffer.read_file_slice failed with WAN 2.2 after latest update, fixed by --disable-pinned-memory
- Dominant language
- Python
- Stars
- 133k
- Forks
- 15.7k
- Avg merge
- 1d 7h
- Merged PRs (30d)
- 158
Description
### Custom Node Testing
- [ ] I have tried disabling custom nodes and the issue persists (see [how to disable custom nodes](https://docs.comfy.org/troubleshooting/custom-node-issues#step-1%3A-test-with-all-custom-nodes-disabled) if you need help)
### Your question
After updating to the latest ComfyUI, my existing WAN 2.2 workflow started failing with a CUDA out-of-memory error.
The same workflow worked correctly before the update. I did not change the workflow, resolution, frame count, sampler, or WAN model settings.
The crash appears to happen during ComfyUI weight casting / host-buffer loading, not during normal WAN denoising. The key error is:
RuntimeError: HostBuffer.read_file_slice failed
The traceback also shows:
comfy_aimdo\host_buffer.py
comfy\memory_management.py
comfy\model_management.py
comfy\ops.py
comfy\ldm\wan\model.py
Adding this launch flag fixes the issue:
--disable-pinned-memory
After disabling pinned memory, the same WAN 2.2 workflow runs again, and iteration speed appears unchanged.
Expected behavior
The WAN 2.2 workflow should run as it did before the update, without requiring --disable-pinned-memory.
Actual behavior
The workflow fails with CUDA OOM / HostBuffer.read_file_slice failed during model loading or weight casting.
Workaround
Launching ComfyUI with:
--disable-pinned-memory
fixes the problem.
System
OS: Windows 11
GPU: NVIDIA RTX 5070 Ti 16GB
Workflow: WAN 2.2 image-to-video
Attention: SageAttention enabled
[INFO] Total VRAM 16303 MB, total RAM 65375 MB
[INFO] pytorch version: 2.11.0+cu130
[INFO] Python version: 3.13.9 (tags/v3.13.9:8183fa5, Oct 14 2025, 14:09:13) [MSC v.1944 64 bit (AMD64)]
[INFO] ComfyUI version: 0.23.0
[INFO] comfy-aimdo version: 0.4.7
[INFO] comfy-kitchen version: 0.2.10
[INFO] comfyui-frontend-package version: 1.44.19
[INFO] comfyui-workflow-templates version: 0.9.92
[INFO] comfyui-embedded-docs version: 0.5.2
[INFO] comfy-kitchen version: 0.2.10
[INFO] comfy-aimdo version: 0.4.7
This does not look like a normal VRAM limit issue because the workflow worked before the update and because disabling pinned memory fixes the crash without reducing resolution, frames, steps, or iteration speed.
Issue generated by ChatGPT.
### Logs
```powershell
```
### Other
_No response_
Contributor guide
Assessment
This issue has not been assessed yet.