Skip to content

Commit 91ee7a2

Browse files
kalemasKonstantin Maslyuk
authored andcommitted
Add Dockerfile
1 parent abb4532 commit 91ee7a2

File tree

2 files changed

+70
-0
lines changed

2 files changed

+70
-0
lines changed

Dockerfile

Lines changed: 66 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,66 @@
1+
ARG CUDA_VERSION=12.1.0-devel
2+
3+
FROM docker.io/nvidia/cuda:${CUDA_VERSION}-ubuntu22.04
4+
5+
RUN apt-get update && \
6+
apt-get install --no-install-recommends -y \
7+
build-essential \
8+
curl \
9+
ffmpeg \
10+
git \
11+
libgl1 libglib2.0-0 \
12+
libgl1-mesa-glx libglib2.0-0 libsm6 libxrender1 libxext6 \
13+
libegl1-mesa-dev \
14+
ninja-build \
15+
python3.11 \
16+
python3.11-dev \
17+
wget \
18+
&& \
19+
curl -sS https://bootstrap.pypa.io/get-pip.py | python3.11 && \
20+
rm -rf /var/lib/apt/lists/*
21+
22+
RUN ln -s /usr/bin/python3.11 /usr/bin/python & \
23+
ln -s /usr/bin/pip3.11 /usr/bin/pip
24+
25+
RUN adduser --uid 1001 -q user && \
26+
mkdir /app && chown user /app
27+
USER user
28+
29+
RUN pip install --no-cache --index-url https://download.pytorch.org/whl/cu121 \
30+
torch==2.2.0 torchvision==0.17.0 xformers==0.0.24
31+
32+
WORKDIR /app
33+
RUN git clone "https://github.com/comfyanonymous/ComfyUI.git" ./ && \
34+
git reset --hard 05cd00695a84cebd5603a31f665eb7301fba2beb
35+
RUN pip install --no-cache -r requirements.txt
36+
37+
WORKDIR /app/custom_nodes/ComfyUI-3D-Pack/
38+
COPY --chown=user:user requirements.txt requirements_post.txt ./
39+
COPY --chown=user:user simple-knn/ simple-knn/
40+
COPY --chown=user:user tgs/ tgs/
41+
RUN pip install --no-cache -r requirements.txt \
42+
# post requirements installation require gpu, setup
43+
# `nvidia-container-runtime`, for docker, see
44+
# https://stackoverflow.com/a/61737404
45+
-r requirements_post.txt \
46+
# those seem to be missed
47+
ninja scikit-learn rembg[gpu] open_clip_torch
48+
49+
WORKDIR /app/custom_nodes/
50+
RUN git clone "https://github.com/ltdrdata/ComfyUI-Impact-Pack" && \
51+
cd ComfyUI-Impact-Pack && \
52+
git reset --hard e1570e76799049fb0038f6232fd89800ab4565eb && \
53+
pip install --no-cache -r requirements.txt
54+
RUN git clone "https://github.com/kijai/ComfyUI-KJNodes" && \
55+
cd ComfyUI-KJNodes && \
56+
git reset --hard 95ae8b067a8aa5825471189954579ffa02aa9256 && \
57+
pip install --no-cache -r requirements.txt
58+
RUN git clone "https://github.com/Kosinkadink/ComfyUI-VideoHelperSuite" && \
59+
cd ComfyUI-VideoHelperSuite && \
60+
git reset --hard f94597739f20dac331f9918a245149b6b00a60f2 && \
61+
pip install --no-cache -r requirements.txt
62+
63+
COPY --chown=user:user ./ ComfyUI-3D-Pack/
64+
65+
WORKDIR /app
66+
ENTRYPOINT [ "python", "main.py", "--listen", "0.0.0.0" ]

README.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -204,6 +204,10 @@ pip install -r requirements_post.txt
204204
**Plus:**<br>
205205
- For those who want to run it inside Google Colab, you can check the [install instruction from @lovisdotio](https://github.com/MrForExample/ComfyUI-3D-Pack/issues/13)
206206

207+
#### Install with docker:
208+
209+
`docker build -t comfy3d . && docker run --rm -it -p 8188:8188 --gpus all comfy3d`
210+
207211
## Run:
208212
Copy the files inside folder [__New_ComfyUI_Bats](./_New_ComfyUI_Bats/) to your ComfyUI root directory, and double click run_nvidia_gpu_miniconda.bat to start ComfyUI!
209213
- Alternatively you can just activate the Conda env: `python_miniconda_env\ComfyUI`, and go to your ComfyUI root directory then run command `python ./ComfyUI/main.py`

0 commit comments

Comments
 (0)