CUDA out of memory: separate model loading, sampling and VAE decoding
Identify the stage that requested GPU memory before reducing the workload. Advertised VRAM, weight-file size and the memory available to this particular task are different quantities.
Symptoms and scope
Identify the stage that requested GPU memory before reducing the workload. Advertised VRAM, weight-file size and the memory available to this particular task are different quantities.
Error fragments for search; IDs, values and filenames may vary:
CUDA out of memory
torch.OutOfMemoryError
Source-supported context
Official troubleshooting discusses resolution, batch size and memory strategies. PyTorch states that empty_cache releases unused cache; it does not increase the total memory available to Torch or remove live tensors. Source 1 Source 2
Cases to distinguish
1. Other generation processes or ComfyUI instances occupy the same GPU.
2. Resolution, batch size, video length or simultaneous model residency exceeds the available peak capacity.
3. Workspaces, retained tensors or custom-node caches increase a particular stage's peak usage.
Diagnostic sequence
The sequence below is an editorial procedure based on the cited context, not a diagnosis already confirmed for your environment.
Step 1. Record the last executing node, requested allocation, GPU, dimensions, batch size, frame count and concurrency.
Step 2. Stop only tasks you know are unnecessary. Start with one queued task. If the particular workflow and model support a smaller input or batch size of one, use that as a baseline without changing every algorithm parameter.
Step 3. For sampling failures, reduce spatial or temporal load only where the workflow and model permit it; use the dedicated VAE guide for decoding failures; check accidentally oversized or multiple models for load failures.
Step 4. Check model/version support before testing offload, quantization or low-memory settings. Change one setting at a time in a copy and record the result.
Completion check
A supported smaller baseline completes repeatedly, and changing one supported parameter has an explainable effect. Success with that baseline does not guarantee the original workload will work.
Limitations and cautions
Cache clearing, restarting and arbitrary allocator variables are not universal repairs. Offload can move the bottleneck to system RAM, and altered settings may change output.
Original sources
- ComfyUI troubleshooting overview — original record checked 2026-09-21.
- torch.cuda.memory.empty_cache — original record checked 2026-09-21.
Localization prepared: 2026-09-22. The source-check dates above were inherited from the existing article; this translation does not claim they were all rechecked today. No GPU run, minimum-memory measurement or runtime guarantee is supplied.
Related troubleshooting and guides
Was this page helpful?
Anonymous. Only a yes/no counter is stored; no account, IP address or device details.
Sources & references
Localized from the existing Chinese research draft. Original source-check dates are retained; this translation is not new technical verification or a runtime test.
01ComfyUI troubleshooting overviewSource checked: 2026-09-2102torch.cuda.memory.empty_cacheSource checked: 2026-09-21