CRE-2025-0162
Stable Diffusion WebUI CUDA Out of Memory CrashHighImpact: 8/10Mitigation: 7/10
Description
Detects critical CUDA out of memory errors in Stable Diffusion WebUI that cause image generation failures and application crashes. This occurs when GPU VRAM is exhausted during model loading or image generation, resulting in complete task failure and potential WebUI instability.\n
Mitigation
IMMEDIATE ACTIONS:\n- Restart Stable Diffusion WebUI\n- Clear GPU memory: nvidia-smi --gpu-reset\n- Add memory optimization flags: --medvram or --lowvram\nCONFIGURATION FIXES:\n- For 4-6GB VRAM: Add --medvram to webui-user.bat\n- For 2-4GB VRAM: Add --lowvram to webui-user.bat\n- Enable xformers: --xformers for memory efficiency\n- Add --always-batch-cond-uncond for batch processing\nRUNTIME ADJUSTMENTS:\n- Reduce image resolution (512x512 instead of 1024x1024)\n- Decrease batch size to 1\n- Lower batch count for multiple generations\n- Set PYTORCH_CUDA_ALLOC_CONF=garbage_collection_threshold:0.9,max_split_size_mb:512\nPREVENTION:\n- Monitor GPU memory usage with nvidia-smi\n- Implement gradual resolution scaling\n- Use cloud services for high-resolution generation\n- Upgrade to GPU with minimum 8GB VRAM\n