Skip to main content
VRAM DIFFUSIONVRAM STUDIO // FLUX.1 & WAN2.2 OFFLOAD + GPU BATCH STUDIO FP8 + SAGEATTN | VULTR $300 GPU CREDIT | XIAOMI MIMO OFFLOAD | BASELINE 2026-10-13
ComfyUIFluxGPU
ComfyUIFluxGPU Affiliate Notice: Outbound /go/ links marked rel="sponsored" may earn a partner commission at zero added cost (Affiliate Policy).
VRAM & CUDA Tuning

Stopping CUDA Fragmentation With PYTORCH_CUDA_ALLOC_CONF

Set expandable_segments:True and max_split_size_mb:256 to eliminate false CUDA Out-of-Memory errors when nvidia-smi shows 3+ GB free.

Reclaims 1.5-3.2 GB Fragmented VRAM · Zero Perf Penalty

Stopping CUDA Fragmentation With PYTORCH_CUDA_ALLOC_CONF
VRAM & offload baseline verified 2026-10-13 by DiffusionVRAM Studio.

Why OOM Happens With 3 GB Reported Free

Switching between T5-XXL, Flux DiT, ControlNet, and tiled VAE leaves Swiss-cheese gaps in PyTorch reserved blocks. When VAE requests a contiguous 1.8 GB tensor, allocation fails.

Zero-Cost Drop-In in comfyui-launch.sh

Exporting PYTORCH_CUDA_ALLOC_CONF="expandable_segments:True,max_split_size_mb:256" lets CUDA map virtual segments into non-contiguous physical pages cleanly.

Measured Thresholds & ComfyUI Configuration Matrix

Environment VariableRecommended ValueEffect on ComfyUI Memory
PYTORCH_CUDA_ALLOC_CONFexpandable_segments:TrueMaps virtual CUDA blocks instead of rigid slabs
max_split_size_mb256Prevents splitting large 1+ GB DiT allocations
CUDA_MODULE_LOADINGLAZYAvoids loading unused cuBLAS/cuDNN kernels into VRAM
Reclaims 1.5-3.2 GB Fragmented VRAM · Zero Perf Penalty Claim $300 GPU CreditXiaomi MiMo API