New Tool Radar

AI Image & Voice

How to Fix ComfyUI Out-of-Memory and VRAM Errors

Shrink the image, lower the batch size and use the low-VRAM flags to get a ComfyUI job running on a small graphics card.

Schematic diagram with four steps: shrink the image and batch size, relaunch with --lowvram, close other GPU apps, then queue the job again.

An out-of-memory error in ComfyUI usually means the model plus the image you asked for does not fit in your graphics card’s memory. The fix is to make the job smaller or to let ComfyUI stream weights instead of holding everything at once.

Shrink the job, then use the low-VRAM flags

First, cut the image size — a 1024×1024 image uses roughly four times the memory of a 512×512 one — and set the batch size to 1. If it still fails, relaunch with the low-VRAM flag: --lowvram makes ComfyUI work on GPUs with less than 3GB of VRAM, and it is enabled automatically on low-VRAM cards. The README also notes its asynchronous weight streaming lets even the biggest models run on as low as 4GB of VRAM with 8GB of RAM.

Shrink first: smaller image, batch size 1
Relaunch: python main.py --lowvram
Also try: python main.py --normalvram
Close other GPU apps before queuing

Close browsers and games that hold VRAM before queuing, and do not stack several large nodes (upscaling, ControlNet, a second LoRA) into one job on a small card — run them as separate passes. If the error names a custom node, disable custom nodes with --disable-all-custom-nodes to check whether a pack is the cause.

Try it: four checks

Check What you should see If you do not see it
Smaller job runs A 512×512 image at batch 1 finishes Keep shrinking until one job succeeds
Flag helps –lowvram lets the same job finish Try –normalvram if –lowvram is too slow
VRAM freed Other GPU apps are closed before queuing Check the GPU monitor for other users of VRAM
No custom-node fault The job runs with custom nodes disabled Re-enable packs one at a time

Expected result. We checked the ComfyUI README, which documents the –lowvram flag for GPUs under 3GB of VRAM, the weight streaming on 4GB VRAM, and –disable-all-custom-nodes for troubleshooting. We did not reproduce or fix an out-of-memory error on this machine.

Limits

This guide covers memory errors only. A job can also fail for a missing model file or a broken custom node, which show different errors. We did not test any fix ourselves.

Sources

See all
AI Image & Voice

How to Remove a Background in Canva

Remove a photo background in Canva with Background Remover, then fix the edges with the Erase and Restore brushes.