aboutsummaryrefslogtreecommitdiff
path: root/webui.py
diff options
context:
space:
mode:
Diffstat (limited to 'webui.py')
-rw-r--r--webui.py8
1 files changed, 8 insertions, 0 deletions
diff --git a/webui.py b/webui.py
index be1bc769..5fd65edc 100644
--- a/webui.py
+++ b/webui.py
@@ -1,4 +1,8 @@
import os
+import threading
+
+from modules import devices
+from modules.paths import script_path
import signal
import threading
import modules.paths
@@ -44,6 +48,8 @@ def wrap_queued_call(func):
def wrap_gradio_gpu_call(func):
def f(*args, **kwargs):
+ devices.torch_gc()
+
shared.state.sampling_step = 0
shared.state.job_count = -1
shared.state.job_no = 0
@@ -59,6 +65,8 @@ def wrap_gradio_gpu_call(func):
shared.state.job = ""
shared.state.job_count = 0
+ devices.torch_gc()
+
return res
return modules.ui.wrap_gradio_call(f)