diff options
author | AUTOMATIC <16777216c@gmail.com> | 2022-09-12 08:55:27 +0000 |
---|---|---|
committer | AUTOMATIC <16777216c@gmail.com> | 2022-09-12 08:55:27 +0000 |
commit | 9bb20be09092bb6c568f676b63105fb85b0c05cf (patch) | |
tree | 41fd3d246dd3f3f64f8dd17a178146b0896c3cf1 /modules/lowvram.py | |
parent | ab0a79cdf40a149442a759226cf990b7f3033b01 (diff) | |
download | stable-diffusion-webui-gfx803-9bb20be09092bb6c568f676b63105fb85b0c05cf.tar.gz stable-diffusion-webui-gfx803-9bb20be09092bb6c568f676b63105fb85b0c05cf.tar.bz2 stable-diffusion-webui-gfx803-9bb20be09092bb6c568f676b63105fb85b0c05cf.zip |
memory optimization for CLIP interrogator
changed default cfg_scale to a higher value
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 = {}
|