Skip to content

Commit 1462e01

Browse files
committed
build: fold transformers/hf-hub pin into the mirror RUN
Per review (PR #227): downgrade transformers<5 / huggingface-hub<1 in the same RUN as the requirements install so the unwanted 5.x/1.x versions don't linger in a lower layer.
1 parent a2c204a commit 1462e01

1 file changed

Lines changed: 9 additions & 8 deletions

File tree

Dockerfile

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -69,17 +69,18 @@ RUN if [ "$ENABLE_PYTORCH_UPGRADE" = "true" ]; then \
6969
# misleading "ComfyUI server (127.0.0.1:8188) not reachable" error. Mirror
7070
# ComfyUI's full dependency set (core + custom nodes) into /opt/venv so the
7171
# launch venv is complete. Root-cause fix for DR-1170.
72+
#
73+
# The transformers/huggingface-hub pin is part of the SAME step on purpose:
74+
# ComfyUI declares transformers>=4.50.3 and huggingface-hub with NO upper bound,
75+
# so a fresh install can pull transformers 5.x / huggingface-hub 1.x whose
76+
# breaking API changes also crash ComfyUI at startup. Pinning them in the same
77+
# RUN downgrades within one layer, so the unwanted versions aren't left behind
78+
# bloating the image.
7279
RUN uv pip install -r /comfyui/requirements.txt \
7380
&& for r in /comfyui/custom_nodes/*/requirements.txt; do \
7481
[ -f "$r" ] && uv pip install -r "$r" || true; \
75-
done
76-
77-
# Pin ComfyUI's unbounded ML dependencies to their last known-good majors.
78-
# ComfyUI declares transformers>=4.50.3 and huggingface-hub with NO upper bound,
79-
# so a fresh install can pull transformers 5.x / huggingface-hub 1.x whose
80-
# breaking API changes also crash ComfyUI at startup. Keep them on the last
81-
# known-good major.
82-
RUN uv pip install "transformers>=4.50.3,<5" "huggingface-hub<1.0"
82+
done \
83+
&& uv pip install "transformers>=4.50.3,<5" "huggingface-hub<1.0"
8384

8485
# Build-time smoke test: actually start ComfyUI (imports the full node graph) so
8586
# a startup-breaking dependency is caught HERE, at build time, instead of as a

0 commit comments

Comments
 (0)