Skip to content

OOM / HostBuffer.read_file_slice failed with WAN 2.2 after latest update, fixed by --disable-pinned-memory #14250

Description

@aferventu

Custom Node Testing

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

Other

No response

Metadata

Metadata

Assignees

Labels

User SupportA user needs help with something, probably not a bug.

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions