CRE-2025-0162: Stable Diffusion WebUI CUDA Out of Memory Detection#146
Merged
tonymeehan merged 2 commits intoprequel-dev:mainfrom Sep 3, 2025
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
CRE-2025-0162: Stable Diffusion WebUI CUDA Out of Memory Detection
closes #130
/claim #130
🎯 Overview
This PR introduces a comprehensive detection rule for Stable Diffusion WebUI CUDA Out of Memory errors - addressing critical GPU memory exhaustion that causes complete image generation failures and WebUI crashes. The rule identifies VRAM shortage during model loading and image generation, requiring immediate intervention to prevent service disruption.
CRE Playground Links
CRE-2025-0162 Playground: Test Rule
📊 SD WebUI Issues Covered
torch.cuda.OutOfMemoryError: CUDA out of memory. Tried to allocate 2.00 GiBStable Diffusion model failed to load: OutOfMemoryErrorFailed to generate image: CUDA out of memoryGPU 0 has a total capacity of 6.00 GiB of which 1.20 GiB is freeRuntimeError: CUDA out of memory. Tried to allocate 2.00 GiBtorch.cuda.OutOfMemoryError: CUDA out of memory. Tried to allocate 1.50 GiBImage generation failed after retryWebUI shutting down due to memory error🧪 Testing & Validation
🎬 Demo Environment
Repo link: https://github.com/piyzard/cre-2025-0162
Screencast.from.2025-08-31.17-01-45.mp4
💡 Mitigation Strategies
Immediate Actions:
nvidia-smi --gpu-reset--medvramor--lowvramConfiguration Fixes:
--medvramto webui-user.bat--lowvramto webui-user.bat--xformersfor memory efficiencyRuntime Adjustments:
PYTORCH_CUDA_ALLOC_CONF=garbage_collection_threshold:0.9,max_split_size_mb:512References