From 395f1705979193a0525e1479f0d263e9751e3793 Mon Sep 17 00:00:00 2001 From: AUTOMATIC <16777216c@gmail.com> Date: Tue, 6 Sep 2022 10:11:25 +0300 Subject: readme extras for VRAM for added missing packages to requirements for #74 add support for negative numbers in X/Y plot (plus ranges) #73 changed progressbar to work properly with custom modes --- modules/processing.py | 3 ++- modules/shared.py | 1 + modules/ui.py | 5 ++++- 3 files changed, 7 insertions(+), 2 deletions(-) (limited to 'modules') diff --git a/modules/processing.py b/modules/processing.py index 1351579b..e8923a7a 100644 --- a/modules/processing.py +++ b/modules/processing.py @@ -153,7 +153,8 @@ def process_images(p: StableDiffusionProcessing) -> Processed: with torch.no_grad(), precision_scope("cuda"), ema_scope(): p.init() - state.job_count = p.n_iter + if state.job_count == -1: + state.job_count = p.n_iter for n in range(p.n_iter): if state.interrupted: diff --git a/modules/shared.py b/modules/shared.py index 53861daf..d57aba37 100644 --- a/modules/shared.py +++ b/modules/shared.py @@ -54,6 +54,7 @@ class State: self.job_no += 1 self.sampling_step = 0 + state = State() artist_db = modules.artists.ArtistsDatabase(os.path.join(script_path, 'artists.csv')) diff --git a/modules/ui.py b/modules/ui.py index a9e4fd00..1df74070 100644 --- a/modules/ui.py +++ b/modules/ui.py @@ -140,7 +140,10 @@ def check_progress_call(): if shared.state.job_count == 0: return "" - progress = shared.state.job_no / shared.state.job_count + progress = 0 + + if shared.state.job_count > 0: + progress += shared.state.job_no / shared.state.job_count if shared.state.sampling_steps > 0: progress += 1 / shared.state.job_count * shared.state.sampling_step / shared.state.sampling_steps -- cgit v1.2.1