aboutsummaryrefslogtreecommitdiff
path: root/modules
diff options
context:
space:
mode:
Diffstat (limited to 'modules')
-rw-r--r--modules/processing.py3
-rw-r--r--modules/shared.py1
-rw-r--r--modules/ui.py5
3 files changed, 7 insertions, 2 deletions
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