diff options
author | EyeDeck <eyedeck@gmail.com> | 2022-09-11 22:15:30 +0000 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-09-11 22:15:30 +0000 |
commit | e05e46aa3f3b2230affe399372ad96d8736e4010 (patch) | |
tree | e51f423443ad2fd77da2c4b9f3c6d25f563fca66 /modules/devices.py | |
parent | 29a2933e23e68900bbae741a98439d0c9d6f26f6 (diff) | |
parent | 303b75c1490e8f9e146ba207f3425a7f0317cb12 (diff) | |
download | stable-diffusion-webui-gfx803-e05e46aa3f3b2230affe399372ad96d8736e4010.tar.gz stable-diffusion-webui-gfx803-e05e46aa3f3b2230affe399372ad96d8736e4010.tar.bz2 stable-diffusion-webui-gfx803-e05e46aa3f3b2230affe399372ad96d8736e4010.zip |
Merge branch 'master' into master
Diffstat (limited to 'modules/devices.py')
-rw-r--r-- | modules/devices.py | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/modules/devices.py b/modules/devices.py index 30d30b99..f88e807e 100644 --- a/modules/devices.py +++ b/modules/devices.py @@ -14,3 +14,9 @@ def get_optimal_device(): return torch.device("mps") return cpu + + +def torch_gc(): + if torch.cuda.is_available(): + torch.cuda.empty_cache() + torch.cuda.ipc_collect() |