From 71b430f703df99c0809904fa9facc9366d8c3c9e Mon Sep 17 00:00:00 2001 From: Won-Kyu Park Date: Thu, 19 Sep 2024 13:34:16 +0900 Subject: [PATCH] call torch_gc() to fix VRAM usage spike when call decode_first_stage() --- modules/lowvram.py | 1 + 1 file changed, 1 insertion(+) diff --git a/modules/lowvram.py b/modules/lowvram.py index 6728c337b..9914a06c6 100644 --- a/modules/lowvram.py +++ b/modules/lowvram.py @@ -53,6 +53,7 @@ def setup_for_low_vram(sd_model, use_medvram): if module_in_gpu is not None: module_in_gpu.to(cpu) + devices.torch_gc() module.to(devices.device) module_in_gpu = module