diff options
author | EyeDeck <eyedeck@gmail.com> | 2022-09-18 11:03:17 +0000 |
---|---|---|
committer | EyeDeck <eyedeck@gmail.com> | 2022-09-18 11:03:17 +0000 |
commit | 46db1405df64db4c543b7cc9db958479a3db200f (patch) | |
tree | 9fd80dd1a8362c874d7a440d2bf0e4cc9cf36e1d | |
parent | fabaf4bddb6f5968bffe75e7766f7687813c4d36 (diff) | |
download | stable-diffusion-webui-gfx803-46db1405df64db4c543b7cc9db958479a3db200f.tar.gz stable-diffusion-webui-gfx803-46db1405df64db4c543b7cc9db958479a3db200f.tar.bz2 stable-diffusion-webui-gfx803-46db1405df64db4c543b7cc9db958479a3db200f.zip |
...and make sure it can't get stuck on
in case someone sets opts.memmon_poll_rate to 0 during generation
-rw-r--r-- | modules/ui.py | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/modules/ui.py b/modules/ui.py index 8ca3e87f..451ad253 100644 --- a/modules/ui.py +++ b/modules/ui.py @@ -119,7 +119,8 @@ def save_files(js_data, images, index): def wrap_gradio_call(func):
def f(*args, **kwargs):
- if opts.memmon_poll_rate > 0 and not shared.mem_mon.disabled:
+ run_memmon = opts.memmon_poll_rate > 0 and not shared.mem_mon.disabled
+ if run_memmon:
shared.mem_mon.monitor()
t = time.perf_counter()
@@ -137,7 +138,7 @@ def wrap_gradio_call(func): elapsed = time.perf_counter() - t
- if opts.memmon_poll_rate > 0 and not shared.mem_mon.disabled:
+ if run_memmon:
mem_stats = {k: -(v//-(1024*1024)) for k, v in shared.mem_mon.stop().items()}
active_peak = mem_stats['active_peak']
reserved_peak = mem_stats['reserved_peak']
|