Skip to content

Add Dockerfile #107

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Mar 16, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
49 changes: 49 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
ARG CUDA_VERSION=12.1.0-devel

FROM docker.io/nvidia/cuda:${CUDA_VERSION}-ubuntu22.04

RUN apt-get update && \
apt-get install --no-install-recommends -y \
build-essential \
curl \
ffmpeg \
git \
libgl1 libglib2.0-0 \
libgl1-mesa-glx libglib2.0-0 libsm6 libxrender1 libxext6 \
libegl1-mesa-dev \
ninja-build \
python3.11 \
python3.11-dev \
wget \
&& \
curl -sS https://bootstrap.pypa.io/get-pip.py | python3.11 && \
rm -rf /var/lib/apt/lists/*

RUN ln -s /usr/bin/python3.11 /usr/bin/python & \
ln -s /usr/bin/pip3.11 /usr/bin/pip

RUN adduser --uid 1001 -q user && \
mkdir /app && chown user /app
USER user

RUN pip install --no-cache --index-url https://download.pytorch.org/whl/cu121 \
torch==2.2.0 torchvision==0.17.0 xformers==0.0.24

WORKDIR /app
RUN git clone "https://github.com/comfyanonymous/ComfyUI.git" ./ && \
git reset --hard 05cd00695a84cebd5603a31f665eb7301fba2beb
RUN pip install --no-cache -r requirements.txt

WORKDIR /app/custom_nodes/ComfyUI-3D-Pack/
COPY --chown=user:user ./ ./

RUN pip install --no-cache -r requirements.txt \
# post requirements installation require gpu, setup
# `nvidia-container-runtime`, for docker, see
# https://stackoverflow.com/a/61737404
-r requirements_post.txt \
# those seem to be missed
ninja scikit-learn rembg[gpu] open_clip_torch

WORKDIR /app
ENTRYPOINT [ "python", "main.py", "--listen", "0.0.0.0" ]
4 changes: 4 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -204,6 +204,10 @@ pip install -r requirements_post.txt
**Plus:**<br>
- 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)

#### Install with docker:

`docker build -t test . && docker run --rm -it -p8188:8188 test`

## Run:
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!
- 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`
Expand Down