aboutsummaryrefslogtreecommitdiffstats
path: root/modules/lowvram.py
diff options
context:
space:
mode:
authorAUTOMATIC1111 <16777216c@gmail.com>2022-09-12 10:23:58 +0000
committerGitHub <noreply@github.com>2022-09-12 10:23:58 +0000
commitc094f00e100f28f05bbef1b7572f38940ca27862 (patch)
tree881d96f0c84ad7f990e4fbb0ca1cdd2f3039ec4b /modules/lowvram.py
parente05e46aa3f3b2230affe399372ad96d8736e4010 (diff)
parentddc86f2edb1db6ac3b708cf4a6ad6da5601d778c (diff)
downloadstable-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.py10
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 = {}