A smaller checkpoint does not guarantee a smaller memory peak. ComfyUI also needs space for activations, attention, decoding, and other models in the workflow. Moving weights to RAM can make a run fit while increasing transfer time.
Quick answer: start with batch size 1, identify the stage that runs out of memory, and change that stage first. Reduce resolution or frame count for sampling peaks; use VAE Decode (Tiled) for decoding peaks; review model offloading when weights compete for VRAM. No flag makes every workflow fit every GPU.
This is an independent engineering guide. For official behavior, check the ComfyUI launch arguments and built-in node definitions, reviewed October 27, 2026. Installed releases and custom nodes can behave differently.
How ComfyUI Uses Memory
VRAM Breakdown for a Typical SDXL Workflow
| Allocation | What changes it | First thing to inspect |
|---|---|---|
| Model weights | Architecture, precision, loaded components | Loader and checkpoint |
| Sampling tensors and attention | Resolution, batch, frame count, backend | Sampler settings and execution log |
| VAE decoding | Output dimensions, batch, VAE implementation | Whether OOM occurs after sampling |
| ControlNet and adapters | Number and type of conditioning models | Remove one component and compare |
| Cached outputs and previews | Workflow graph and cache behavior | Repeated-run memory growth |
These allocations peak at different times. Adding checkpoint file sizes does not measure runtime VRAM, and adding estimates from unrelated workflows does not establish a minimum GPU size. See the SDXL VRAM requirements guide for how inference and training differ.
VRAM vs System RAM
GPU memory holds active computation; host RAM can hold offloaded models and intermediate data. Offloading requires enough host RAM and can add transfers. Once host RAM is exhausted, disk paging can make the workflow much slower. More RAM does not become additional GPU memory with the same speed.
A GPU upgrade only helps if it removes the actual constraint. The explanation of why a faster GPU can feel slower covers the cost of memory spilling.
Built-in Memory Settings
Run python main.py --help in your installation before copying flags. Start from the default memory manager and change one option at a time.
| Option | Purpose | Caveat |
|---|---|---|
--lowvram | An alternative memory policy | The reviewed CLI says it has no effect with dynamic VRAM enabled; otherwise text encoders run on CPU |
--novram | More restrictive memory operation | Can increase transfers and runtime |
--highvram | Keep used models on the GPU | Can increase the memory peak |
--force-fp16 | Force half precision | Check model and hardware compatibility; not a universal fix |
There is no fixed GB saving or speed percentage for these flags. The baseline precision, model manager, and workload determine the change.
Launch Arguments
# Inspect supported arguments for the installed release
python main.py --help
# Record loading and execution behavior
python main.py --verbose DEBUGIf the installed version's help and logs justify a different memory policy, test it on a copy of the workflow. Keep the command and software version with the result so the comparison is repeatable.
Attention Optimization
Attention memory depends on tensor shapes and the selected backend. ComfyUI exposes attention options, including --use-pytorch-cross-attention, but forcing a backend is not automatically an improvement over the default.
Compare the same checkpoint, resolution, sampler, and batch. Check output quality as well as peak memory and elapsed time. Avoid installing an arbitrary xformers build into a working environment without checking its PyTorch/CUDA compatibility.
Tiled VAE Decoding
If sampling completes and decoding runs out of memory, change the decode stage before replacing the entire GPU.
The built-in VAE Decode (Tiled) node processes smaller regions. Its reviewed definition exposes tile_size and overlap; smaller tiles can reduce the working allocation while increasing work and boundary handling. Inspect the decoded image for artifacts. Node defaults and supported controls can change by release.
Tiling does not fix a model that fails to load or a sampling peak. For broader diagnostics, use the CUDA out-of-memory guide.
Model Offloading Strategies
Separate stages when their models do not need to be active together. For example, save a generated image before running an independent upscaler. Splitting a workflow can make the peak easier to understand and release unneeded components between runs.
ControlNet and the diffusion model may be required during the same sampling step. Drawing them as sequential nodes does not mean they can always run independently. Custom unloading nodes also have version and dependency requirements; verify their behavior rather than assuming a node name guarantees memory release.
FP8 and Quantized Models
Weight precision affects model storage, but reducing weight size does not reduce every runtime allocation proportionally. Check the specific model, loader, backend, and GPU support. Quantization can also affect output quality and speed.
The reviewed UNETLoader definition exposes a weight_dtype option. That does not imply the same option exists on every checkpoint loader, or that selecting it makes every model compatible.
GGUF Models in ComfyUI
ComfyUI-GGUF is a separate extension. Follow its model and node requirements. A Q4 or Q8 label alone does not specify total workflow VRAM, and this guide does not assign a universal image-quality percentage to a quantization level.
Workflow Design Patterns
- Queue individual images before increasing batch size. Smaller batches can reduce peak activations; total runtime and output are not guaranteed to match a batched run.
- Separate independent preprocessing. Save control inputs when the preprocessor does not need to remain active during sampling.
- Generate and upscale in separate passes. This changes the computation and sometimes the image; it is not a lossless substitute for every native-resolution workflow.
- Test video frame count separately from resolution. Both can affect memory. A setting that works for images is not a video-memory guarantee.
ControlNet Memory Optimization
Add conditioning components one at a time and compare the peak. Lighter models may use less memory but can behave differently from the original. A shorter ControlNet sampling range does not by itself prove that the implementation unloads its weights or eliminates the initial peak.
Monitoring VRAM Usage
Keep the ComfyUI logs and monitor the GPU while reproducing the same workflow:
nvidia-smi --query-gpu=timestamp,memory.used,memory.total,utilization.gpu --format=csv -l 1A one-second sample can miss a short peak. Record whether the failure happens during loading, sampling, or decoding. Watch host RAM too when models are offloaded. Compare a cold run and a repeated run because caching changes allocations.
| Symptom | First controlled experiment |
|---|---|
| Failure while loading | Check weight format and available GPU/host memory |
| Failure during sampling | Reduce batch, resolution, or frame count |
| Failure during VAE decode | Test tiled decoding |
| Failure after adding conditioning | Remove that component and rerun |
| Slow run with offloading | Inspect host RAM and model-transfer logs |
Recommended Settings by GPU VRAM
GPU capacity is a constraint, not a complete settings profile. On an 8GB or 12GB GPU, begin with one image and the model's supported settings. On 16–24GB cards, measure before increasing batch or adding conditioning. On 40GB+ hardware, large video tensors and concurrent models can still exceed capacity.
There is no universal maximum resolution, ControlNet count, or video frame count for a VRAM tier. Match the exact workflow to the GPU selector and verify with a representative run.
When Optimization Isn't Enough
If the required weights and active tensors still exceed the GPU's capacity, compare a smaller model, a supported quantized version, a changed workflow, or a larger GPU. Keep output requirements constant when comparing the cost of these choices.
The GPU catalog distinguishes model memory from multi-GPU configurations. Multiple GPUs do not automatically provide one contiguous allocation: the application must distribute the workload. Check configuration availability in the market, then use measured runtime in the cost calculator. This guide does not freeze an undated rental quote.
A useful hybrid approach is to develop a smaller local workflow and validate the full run on the target machine. Confirm model files, extensions, host RAM, and storage before moving the job.
Quick Reference Cheat Sheet
| Constraint | Candidate change | What to measure |
|---|---|---|
| Sampling tensors | Smaller batch or output | Peak memory and output requirements |
| Decode tensors | Tiled VAE | Peak, elapsed time, tile boundaries |
| Resident weights | Supported precision or offloading | Quality, host RAM, transfer overhead |
| Independent stages | Separate runs | Peak and saved intermediate data |
Further Reading
- SDXL VRAM Requirements Guide
- CUDA Out of Memory Fix
- RTX 3060 SDXL Real-World Limits
- GPU Selection for AI Training
- GPU Cost Calculator
Technical references reviewed: October 27, 2026. Commands and node controls depend on the installed ComfyUI version.
