call torch_gc() to fix VRAM usage spike when call decode_first_stage()

This commit is contained in:
Won-Kyu Park 2024-09-19 13:34:16 +09:00
parent 380e9a84c3
commit 71b430f703
No known key found for this signature in database
GPG Key ID: 53AA79C8C9535D15

View File

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