CUDA memory allocation failed

Troubleshoot gpu memory errors using the traceback and your ComfyUI environment.

Identify which stage ran out of memory

Preserve the first complete exception and the failing node. Model loading, sampling and VAE decoding can have different memory demands. The same out-of-memory text does not tell you which remedy applies. Record model family, quantization or dtype, image dimensions, batch size, video frames and other applications using the GPU.

Change one relevant factor at a time

  1. Save a copy of the workflow and establish a small reproducible job.
  2. For image workloads, try batch size one and lower dimensions. For video, reduce the frame count where the workflow supports it.
  3. Check other GPU applications and remaining memory. Close only applications you control and preserve their work first.
  4. If model loading fails, compare the model's actual memory requirements and supported loading options with your hardware. Lowering sampling steps does not make the model weights smaller.
  5. If VAE decoding fails, investigate a compatible tiled decoding path and reduced output dimensions. Verify tile settings and output quality on a small result.
  6. Retest and record whether the failing stage changed.

What the workflow cannot predict

An exported graph alone does not reveal the current GPU memory state, exact weight format, implementation-specific buffers or another process's usage. OnBeg reports heuristic risks rather than an exact VRAM requirement. Multiple heavy stages, large resolution or video operations justify closer inspection, not a guarantee of failure.

When this does not apply

A driver mismatch, unsupported CUDA kernel or tensor shape exception is not fixed by reducing dimensions alone. Read the actual exception. Avoid reinstalling drivers or globally changing memory settings before establishing that the failure is a memory allocation problem.

Continue with local diagnostics

Check the workflow · Inspect the log

References: ComfyUI troubleshooting · Custom-node installation.