Skip to content

ComfyUI Out of Memory Fix (2026): Solve CUDA OOM and Allocation Errors on Any GPU

7–11 minutes
Woman in a home lab with a PC tower holding a tablet with an OOM FIX card, hook out of memory fix ComfyUI

“torch.OutOfMemoryError: CUDA out of memory” is the most common ComfyUI crash. It appears when a model, a large image or a long video needs more GPU memory (VRAM) than your card has free.

The good news is that recent ComfyUI versions handle memory far better than older guides suggest, and many of the old “fixes” now make things worse.

This guide explains why ComfyUI runs out of memory, what changed with the new Dynamic VRAM system, and the fixes that actually work in November 2026: lowering resolution and batch size, tiled VAE decoding, lighter model formats, freeing VRAM from other apps, and the few launch flags that still make sense.

It follows the current ComfyUI README and the command-line options in the ComfyUI source (comfy/cli_args.py) as of late November 2026.

TL;DR

  • Update first: new ComfyUI uses Dynamic VRAM and async weight streaming, which the README says can run big models on 4 GB VRAM + 8 GB RAM.
  • Remove old flags: the README says most “performance” flags make things worse. --lowvram does nothing when Dynamic VRAM is on.
  • Quick wins: lower resolution, batch size 1, fewer video frames, and use VAE Decode (Tiled).
  • Lighter models: fp8 or ComfyUI’s native int8 formats instead of fp16.
  • Free VRAM: close games, browsers with hardware acceleration and other AI apps.
  • Still crashing? Test with --disable-all-custom-nodes; a custom node is often the culprit.

Why ComfyUI Runs Out of Memory

Memory use in a ComfyUI workflow comes from four places:

  • Model weights: the diffusion model, text encoders and VAE. A 12B-parameter image model in fp16 is about 24 GB on its own.
  • Activations: the working memory while sampling. This grows with image resolution, batch size and, for video, the number of frames.
  • The VAE decode: turning the latent back into pixels is very memory hungry at high resolutions and for long videos.
  • Everything else on the GPU: Windows, your browser, games, Discord overlays and other AI tools.

Out-of-memory errors usually happen at one of three moments: loading a model, during the KSampler steps, or at VAE Decode. Look at which node was highlighted when it crashed; the fix depends on that.

What Changed: Dynamic VRAM

Older guides tell you to add --lowvram or --novram. Modern ComfyUI works differently:

  • Dynamic VRAM is on by default. ComfyUI streams model weights between system RAM and the GPU as needed instead of estimating up front.
  • Async weight offloading is enabled by default on Nvidia, overlapping transfers with compute.
  • The README states that ComfyUI can run even the biggest open models on as little as 4 GB VRAM + 8 GB RAM “relatively quickly”.
  • In the source, --lowvram is documented as doing nothing when Dynamic VRAM is enabled. Adding --highvram, --gpu-only or --novram actually turns Dynamic VRAM off.

The README’s own troubleshooting advice is blunt: remove all command-line flags, because the ones people claim improve performance “do the opposite”.

So step one for almost everyone is to update ComfyUI (Desktop, Portable or git) and clear out old launch arguments. Nvidia users should also be on PyTorch built for CUDA 13.0 (cu130) or newer, as the README recommends.

Quick Fixes to Try First

  1. Update ComfyUI and restart it. In the Desktop app use the built-in updater; in Portable run the update script; in a git install run git pull and reinstall requirements.
  2. Remove launch flags from your .bat file or shortcut, especially --lowvram, --highvram, --gpu-only and old attention flags.
  3. Lower the resolution. Generate at the model’s native size (often about 1 megapixel) and upscale afterwards. Our ComfyUI hires fix guide shows the two-pass method.
  4. Set batch size to 1. Use batch count (queue runs) instead of batch size; see batch size vs batch count.
  5. Shorten videos. Fewer frames or lower resolution cut activation memory sharply.
  6. Restart between very different workflows if memory seems to “leak”, or use the Unload Models / Free Memory buttons in the interface.

Fix OOM at the VAE Decode Step

If generation reaches 100% and then crashes, the VAE decode is the problem.

  • Swap VAE Decode for VAE Decode (Tiled). It decodes the image (or video) in pieces. Lower the tile size if it still fails. Tiled decoding can leave faint seams; overlap settings help.
  • For video, use the tiled decode’s temporal settings to decode a few frames at a time.
  • Last resort: --cpu-vae runs the VAE on the CPU. It always fits, but it is slow.

Avoid --fp16-vae as a memory fix: the source notes it “might cause black images”. If you do get black outputs, see our ComfyUI black image fix.

Use Lighter Model Formats

Format Size vs fp16 Notes
fp16 / bf16 100% Best quality, heaviest
fp8 (e4m3fn) About 50% Small quality loss; widely available for Flux, Wan, Qwen Image and others
ComfyUI native int8 / w6a8 formats About 40-50% The README recommends these over GGUF, saying they are more than 2x faster
GGUF (custom node) 25-60% Very small, but the current README advises removing GGUF nodes in favour of native formats

Also check the text encoder. Large encoders (for example T5-XXL or Qwen-VL based encoders) can use as much memory as the image model. Many models offer fp8 or smaller encoder files; using one is often the single biggest saving.

Flags such as --fp8_e4m3fn-unet and --fp8_e4m3fn-text-enc store weights in fp8 on the fly, but downloading a proper fp8 or int8 file is cleaner. Keep your model folders organised with extra_model_paths.yaml if you share models between apps.

Free Up VRAM From Other Apps

  • Check what is using the GPU: run nvidia-smi in a terminal, or open Task Manager > Performance > GPU on Windows.
  • Close other AI apps: Ollama, LM Studio and a second ComfyUI keep models loaded in VRAM. Ollama unloads after a few minutes by default; stop it if you need the memory now.
  • Browsers: a browser with hardware acceleration and many tabs can hold 1 GB or more. Close it or turn off hardware acceleration while generating.
  • Games and overlays: close games, recording software and GPU-heavy overlays.
  • Multi-monitor setups: high-resolution displays use some VRAM; if you have integrated graphics, plug monitors into it to free the dedicated GPU.

If other software needs to keep VRAM, --reserve-vram 1.5 tells ComfyUI to leave that many gigabytes free. The newer --vram-headroom option asks Dynamic VRAM to keep extra space free even counting other apps.

Launch Flags: Which Still Help

Flag Use it? Why
--lowvram Usually no Does nothing when Dynamic VRAM is on (the default)
--novram, --highvram, --gpu-only No They disable Dynamic VRAM
--reserve-vram GB Sometimes Leaves room for the OS or other apps
--vram-headroom GB Sometimes Extra free VRAM for Dynamic VRAM to protect
--cpu-vae Last resort VAE on CPU: fits, but slow
--cache-none For tight RAM Less RAM/VRAM use, but every node re-runs each time
--disable-smart-memory Rarely Aggressively offloads to RAM instead of keeping models in VRAM
--disable-dynamic-vram Only for testing Falls back to the old estimate-based loading

Add flags only to test a specific problem, and remove them if they do not help.

When System RAM Runs Out

Because ComfyUI now streams weights from system RAM, low RAM causes its own crashes, freezes or a “killed” process on Linux.

  • 16 GB of RAM is a practical minimum for modern image models; 32 GB or more for video models.
  • On Windows, make sure the page file is system-managed or large (32 GB+) on a fast SSD.
  • The default RAM cache uses a share of system RAM; --cache-ram lets you lower its thresholds, and --cache-none uses the least memory.
  • Use fp8 or int8 versions of both the diffusion model and the text encoder.

Custom Nodes and Old Setups

Custom nodes can load their own models, keep them in memory or bypass ComfyUI’s memory management. The README suggests starting with --disable-all-custom-nodes (or temporarily renaming the custom_nodes folder) to see if the problem disappears.

  1. Start ComfyUI with --disable-all-custom-nodes and run a core-only workflow.
  2. If it works, re-enable custom node packs a few at a time to find the culprit.
  3. Update or replace the problem pack, or report it to its author.

Very old installs with mismatched PyTorch builds also cause odd memory behaviour. If ComfyUI reports “Torch not compiled with CUDA”, fix that first with our Torch not compiled with CUDA guide. New to ComfyUI in general? Start at our ComfyUI guide.

Error-by-Error Fix Table

Where it fails Most likely fix
Loading checkpoint or diffusion model Use an fp8 or int8 file, close other GPU apps, add more RAM or page file
Loading CLIP / text encoder Use an fp8 or smaller text encoder
During KSampler steps Lower resolution, batch size 1, fewer frames; update ComfyUI
At VAE Decode VAE Decode (Tiled), smaller tiles, or --cpu-vae
Only after several runs Unload models / free memory, restart, check custom nodes
Only with one custom node workflow Test with --disable-all-custom-nodes, update that pack
Process “Killed” on Linux System RAM exhausted; add swap, use lighter models, --cache-none
Very slow instead of crashing Weights are streaming from RAM; use smaller formats so more fits in VRAM

FAQ

Does –lowvram still work in ComfyUI?

Not in the default setup. The source says it does nothing when Dynamic VRAM is enabled, which is the default. It only applies if you turn Dynamic VRAM off.

Can ComfyUI run on 4 GB or 6 GB of VRAM?

Yes. The README says big models can run on 4 GB VRAM with 8 GB RAM using weight streaming. Expect slower generation, and use smaller formats and resolutions.

Why does ComfyUI crash at the very end of generation?

That is the VAE decode. Use VAE Decode (Tiled) or a smaller tile size.

Is GGUF the best way to save VRAM in ComfyUI?

Not any more. The current README recommends ComfyUI’s native int8/w6a8 formats instead, saying they are more than twice as fast.

How do I see how much VRAM ComfyUI uses?

Run nvidia-smi (or nvidia-smi -l 1 to refresh every second) while it generates, or watch Task Manager’s GPU page on Windows.

Will more system RAM help?

Yes. Modern ComfyUI streams weights from RAM, so 32 GB or more makes big models and videos much smoother on small GPUs.

Does closing my browser really help?

Often. Browsers with hardware acceleration can hold hundreds of megabytes to over a gigabyte of VRAM, which matters on 6 to 8 GB cards.

Sources

Free weekly email

Get new AI guides every week

One short weekly email with our newest local AI, ComfyUI and AI tool guides. No spam, no pop-ups, just the good stuff.

Free. Unsubscribe anytime in one click. We only use your email to send this newsletter. See our privacy policy.

Woman in a home lab with a PC tower holding a tablet with an OOM FIX card, hook out of memory fix ComfyUI