lllyasviel commited on
Commit
ef3acbf
1 Parent(s): 599dfe9
Files changed (2) hide show
  1. launch.py +7 -0
  2. modules/launch_util.py +17 -0
launch.py CHANGED
@@ -1,6 +1,8 @@
1
  import os
2
  import sys
3
 
 
 
4
 
5
  def prepare_environment():
6
  torch_index_url = os.environ.get('TORCH_INDEX_URL', "https://download.pytorch.org/whl/cu118")
@@ -12,7 +14,12 @@ def prepare_environment():
12
  comfy_repo = os.environ.get('COMFY_REPO', "https://github.com/comfyanonymous/ComfyUI.git")
13
  comfy_commit_hash = os.environ.get('COMFY_COMMIT_HASH', "5ac96897e9782805cd5e8fe85bd98ad03eae2b6f")
14
 
 
 
 
15
  print(f"Python {sys.version}")
 
 
16
 
17
 
18
  prepare_environment()
 
1
  import os
2
  import sys
3
 
4
+ from modules.launch_util import commit_hash, fooocus_tag
5
+
6
 
7
  def prepare_environment():
8
  torch_index_url = os.environ.get('TORCH_INDEX_URL', "https://download.pytorch.org/whl/cu118")
 
14
  comfy_repo = os.environ.get('COMFY_REPO', "https://github.com/comfyanonymous/ComfyUI.git")
15
  comfy_commit_hash = os.environ.get('COMFY_COMMIT_HASH', "5ac96897e9782805cd5e8fe85bd98ad03eae2b6f")
16
 
17
+ commit = commit_hash()
18
+ tag = fooocus_tag
19
+
20
  print(f"Python {sys.version}")
21
+ print(f"Version: {tag}")
22
+ print(f"Commit hash: {commit}")
23
 
24
 
25
  prepare_environment()
modules/launch_util.py ADDED
@@ -0,0 +1,17 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import os
2
+
3
+ import subprocess
4
+ from functools import lru_cache
5
+
6
+
7
+ git = os.environ.get('GIT', "git")
8
+ fooocus_tag = '1.0.0'
9
+
10
+
11
+ @lru_cache()
12
+ def commit_hash():
13
+ try:
14
+ return subprocess.check_output([git, "rev-parse", "HEAD"], shell=False, encoding='utf8').strip()
15
+ except Exception:
16
+ return "<none>"
17
+