aboutsummaryrefslogtreecommitdiffstats
path: root/modules/shared.py
diff options
context:
space:
mode:
authorevshiron <evshiron@gmail.com>2022-10-26 14:33:45 +0000
committerevshiron <evshiron@gmail.com>2022-10-26 14:39:08 +0000
commitfddb4883f4a408b3464076465e1b0949ebe0fc30 (patch)
treeb0aea09e8fec9fba7701f3141f029c2abd4cd11c /modules/shared.py
parent99d728b5b18829c8a6b7b2d69c9b9327dd257896 (diff)
downloadstable-diffusion-webui-gfx803-fddb4883f4a408b3464076465e1b0949ebe0fc30.tar.gz
stable-diffusion-webui-gfx803-fddb4883f4a408b3464076465e1b0949ebe0fc30.tar.bz2
stable-diffusion-webui-gfx803-fddb4883f4a408b3464076465e1b0949ebe0fc30.zip
prototype progress api
Diffstat (limited to 'modules/shared.py')
-rw-r--r--modules/shared.py13
1 files changed, 13 insertions, 0 deletions
diff --git a/modules/shared.py b/modules/shared.py
index 1a9b8289..00f61898 100644
--- a/modules/shared.py
+++ b/modules/shared.py
@@ -146,6 +146,19 @@ class State:
def get_job_timestamp(self):
return datetime.datetime.now().strftime("%Y%m%d%H%M%S") # shouldn't this return job_timestamp?
+ def js(self):
+ obj = {
+ "skipped": self.skipped,
+ "interrupted": self.skipped,
+ "job": self.job,
+ "job_count": self.job_count,
+ "job_no": self.job_no,
+ "sampling_step": self.sampling_step,
+ "sampling_steps": self.sampling_steps,
+ }
+
+ return json.dumps(obj)
+
state = State()