diff options
author | AUTOMATIC <16777216c@gmail.com> | 2022-09-11 20:24:24 +0000 |
---|---|---|
committer | AUTOMATIC <16777216c@gmail.com> | 2022-09-11 20:24:24 +0000 |
commit | 8fb9c57ed62dcef721d50c1eeb9c20f65c509215 (patch) | |
tree | e30c32744eba482bf82e488f41d874ddf768eac0 /modules/devices.py | |
parent | d97c6f221ff9f97823c7ffce181a243dec895fa1 (diff) | |
download | stable-diffusion-webui-gfx803-8fb9c57ed62dcef721d50c1eeb9c20f65c509215.tar.gz stable-diffusion-webui-gfx803-8fb9c57ed62dcef721d50c1eeb9c20f65c509215.tar.bz2 stable-diffusion-webui-gfx803-8fb9c57ed62dcef721d50c1eeb9c20f65c509215.zip |
add half() supporrt for CLIP interrogation
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() |