diff options
author | AUTOMATIC1111 <16777216c@gmail.com> | 2022-09-12 10:23:58 +0000 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-09-12 10:23:58 +0000 |
commit | c094f00e100f28f05bbef1b7572f38940ca27862 (patch) | |
tree | 881d96f0c84ad7f990e4fbb0ca1cdd2f3039ec4b /modules/lowvram.py | |
parent | e05e46aa3f3b2230affe399372ad96d8736e4010 (diff) | |
parent | ddc86f2edb1db6ac3b708cf4a6ad6da5601d778c (diff) | |
download | stable-diffusion-webui-gfx803-c094f00e100f28f05bbef1b7572f38940ca27862.tar.gz stable-diffusion-webui-gfx803-c094f00e100f28f05bbef1b7572f38940ca27862.tar.bz2 stable-diffusion-webui-gfx803-c094f00e100f28f05bbef1b7572f38940ca27862.zip |
Merge branch 'master' into master
Diffstat (limited to 'modules/lowvram.py')
-rw-r--r-- | modules/lowvram.py | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/modules/lowvram.py b/modules/lowvram.py index 079386c3..7eba1349 100644 --- a/modules/lowvram.py +++ b/modules/lowvram.py @@ -5,6 +5,16 @@ module_in_gpu = None cpu = torch.device("cpu")
device = gpu = get_optimal_device()
+
+def send_everything_to_cpu():
+ global module_in_gpu
+
+ if module_in_gpu is not None:
+ module_in_gpu.to(cpu)
+
+ module_in_gpu = None
+
+
def setup_for_low_vram(sd_model, use_medvram):
parents = {}
|