From 51fb1a43de7fc49e7ac1652768c3a155f50b6470 Mon Sep 17 00:00:00 2001 From: cmdr2 Date: Tue, 8 Nov 2022 19:02:21 +0530 Subject: [PATCH] Temporarily disable the idle CPU unloading behavior, since it's not clear whether it'll reload the model if a future request for the CPU is received after it has unloaded the model --- ui/sd_internal/task_manager.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/ui/sd_internal/task_manager.py b/ui/sd_internal/task_manager.py index c5533fd9..71817358 100644 --- a/ui/sd_internal/task_manager.py +++ b/ui/sd_internal/task_manager.py @@ -273,11 +273,11 @@ def thread_render(device): return task = thread_get_next_task() if task is None: - if runtime.thread_data.device == 'cpu' and is_alive() > 1 and hasattr(runtime.thread_data, 'lastActive') and time.time() - runtime.thread_data.lastActive > CPU_UNLOAD_TIMEOUT: - # GPUs present and CPU is idle. Unload resources. - runtime.unload_models() - runtime.unload_filters() - del runtime.thread_data.lastActive + # if runtime.thread_data.device == 'cpu' and is_alive() > 1 and hasattr(runtime.thread_data, 'lastActive') and time.time() - runtime.thread_data.lastActive > CPU_UNLOAD_TIMEOUT: + # # GPUs present and CPU is idle. Unload resources. + # runtime.unload_models() + # runtime.unload_filters() + # del runtime.thread_data.lastActive time.sleep(1) continue if task.error is not None: