diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..b3a09eb --- /dev/null +++ b/Dockerfile @@ -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" ] diff --git a/README.md b/README.md index 23aa696..dd3d4c0 100644 --- a/README.md +++ b/README.md @@ -204,6 +204,10 @@ pip install -r requirements_post.txt **Plus:**
- 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`