mirror of
https://github.com/AUTOMATIC1111/stable-diffusion-webui.git
synced 2025-08-03 19:02:27 +00:00
fix memory leak when generation fails
This commit is contained in:
@@ -3,7 +3,7 @@ import html
|
||||
import threading
|
||||
import time
|
||||
|
||||
from modules import shared, progress, errors
|
||||
from modules import shared, progress, errors, devices
|
||||
|
||||
queue_lock = threading.Lock()
|
||||
|
||||
@@ -75,6 +75,8 @@ def wrap_gradio_call(func, extra_outputs=None, add_stats=False):
|
||||
error_message = f'{type(e).__name__}: {e}'
|
||||
res = extra_outputs_array + [f"<div class='error'>{html.escape(error_message)}</div>"]
|
||||
|
||||
devices.torch_gc()
|
||||
|
||||
shared.state.skipped = False
|
||||
shared.state.interrupted = False
|
||||
shared.state.job_count = 0
|
||||
|
Reference in New Issue
Block a user