The message
torch.OutOfMemoryError: CUDA out of memory. Tried to allocate 2.00 GiB. GPU 0 has a total capacity of …
Affects: ComfyUI
Why is this happening?
The model, image size, batch size, and intermediate results all have to fit in VRAM at the same time. Large models like Flux, SDXL at high resolution, or video models can quickly exceed 8 to 12 GB. Other programs that use the graphics card too (games, browsers, other AI tools) also use VRAM.
How to fix it
- Close all other programs that use the graphics card, for example games, other AI programs, or browsers with many tabs.
- Check the batch size in the workflow (
batch_sizein the “Empty Latent Image” node) and set it to 1. Also reduce the resolution. - If the error only appears during decoding at the end, replace the “VAE Decode” node with “VAE Decode (Tiled)”. This processes the image in tiles.
- Start ComfyUI with
--lowvram. Portable: Openrun_nvidia_gpu.batwith the editor and add the option to the start line, for example.\python_embeded\python.exe -s ComfyUI\main.py --windows-standalone-build --lowvram. Desktop app: Manage → Startup Args. Manual installation:python main.py --lowvram. - If that’s not enough, use
--novraminstead. With--reserve-vram 2you also keep 2 GB free for Windows and other programs. - Use a smaller version of the model (for example, an fp8 version) if the provider offers one.
- Only as a last resort:
--cpu. Then everything runs on the processor and is very slow.
Better not: Don’t rely on --cpu long term: it fixes the error, but it often makes image generation many times slower.
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
- HostBuffer.read_file_slice failed (crash caused by the new Dynamic VRAM memory management)
- Allocation on device (ComfyUI reports too little VRAM)
- 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://docs.comfy.org/troubleshooting/model-issues
- https://docs.comfy.org/troubleshooting/overview
- https://github.com/Comfy-Org/ComfyUI/blob/master/comfy/cli_args.py
- https://github.com/Comfy-Org/ComfyUI/blob/master/execution.py
Checked on Oct 21, 2026. Didn't help? Ask in the forum and name the graphics card, program, and the full message.