aboutsummaryrefslogtreecommitdiff
path: root/modules/lowvram.py
diff options
context:
space:
mode:
authorAUTOMATIC1111 <16777216c@gmail.com>2023-06-27 09:02:38 +0300
committerGitHub <noreply@github.com>2023-06-27 09:02:38 +0300
commit58a9a261c4feb729717c386fea70f8ea985c6722 (patch)
treeebc822c17a889034672297d7450477f7c945cbb7 /modules/lowvram.py
parent373ff5a217eca33607abb692b9ebfa38abb7fe33 (diff)
parent2c43dd766da52d2ccaaa78d8f265a6a4aa33b9df (diff)
Merge branch 'dev' into meta_class
Diffstat (limited to 'modules/lowvram.py')
-rw-r--r--modules/lowvram.py6
1 files changed, 6 insertions, 0 deletions
diff --git a/modules/lowvram.py b/modules/lowvram.py
index e254cc13..d95bcfbf 100644
--- a/modules/lowvram.py
+++ b/modules/lowvram.py
@@ -15,6 +15,8 @@ def send_everything_to_cpu():
def setup_for_low_vram(sd_model, use_medvram):
+ sd_model.lowvram = True
+
parents = {}
def send_me_to_gpu(module, _):
@@ -96,3 +98,7 @@ def setup_for_low_vram(sd_model, use_medvram):
diff_model.middle_block.register_forward_pre_hook(send_me_to_gpu)
for block in diff_model.output_blocks:
block.register_forward_pre_hook(send_me_to_gpu)
+
+
+def is_enabled(sd_model):
+ return getattr(sd_model, 'lowvram', False)