Skip to content

Commit 3a9201b

Browse files
psychedelicioushipsterusername
authored andcommitted
feat: pin deps
Organise deps into ~3 categories: - Core generation dependencies, pinned for reproducible builds. - Core application dependencies, pinned for reproducible builds. - Auxiliary dependencies, pinned only if necessary. I pinned / bumped these to latest: - `controlnet_aux` - `fastapi` - `fastapi-events` - `huggingface-hub` - `numpy` - `python-socketio` - `torchmetrics` - `transformers` - `uvicorn` I checked the release notes for these and didn't see any breaking changes that would affect us. There is a `fastapi` breaking change in v108 related to background tasks but it doesn't affect us. I tested on a fresh venv. The app still works and I can generate on macOS. Hopefully, enforcing explicit pinned versions will reduce the issues where people get CPU torch. It also means we should periodically bump versions up to ensure we don't get too far behind on our dependencies and have to do painful upgrades.
1 parent d6e2cb7 commit 3a9201b

File tree

2 files changed

+45
-39
lines changed

2 files changed

+45
-39
lines changed

installer/lib/installer.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -241,12 +241,12 @@ def install_torch(self, extra_index_url=None, find_links=None):
241241
pip[
242242
"install",
243243
"--require-virtualenv",
244-
"numpy~=1.24.0", # choose versions that won't be uninstalled during phase 2
244+
"numpy==1.26.3", # choose versions that won't be uninstalled during phase 2
245245
"urllib3~=1.26.0",
246246
"requests~=2.28.0",
247247
"torch==2.1.2",
248248
"torchmetrics==0.11.4",
249-
"torchvision>=0.16.2",
249+
"torchvision==0.16.2",
250250
"--force-reinstall",
251251
"--find-links" if find_links is not None else None,
252252
find_links,

pyproject.toml

Lines changed: 43 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -32,37 +32,50 @@ classifiers = [
3232
'Topic :: Scientific/Engineering :: Image Processing',
3333
]
3434
dependencies = [
35-
"accelerate~=0.25.0",
35+
# Core generation dependencies, pinned for reproducible builds.
36+
"accelerate==0.25.0",
37+
"basicsr==1.4.2",
38+
"clip_anytorch==2.5.2", # replacing "clip @ https://github.com/openai/CLIP/archive/eaa22acb90a5876642d0507623e859909230a52d.zip",
39+
"compel==2.0.2",
40+
"controlnet-aux==0.0.7",
41+
"diffusers[torch]==0.25.0",
42+
"invisible-watermark==0.2.0", # needed to install SDXL base and refiner using their repo_ids
43+
"mediapipe==0.10.7", # needed for "mediapipeface" controlnet model
44+
"numpy==1.26.3", # >1.24.0 is needed to use the 'strict' argument to np.testing.assert_array_equal()
45+
"onnx==1.15.0",
46+
"onnxruntime==1.16.3",
47+
"opencv-python==4.9.0.80",
48+
"pytorch-lightning==2.1.3",
49+
"safetensors==0.4.1",
50+
"timm==0.6.13", # needed to override timm latest in controlnet_aux, see https://github.com/isl-org/ZoeDepth/issues/26
51+
"torch==2.1.2",
52+
"torchmetrics==0.11.4",
53+
"torchsde==0.2.6",
54+
"torchvision==0.16.2",
55+
"transformers==4.36.2",
56+
57+
# Core application dependencies, pinned for reproducible builds.
58+
"fastapi-events==0.10.0",
59+
"fastapi==0.108.0",
60+
"huggingface-hub==0.20.2",
61+
"pydantic-settings==2.1.0",
62+
"pydantic==2.5.3",
63+
"python-socketio==5.11.0",
64+
"uvicorn[standard]==0.25.0",
65+
66+
# Auxiliary dependencies, pinned only if necessary.
3667
"albumentations",
37-
"basicsr",
3868
"click",
39-
"clip_anytorch", # replacing "clip @ https://github.com/openai/CLIP/archive/eaa22acb90a5876642d0507623e859909230a52d.zip",
40-
"compel~=2.0.2",
41-
"controlnet-aux>=0.0.6",
42-
"timm==0.6.13", # needed to override timm latest in controlnet_aux, see https://github.com/isl-org/ZoeDepth/issues/26
4369
"datasets",
44-
"diffusers[torch]~=0.25.0",
4570
"dnspython~=2.4.0",
4671
"dynamicprompts",
4772
"easing-functions",
4873
"einops",
4974
"facexlib",
50-
"fastapi~=0.105.0",
51-
"fastapi-events~=0.9.1",
52-
"huggingface-hub~=0.19.4",
5375
"imohash",
54-
"invisible-watermark~=0.2.0", # needed to install SDXL base and refiner using their repo_ids
55-
"matplotlib", # needed for plotting of Penner easing functions
56-
"mediapipe", # needed for "mediapipeface" controlnet model
57-
# Minimum numpy version of 1.24.0 is needed to use the 'strict' argument to np.testing.assert_array_equal().
58-
"numpy>=1.24.0",
76+
"matplotlib", # needed for plotting of Penner easing functions
5977
"npyscreen",
6078
"omegaconf",
61-
"onnx",
62-
"onnxruntime",
63-
"opencv-python~=4.8.1.1",
64-
"pydantic~=2.5.2",
65-
"pydantic-settings~=2.0.3",
6679
"picklescan",
6780
"pillow",
6881
"prompt-toolkit",
@@ -71,25 +84,25 @@ dependencies = [
7184
'pyperclip',
7285
"pyreadline3",
7386
"python-multipart",
74-
"python-socketio~=5.10.0",
75-
"pytorch-lightning",
7687
"requests~=2.28.2",
7788
"rich~=13.3",
78-
"safetensors~=0.4.0",
7989
"scikit-image~=0.21.0",
8090
"semver~=3.0.1",
8191
"send2trash",
8292
"test-tube~=0.7.5",
83-
"torch==2.1.2",
84-
"torchvision==0.16.2",
85-
"torchmetrics~=0.11.0",
86-
"torchsde~=0.2.5",
87-
"transformers~=4.36.0",
88-
"uvicorn[standard]~=0.21.1",
8993
"windows-curses; sys_platform=='win32'",
9094
]
9195

9296
[project.optional-dependencies]
97+
"xformers" = [
98+
# Core generation dependencies, pinned for reproducible builds.
99+
"xformers==0.0.23.post1; sys_platform!='darwin'",
100+
# Auxiliary dependencies, pinned only if necessary.
101+
"triton; sys_platform=='linux'",
102+
]
103+
"onnx" = ["onnxruntime"]
104+
"onnx-cuda" = ["onnxruntime-gpu"]
105+
"onnx-directml" = ["onnxruntime-directml"]
93106
"dist" = ["pip-tools", "pipdeptree", "twine"]
94107
"docs" = [
95108
"mkdocs-material<9.0",
@@ -98,7 +111,7 @@ dependencies = [
98111
]
99112
"dev" = ["jurigged", "pudb"]
100113
"test" = [
101-
"ruff==0.1.7",
114+
"ruff==0.1.11",
102115
"ruff-lsp",
103116
"mypy",
104117
"pre-commit",
@@ -107,13 +120,6 @@ dependencies = [
107120
"pytest-datadir",
108121
"requests_testadapter",
109122
]
110-
"xformers" = [
111-
"xformers==0.0.23.post1; sys_platform!='darwin'",
112-
"triton; sys_platform=='linux'",
113-
]
114-
"onnx" = ["onnxruntime"]
115-
"onnx-cuda" = ["onnxruntime-gpu"]
116-
"onnx-directml" = ["onnxruntime-directml"]
117123

118124
[project.scripts]
119125

0 commit comments

Comments
 (0)