fix for conds of second hires fox pass being calculated using first pass's networks, and add an option to revert to old behavior

This commit is contained in:
AUTOMATIC
2023-06-04 13:07:22 +03:00
parent 1c6dca9383
commit 1ca5e76f7b
3 changed files with 36 additions and 3 deletions

View File

@@ -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)