aboutsummaryrefslogtreecommitdiffstats
path: root/launch.py
diff options
context:
space:
mode:
authorAUTOMATIC <16777216c@gmail.com>2023-05-08 12:23:49 +0000
committerAUTOMATIC <16777216c@gmail.com>2023-05-08 12:23:49 +0000
commitab4ab4e595e89d1a9a39db70539d5944fdbe47fa (patch)
tree8b599241b3954d30f5d2d7ff8aea201620fda797 /launch.py
parent505a10ad928eb11849828c88850ce3e5e3566fe4 (diff)
downloadstable-diffusion-webui-gfx803-ab4ab4e595e89d1a9a39db70539d5944fdbe47fa.tar.gz
stable-diffusion-webui-gfx803-ab4ab4e595e89d1a9a39db70539d5944fdbe47fa.tar.bz2
stable-diffusion-webui-gfx803-ab4ab4e595e89d1a9a39db70539d5944fdbe47fa.zip
add version to infotext, footer and console output when starting
Diffstat (limited to 'launch.py')
-rw-r--r--launch.py17
1 files changed, 17 insertions, 0 deletions
diff --git a/launch.py b/launch.py
index 1dc12dae..2a33adc8 100644
--- a/launch.py
+++ b/launch.py
@@ -19,6 +19,7 @@ python = sys.executable
git = os.environ.get('GIT', "git")
index_url = os.environ.get('INDEX_URL', "")
stored_commit_hash = None
+stored_git_tag = None
dir_repos = "repositories"
if 'GRADIO_ANALYTICS_ENABLED' not in os.environ:
@@ -70,6 +71,20 @@ def commit_hash():
return stored_commit_hash
+def git_tag():
+ global stored_git_tag
+
+ if stored_git_tag is not None:
+ return stored_git_tag
+
+ try:
+ stored_git_tag = run(f"{git} describe --tags").strip()
+ except Exception:
+ stored_git_tag = "<none>"
+
+ return stored_git_tag
+
+
def run(command, desc=None, errdesc=None, custom_env=None, live=False):
if desc is not None:
print(desc)
@@ -246,8 +261,10 @@ def prepare_environment():
check_python_version()
commit = commit_hash()
+ tag = git_tag()
print(f"Python {sys.version}")
+ print(f"Version: {tag}")
print(f"Commit hash: {commit}")
if args.reinstall_torch or not is_installed("torch") or not is_installed("torchvision"):