mirror of
https://github.com/comfyanonymous/ComfyUI.git
synced 2025-07-09 00:37:11 +08:00
Changed the base image to cuda:12.6.3-cudnn-runtime-ubuntu24.04 and made sure everything works
This commit is contained in:
parent
13a79662f4
commit
81d232e4b1
46
Dockerfile
46
Dockerfile
@ -1,4 +1,4 @@
|
|||||||
FROM nvidia/cuda:12.1.0-base-ubuntu20.04 AS base
|
FROM nvidia/cuda:12.6.3-cudnn-runtime-ubuntu24.04 AS base
|
||||||
ENV DEBIAN_FRONTEND=noninteractive
|
ENV DEBIAN_FRONTEND=noninteractive
|
||||||
|
|
||||||
# Install necessary dependencies and Python 3.12
|
# Install necessary dependencies and Python 3.12
|
||||||
@ -7,9 +7,6 @@ RUN apt-get update \
|
|||||||
git \
|
git \
|
||||||
software-properties-common \
|
software-properties-common \
|
||||||
curl \
|
curl \
|
||||||
&& add-apt-repository ppa:deadsnakes/ppa \
|
|
||||||
&& apt-get update \
|
|
||||||
&& apt-get install -y \
|
|
||||||
python3.12 \
|
python3.12 \
|
||||||
python3.12-dev \
|
python3.12-dev \
|
||||||
python3.12-venv \
|
python3.12-venv \
|
||||||
@ -22,40 +19,27 @@ RUN apt-get update \
|
|||||||
&& apt-get clean \
|
&& apt-get clean \
|
||||||
&& rm -rf /var/lib/apt/lists/*
|
&& rm -rf /var/lib/apt/lists/*
|
||||||
|
|
||||||
# Install pip for Python 3.12 explicitly
|
|
||||||
RUN curl https://bootstrap.pypa.io/get-pip.py -o get-pip.py \
|
|
||||||
&& python3.12 get-pip.py \
|
|
||||||
&& rm get-pip.py
|
|
||||||
|
|
||||||
# Set Python 3.12 as the default python3 and pip
|
|
||||||
RUN update-alternatives --install /usr/bin/python3 python3 /usr/bin/python3.12 1 \
|
|
||||||
&& update-alternatives --install /usr/bin/pip pip /usr/local/bin/pip3 1
|
|
||||||
|
|
||||||
# Set the working directory
|
# Set the working directory
|
||||||
WORKDIR /app
|
WORKDIR /app
|
||||||
|
|
||||||
# Clone the ComfyUI repository into the working directory
|
# Clone the ComfyUI repository and set up virtual environment
|
||||||
RUN git clone https://github.com/comfyanonymous/ComfyUI.git /app/comfyui
|
RUN git clone https://github.com/comfyanonymous/ComfyUI.git /app/comfyui \
|
||||||
|
&& python3.12 -m venv /app/venv \
|
||||||
|
&& /app/venv/bin/pip install --upgrade pip \
|
||||||
|
&& /app/venv/bin/pip install pyyaml \
|
||||||
|
&& /app/venv/bin/pip install -r /app/comfyui/requirements.txt
|
||||||
|
|
||||||
# Install backend dependencies
|
# Install PyTorch with CUDA 12.6 support (stable version)
|
||||||
RUN python3 -m venv /app/venv
|
RUN /app/venv/bin/pip install torch torchvision torchaudio --extra-index-url https://download.pytorch.org/whl/cu126
|
||||||
RUN . venv/bin/activate && pip install --upgrade pip
|
|
||||||
RUN . venv/bin/activate && pip install pyyaml
|
|
||||||
RUN . venv/bin/activate && pip install -r /app/comfyui/requirements.txt
|
|
||||||
|
|
||||||
# Install PyTorch with CUDA 12.1 support
|
# Clone ComfyUI-Manager and install its dependencies
|
||||||
RUN . venv/bin/activate && pip install torch torchvision torchaudio --extra-index-url https://download.pytorch.org/whl/cu121
|
RUN git clone https://github.com/ltdrdata/ComfyUI-Manager.git /app/temp/ComfyUI-Manager \
|
||||||
|
&& mv /app/temp/* /app/comfyui/custom_nodes/ \
|
||||||
# Clone the ComfyUI-manager repository into a temporary directory, move it, and clean up
|
&& rm -rf /app/temp \
|
||||||
RUN git clone https://github.com/ltdrdata/ComfyUI-Manager.git /app/temp/ComfyUI-Manager && \
|
&& /app/venv/bin/pip install -r /app/comfyui/custom_nodes/ComfyUI-Manager/requirements.txt
|
||||||
mv /app/temp/* /app/comfyui/custom_nodes/ && \
|
|
||||||
rm -rf /app/temp
|
|
||||||
|
|
||||||
# Install ComfyUI-manager dependencies
|
|
||||||
RUN . venv/bin/activate && pip install -r /app/comfyui/custom_nodes/ComfyUI-Manager/requirements.txt
|
|
||||||
|
|
||||||
# Expose the backend port
|
# Expose the backend port
|
||||||
EXPOSE 8188
|
EXPOSE 8188
|
||||||
|
|
||||||
# Set the entrypoint command to activate the virtual environment and run the script
|
# Set the entrypoint to run the app
|
||||||
CMD ["/bin/bash", "-c", "source /app/venv/bin/activate && python3 /app/comfyui/main.py --listen 0.0.0.0 --port 8188"]
|
CMD ["/bin/bash", "-c", "source /app/venv/bin/activate && python3 /app/comfyui/main.py --listen 0.0.0.0 --port 8188"]
|
||||||
|
Loading…
x
Reference in New Issue
Block a user