aboutsummaryrefslogtreecommitdiff
path: root/modules
diff options
context:
space:
mode:
authorAUTOMATIC <16777216c@gmail.com>2022-09-06 10:11:25 +0300
committerAUTOMATIC <16777216c@gmail.com>2022-09-06 10:11:25 +0300
commit395f1705979193a0525e1479f0d263e9751e3793 (patch)
treef18ac2c247a780728aa61972d27170b655ff7579 /modules
parentbeece7d85cdcf160a0dc0ba05721d64f6afc867a (diff)
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
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