From 9bb20be09092bb6c568f676b63105fb85b0c05cf Mon Sep 17 00:00:00 2001 From: AUTOMATIC <16777216c@gmail.com> Date: Mon, 12 Sep 2022 11:55:27 +0300 Subject: memory optimization for CLIP interrogator changed default cfg_scale to a higher value --- modules/lowvram.py | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'modules/lowvram.py') 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 = {} -- cgit v1.2.3