ComfyUI CUDA out of memory
Reduce VRAM pressure using the failing stage, resolution and batch size.
Recognize the message
CUDA out of memory; torch.OutOfMemoryError
This exception reports an allocation failure on the GPU. The stage matters: loading a model, sampling and VAE decoding have different memory peaks. It does not establish that the workflow links are broken.
Work through the evidence
- Keep the complete allocation error, GPU model, available VRAM, image size, batch size and failing node. Note whether another application was using the GPU.
- Run a copy with batch size 1 and a smaller image. Close your own unused GPU workloads. Change one variable at a time so the result explains the change.
- If sampling succeeds but VAE decoding fails, investigate decoding memory separately. Check the official options for your ComfyUI version before changing launch flags.
Verify the result
A smaller single-image run passes the same failing stage. Repeat at the intended dimensions and record the limit; success at a smaller size does not prove the original workload fits.
What this does not prove
A missing checkpoint, shape mismatch or disconnected latent socket requires a different fix. More steps are not a reliable explanation for every allocation failure.
Inspect before changing your workflow
The log inspector works in your browser. The workflow checker reads exported graph structure. Neither sends files automatically or executes nodes. Preserve the original, inspect a copy and record the actual test result in Casebook.
Inspect your log ↗ · Check the graph ↗ · Record a recovery case ↗Before asking for help
Include the first full exception, the failing stage, software versions, model family and the smallest reproducible graph. Redact API keys, user paths and private prompts. A summary such as “KSampler broken” removes the context that distinguishes one failure from another.
Prepare a redacted copy ↗Related investigations
ComfyUI missing custom nodes · ComfyUI model not found · ComfyUI custom node import failed · ComfyUI tensor shape mismatch
Source and scope
These are OnBeg’s diagnostic checklists, informed by official ComfyUI troubleshooting. They are not universal fixes and do not replace model- or extension-specific instructions.