Error / Memory
Allocation on device (ComfyUI reports too little VRAM)
ComfyUI ran out of graphics memory while executing a node and aborted the run.
The message
torch.OutOfMemoryError: Allocation on device … This error means you ran out of memory on your GPU. TIPS: If the workflow worked before you might have accidentally set the batch_size to a large number.
Affects: ComfyUI
Why is this happening?
This is ComfyUI’s version of “CUDA out of memory.” ComfyUI also adds the note that an accidentally too-large batch size is often the cause. After the error, ComfyUI unloads all models, so a second try can sometimes work. According to the ComfyUI developers, the message “Allocation on device 0 would exceed allowed memory” usually means the model barely fits in VRAM.
How to fix it
- Click “Show report” in the error dialog and see which node is affected (for example, KSampler or VAE Decode).
- Check
batch_sizein the “Empty Latent Image” node and in image-loading nodes. Set it to 1. - Reduce the resolution or, for video models, the number of frames.
- Update ComfyUI (Portable:
update\update_comfyui.bat, Desktop: Manage → Update → Check for update). Newer versions manage memory better. - If that doesn’t help, go through the steps in the “CUDA out of memory” entry (
--lowvram,--novram,--reserve-vram).
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)
- HostBuffer.read_file_slice failed (crash caused by the new Dynamic VRAM memory management)
- Warning: Ran out of memory when regular VAE decoding, retrying with tiled VAE decoding (VAE decoding falls back to tiles)
- OSError: [WinError 1455] The paging file is too small for this operation to complete (Windows paging file is too small)
- Black images or NaN values (VAE precision)
Sources
- https://github.com/Comfy-Org/ComfyUI/blob/master/execution.py
- https://github.com/Comfy-Org/ComfyUI/issues/14340
- https://docs.comfy.org/troubleshooting/model-issues
- https://docs.comfy.org/installation/comfyui_portable_windows
- https://docs.comfy.org/installation/desktop/usage/manage
Checked on Oct 21, 2026. Didn't help? Ask in the forum and name the graphics card, program, and the full message.