Skip to content

Out of VRAM and Stuttering: A Systematic Fix for OOM ​

A CUDA out of memory error pops up mid-generation, or the progress bar freezes and VRAM is maxed out — this is running out of VRAM, one of the most common issues in ComfyUI. Don't rush to buy a new graphics card: follow the steps below in order, and most OOM problems can be solved at the software level. If this is your first time troubleshooting, we recommend reading the Troubleshooting Overview first.

Symptoms: Find Your Match First ​

CUDA out of memory / torch.OutOfMemoryError ​

First restart ComfyUI to release any leaked VRAM, then launch with --lowvram so the text encoder runs on the CPU instead, reducing VRAM usage.

Progress bar freezes, VRAM is fully occupied but no error appears ​

First use nvidia-smi to see exactly what is occupying the VRAM, close your browser, games, and other drawing programs, then try again.

Always crashes after switching to a larger model ​

The larger model's weights simply exceed your physical VRAM; tweaking parameters only mitigates it — switching to a quantized version or a smaller checkpoint is the real fix.

Quick Check (60 Seconds) ​

  1. Use nvidia-smi or Task Manager to confirm that no browser, game, or other AI program is competing for VRAM.
  2. Restart ComfyUI. After an abnormal interruption, VRAM is often not released; restarting is the fastest way to "reset to zero."
  3. Drop the resolution and batch size to the minimum to first prove the workflow itself can run.
  4. Count how many models are loaded simultaneously for this generation: checkpoints, ControlNets, upscalers, and LoRAs all count.

Still getting OOM after all that? Move on to full troubleshooting.

Troubleshooting Steps ​

Step 1: Reduce VRAM Pressure Per Generation ​

Most OOM cases come from "asking for too much at once." First drop the resolution by one notch (e.g., 512×768) and set batch size to 1, then gradually add them back once it runs, to find the tipping point for your machine. Also check whether the workflow has multiple large model nodes attached at the same time — disconnect the ones you don't need, since every model resident in VRAM raises the peak usage.

Step 2: Reallocate VRAM with Launch Parameters ​

ComfyUI provides a set of launch parameters to control VRAM strategy; combine them as needed:

  • --lowvram: Low-VRAM mode, moves the text encoder to run on the CPU, trading speed for VRAM; the most commonly used option.
  • --cpu: Moves computation to system RAM and the CPU; extremely slow but almost never OOMs, suitable for emergency workflow validation.
  • --reserve-vram: Reserves a portion of VRAM for the system or other programs, preventing the whole machine from freezing after the GPU is squeezed dry.
  • --async-offload: Asynchronously swaps model weights in and out during generation, further lowering peak usage (enabled by default on NVIDIA GPUs).
  • --cache-* series: Controls the cache eviction strategy for models and node results. Common values include --cache-none (uses less RAM/VRAM, but every node re-executes on each run), --cache-lru 10 (caches up to 10 node results), and --cache-classic (the old aggressive caching).

Windows portable package users typically add these parameters in the launch script: edit run_nvidia_gpu.bat in the portable package's root directory and append them to the end of the .\python_embeded\python.exe -s ComfyUI\main.py --windows-standalone-build line.

Step 3: Switch to a Smaller Model or a Quantized Version ​

If you still get frequent OOMs with all parameters maxed out, the model itself is simply too large for your VRAM. Two paths: first, switch to a GGUF quantized model, which lets low-VRAM setups run large models — see GGUF Quantized Models: Running Large Models on Low VRAM; second, just switch to a smaller checkpoint and get your pipeline running smoothly with a small model first.

Note the distinction: if the error occurs as soon as the model loads (rather than an OOM mid-generation), it's most likely not a VRAM issue — see the previous page Model Loading Failures.

Upgrade Criteria: When to Stop Tweaking Parameters ​

If any of the following is true, stop burning time at the software level:

  • --lowvram + minimum resolution + quantized model still reliably OOMs: your VRAM is physically below the model's floor; consider upgrading your graphics card, or accept long-term generation in slow --cpu mode.
  • Persistent stuttering even though VRAM isn't full: the problem may not be VRAM — go back to the Troubleshooting Overview and locate it via the logs.
  • The error isn't OOM but a loading or architecture error: go to Model Loading Failures.
  • None of the above matches: take your full console log to the ComfyUI GitHub repository and search for "out of memory" — chances are someone has hit the same pitfall.

Related Reading ​