Skip to content

Commit 02e38d3

Browse files
committed
Add requirements.txt
1 parent 7ab083e commit 02e38d3

File tree

4 files changed

+31
-14
lines changed

4 files changed

+31
-14
lines changed

.gitignore

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1,2 @@
1-
__pycache__/
1+
__pycache__/
2+
venv/

install.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,12 @@ def ensure(module_name, min_version=None):
3939
ensure('transforms3d', '0.4.1')
4040

4141
ensure('imageio') # 2.4.1
42-
ensure('imageio-ffmpeg')
42+
try: # Dirty hack to not reinstall every time
43+
importlib_metadata.version('imageio-ffmpeg')
44+
except:
45+
ensure('imageio-ffmpeg')
46+
47+
4348
if not launch.is_installed("networkx"):
4449
launch.run_pip('install install "networkx==2.5"', "networkx requirement for depthmap script")
4550
if platform.system() == 'Windows':

requirements.txt

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
# Requirements for running in standalone mode
2+
# First, install the corect version of PyTorch!
3+
# PyTorch Compute Platform must match the configuration of the hardware.
4+
5+
# pip install -r requirements.txt
6+
torch
7+
gradio>=3.32.0,<4.0 # User UI
8+
timm~=0.6.12 # For midas
9+
matplotlib
10+
trimesh # For creating simple meshes
11+
numba>=0.57.0 # Speeding up CPU stereoimage generation
12+
vispy>=0.13.0
13+
rembg>=2.0.50 # Remove background
14+
moviepy>=1.0.2,<2.0
15+
transforms3d>=0.4.1
16+
imageio>=2.4.1,<3.0
17+
imageio-ffmpeg
18+
networkx>=2.5
19+
pyqt5; sys_platform == 'windows'
20+
pyqt6; sys_platform != 'windows'

src/misc.py

Lines changed: 3 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -4,20 +4,11 @@
44
import builtins
55

66
def get_commit_hash():
7-
def call_git(dir):
7+
try:
8+
file_path = pathlib.Path(__file__).parent
89
return subprocess.check_output(
910
[os.environ.get("GIT", "git"), "rev-parse", "HEAD"],
10-
cwd=dir, shell=False, stderr=subprocess.DEVNULL, encoding='utf8').strip()[0:8]
11-
12-
try:
13-
file_path = pathlib.Path(__file__)
14-
path = file_path.parts
15-
while len(path) > 0 and path[-1] != REPOSITORY_NAME:
16-
path = path[:-1]
17-
if len(path) >= 2 and path[-1] == REPOSITORY_NAME and path[-2] == "extensions":
18-
return call_git(str(pathlib.Path(*path)))
19-
20-
return call_git(pathlib.Path.cwd().joinpath('extensions/stable-diffusion-webui-depthmap-script/'))
11+
cwd=file_path, shell=False, stderr=subprocess.DEVNULL, encoding='utf8').strip()[0:8]
2112
except Exception:
2213
return "<none>"
2314

0 commit comments

Comments
 (0)