stable-diffusion-webui
stable-diffusion-webui copied to clipboard
[Bug]: RuntimeError: CUDA out of memory
Is there an existing issue for this?
- [X] I have searched the existing issues and checked the recent builds/commits
What happened?
every time i try and genatre an image it fails after a few sec and gives RuntimeError: CUDA out of memory. Tried to allocate 20.00 MiB (GPU 0; 6.00 GiB total capacity; 5.26 GiB already allocated; 0 bytes free; 5.33 GiB reserved in total by PyTorch) If reserved memory is >> allocated memory try setting max_split_size_mb to avoid fragmentation. See documentation for Memory Management and PYTORCH_CUDA_ALLOC_CONF this sometimes aslo shows during starting up. it did work for a little bit but after a wale this started happing, reinstalling did not help nor did any older versions.
Steps to reproduce the problem
- Go to install dir
- Press run wepui-user (or launch.py) with args
--xformers --opt-split-attention --precision full --no-half - enter prompt and try an generate
What should have happened?
memory should be cleared, and be able to generate
Commit where the problem happens
6bd6154a92eb05c80d66df661a38f8b70cc13729
What platforms do you use to access UI ?
Windows
What browsers do you use to access the UI ?
Mozilla Firefox
Command Line Arguments
--xformers --opt-split-attention --precision full --no-half
Additional information, context and logs
GPU:NVIDIA GeForce GTX 1660 Ti
log:

Is 6GB actually enough?
try with --medvram ?
I sometimes got this specific 20MiB CUDA OOM Error when I was still loading the nai.YAML file. If you are loading the .yaml on startup, back up the .yaml somewhere and remove it from your models/stable-diffusion folder.
try with --medvram ?
will give it a try again, tho last times i had it enabled it still happened
try with --medvram ?
will give it a try again, tho last time i had it enabled it still happened
so seams it can actually run now tho i only did it once, not sure if it will happen again in some time. will do more testing to find out
Try without --precision full --no-half commands, maybe... When I used these, I also ran into memory errors, even though I have a 12 GB card.
Still happening when I change between model. I have to restart the BAT file every time. I wanted to make a X/Y output and is imposible.

it used to work normally a few days ago
Try without
--precision full --no-halfcommands, maybe... When I used these, I also ran into memory errors, even though I have a 12 GB card.
Running without this just causing output images to be black
In case anyone needs it. I solved it by making a clean installation. No pulling, no replacing files.
clean one. I just (of course) copied the: -models folder -embeddings folder (in case you have anything there) -output folder (in case you wan to keep your creations)
I have a rtx 3070 ti 8gb
set COMMANDLINE_ARGS=--listen --no-half --precision full --port 9999 --disable-safe-unpickle --deepdanbooru
now it works perfect and I can change between models and creates X/Y comparisons
@nagaisa is running sd on an old card that is unable to run the model in float 16, only the 3XXX (newer) cards, can do it. Float 16 will use less vram.
those parameters --precision full --no-half are needed to run in float 32. Use the --medvram argument, or even --lowvram when you're needing larger images. Disable browser hardware acceleration.
These should prevent OOM issues.
its bean a bit but i still am running into the issue somewhat
In case anyone needs it. I solved it by making a clean installation. No pulling, no replacing files.
clean one. I just (of course) copied the: -models folder -embeddings folder (in case you have anything there) -output folder (in case you wan to keep your creations)
I have a rtx 3070 ti 8gb
set COMMANDLINE_ARGS=--listen --no-half --precision full --port 9999 --disable-safe-unpickle --deepdanbooru
now it works perfect and I can change between models and creates X/Y comparisons
Now it doesn't work for me anymore: This site can’t be reachedThe webpage at http://0.0.0.0:7420/ might be temporarily down or it may have moved permanently to a new web address. ERR_ADDRESS_INVALID
In case anyone needs it. I solved it by making a clean installation. No pulling, no replacing files. clean one. I just (of course) copied the: -models folder -embeddings folder (in case you have anything there) -output folder (in case you wan to keep your creations) I have a rtx 3070 ti 8gb set COMMANDLINE_ARGS=--listen --no-half --precision full --port 9999 --disable-safe-unpickle --deepdanbooru now it works perfect and I can change between models and creates X/Y comparisons
Now it doesn't work for me anymore: This site can’t be reachedThe webpage at http://0.0.0.0:7420/ might be temporarily down or it may have moved permanently to a new web address. ERR_ADDRESS_INVALID
try with 127.0.0.1:7420
I am pretty sure the argument --port 9999 means it will be at http://127.0.0.1:9999
I have a NVIDIA GTX 1660 Ti SUPER, but all methods dont work
@OlegXio i have the exact same gpu did you fix the issue?
No, I didn't fix the problem. I'm just temporarily not using SD until the issue is resolved