diff options
author | AUTOMATIC <16777216c@gmail.com> | 2022-10-30 06:10:22 +0000 |
---|---|---|
committer | AUTOMATIC <16777216c@gmail.com> | 2022-10-30 06:10:22 +0000 |
commit | 149784202cca8612b43629c601ee27cfda64e623 (patch) | |
tree | 5e6121de8c0b0e935159f01fdedbb7b8a221f8b8 /webui.py | |
parent | 060ee5d3a7ba258f944d0c891f90ac4a65411446 (diff) | |
download | stable-diffusion-webui-gfx803-149784202cca8612b43629c601ee27cfda64e623.tar.gz stable-diffusion-webui-gfx803-149784202cca8612b43629c601ee27cfda64e623.tar.bz2 stable-diffusion-webui-gfx803-149784202cca8612b43629c601ee27cfda64e623.zip |
rework #3722 to not introduce duplicate code
Diffstat (limited to 'webui.py')
-rw-r--r-- | webui.py | 19 |
1 files changed, 3 insertions, 16 deletions
@@ -46,26 +46,13 @@ def wrap_queued_call(func): def wrap_gradio_gpu_call(func, extra_outputs=None):
def f(*args, **kwargs):
- devices.torch_gc()
-
- shared.state.sampling_step = 0
- shared.state.job_count = -1
- shared.state.job_no = 0
- shared.state.job_timestamp = shared.state.get_job_timestamp()
- shared.state.current_latent = None
- shared.state.current_image = None
- shared.state.current_image_sampling_step = 0
- shared.state.skipped = False
- shared.state.interrupted = False
- shared.state.textinfo = None
+
+ shared.state.begin()
with queue_lock:
res = func(*args, **kwargs)
- shared.state.job = ""
- shared.state.job_count = 0
-
- devices.torch_gc()
+ shared.state.end()
return res
|