diff options
author | AUTOMATIC <16777216c@gmail.com> | 2023-01-05 08:57:01 +0000 |
---|---|---|
committer | AUTOMATIC <16777216c@gmail.com> | 2023-01-05 08:57:14 +0000 |
commit | 997461d3dd86f51c06ea0c2eff17ce8b8b48c0af (patch) | |
tree | b402765a18b49e66e37d90c99bf56ce0f6e0dc0f /launch.py | |
parent | 01a1fee874e12eb68d849a31bbf177c69ff4cc22 (diff) | |
download | stable-diffusion-webui-gfx803-997461d3dd86f51c06ea0c2eff17ce8b8b48c0af.tar.gz stable-diffusion-webui-gfx803-997461d3dd86f51c06ea0c2eff17ce8b8b48c0af.tar.bz2 stable-diffusion-webui-gfx803-997461d3dd86f51c06ea0c2eff17ce8b8b48c0af.zip |
add footer with versions
Diffstat (limited to 'launch.py')
-rw-r--r-- | launch.py | 20 |
1 files changed, 16 insertions, 4 deletions
@@ -13,6 +13,21 @@ dir_extensions = "extensions" python = sys.executable
git = os.environ.get('GIT', "git")
index_url = os.environ.get('INDEX_URL', "")
+stored_commit_hash = None
+
+
+def commit_hash():
+ global stored_commit_hash
+
+ if stored_commit_hash is not None:
+ return stored_commit_hash
+
+ try:
+ stored_commit_hash = run(f"{git} rev-parse HEAD").strip()
+ except Exception:
+ stored_commit_hash = "<none>"
+
+ return stored_commit_hash
def extract_arg(args, name):
@@ -194,10 +209,7 @@ def prepare_environment(): xformers = '--xformers' in sys.argv
ngrok = '--ngrok' in sys.argv
- try:
- commit = run(f"{git} rev-parse HEAD").strip()
- except Exception:
- commit = "<none>"
+ commit = commit_hash()
print(f"Python {sys.version}")
print(f"Commit hash: {commit}")
|