Skip to content

Commit 9eb4c24

Browse files
CI/CD Now Builds Multiple Images for CUDA Versions
In order to allow users to choose a specific CUDA version when pulling the image, the Dockerfile was modified to also allow the specification of the PyTorch, CUDA, and cuDNN versions as build arguments. The GitHub Actions workflow was updated to build images for all available combinations of CUDA and cuDNN for the version of PyTorch used in the Dockerfile. The read me was updated to reflect this change. Also, the Docker Compose file was updated to allow users to specify the image tag using an environment variable.
1 parent ddffb17 commit 9eb4c24

File tree

6 files changed

+238
-65
lines changed

6 files changed

+238
-65
lines changed

.cspell.json

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -84,8 +84,10 @@
8484
"photomaker",
8585
"PYTHONPATH",
8686
"pytorch",
87+
"startswith",
8788
"Subpack",
8889
"unet",
90+
"urlopen",
8991
"vsicons"
9092
]
9193
}

.github/workflows/build-and-publish.yml

Lines changed: 200 additions & 55 deletions
Large diffs are not rendered by default.

CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,9 @@
11
# Changelog
22

3+
## v0.6.1 (January 9, 2026)
4+
5+
- In order to allow users to choose a specific CUDA version when pulling the image, the Dockerfile was modified to also allow the specification of the PyTorch, CUDA, and cuDNN versions as build arguments. The GitHub Actions workflow was updated to build images for all available combinations of CUDA and cuDNN for the version of PyTorch used in the Dockerfile. The read me was updated to reflect this change.
6+
37
## v0.6.0 (January 9, 2026)
48

59
- Updated the base image of the Dockerfile to the latest version of PyTorch (from PyTorch 2.8.0, CUDA 12.9, and cuDNN 9 to PyTorch 2.9.1, CUDA 12.8, and cuDNN 9).

README.md

Lines changed: 24 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ To enable the usage of NVIDIA GPUs, the NVIDIA Container Toolkit must be install
1212

1313
### Installing & Running Using Docker Run
1414

15-
The ComfyUI Docker image is available from the [GitHub Container Registry](ghcr.io/lecode-official/comfyui-docker). Installing ComfyUI is as simple as pulling the image and starting a container, which can be achieved using the following command:
15+
The ComfyUI Docker image is available from the [GitHub Container Registry](https://ghcr.io/lecode-official/comfyui-docker). Installing ComfyUI is as simple as pulling the image and starting a container, which can be achieved using the following command:
1616

1717
```shell
1818
docker run \
@@ -30,7 +30,7 @@ docker run \
3030
ghcr.io/lecode-official/comfyui-docker:latest
3131
```
3232

33-
Please note, that the `<path/to/models/folder>`, `<path/to/custom/nodes/folder>` and `<path/to/output/folder>` must be replaced with paths to directories on the host system where the models, custom nodes and generated outputs (images, workflows, etc.) will be stored, e.g., `$HOME/.comfyui/models`, `$HOME/.comfyui/custom-nodes` and `$HOME/.comfyui/output`, which can be created like so: `mkdir -p $HOME/.comfyui/{models,custom-nodes,output}`.
33+
For a full list of the available image tags, please refer to the [image tags](#available-image-tags) section. Please note, that the `<path/to/models/folder>`, `<path/to/custom/nodes/folder>` and `<path/to/output/folder>` must be replaced with paths to directories on the host system where the models, custom nodes and generated outputs (images, workflows, etc.) will be stored, e.g., `$HOME/.comfyui/models`, `$HOME/.comfyui/custom-nodes` and `$HOME/.comfyui/output`, which can be created like so: `mkdir -p $HOME/.comfyui/{models,custom-nodes,output}`.
3434

3535
> [!WARNING]
3636
> If you are coming from a version prior to v0.6.0, please note that the output directory mapping was added in version v0.6.0. If the Docker container for the previous version is still available, you can migrate your existing outputs by copying them from the old container to the host system. Assuming your previous container was named `comfyui`, you can use the following command:
@@ -101,10 +101,16 @@ CUSTOM_NODES_PATH=<path/to/custom/nodes/folder>
101101
OUTPUT_PATH=<path/to/output/folder>
102102
```
103103
104-
Normally, the user inside a Docker container is `root`, which means that the files that are written from the container to the host system are also owned by `root`. To avoid this, ComfyUI Docker creates a new user inside the container. By default, running the Docker Compose file will create a user and group with the IDs `1000` and `1000`, respectively. Most Linux systems have the first user created with these IDs. If your user has different IDs, you can change them using the `USER_ID` and `GROUP_ID` environment variables. To permanently set these environment variables, you can create a `.env` file alongside the `compose.yml` file to specify the correct IDs. You can find out your user and group IDs by running `id -u` and `id -g` in your terminal. To create the `.env` file, you can run:
104+
The Dockerfile uses the ComfyUI Docker image with the `latest` tag. A different tag can be specified using the `IMAGE_TAG` environment variable. Again, the image tag can be set permanently in a `.env` file. For a full list of the available image tags, please refer to the [image tags](#available-image-tags) section. Assuming you have already created a `.env` file, you can run the following command to use the `0.6.1` tag by appending the `IMAGE_TAG` variable to the existing `.env` file:
105105
106106
```shell
107-
echo "USER_ID=$(id -u)" > .env
107+
echo "IMAGE_TAG=0.6.1" >> .env
108+
```
109+
110+
Normally, the user inside a Docker container is `root`, which means that the files that are written from the container to the host system are also owned by `root`. To avoid this, ComfyUI Docker creates a new user inside the container. By default, running the Docker Compose file will create a user and group with the IDs `1000` and `1000`, respectively. Most Linux systems have the first user created with these IDs. If your user has different IDs, you can change them using the `USER_ID` and `GROUP_ID` environment variables. To permanently set these environment variables, you may again use a `.env` file alongside the `compose.yml` file to specify the correct IDs. You can find out your user and group IDs by running `id -u` and `id -g` in your terminal. Assuming you have already created a `.env` file, you can run the following commands to append the user and group IDs to the existing `.env` file:
111+
112+
```shell
113+
echo "USER_ID=$(id -u)" >> .env
108114
echo "GROUP_ID=$(id -g)" >> .env
109115
```
110116
@@ -142,6 +148,20 @@ To apply the changes, you have to recreate the container:
142148
docker compose up --detach --force-recreate
143149
```
144150
151+
## Available Image Tags
152+
153+
The ComfyUI Docker image is available with different tags. The available tags are:
154+
155+
- `latest`: The latest stable version of ComfyUI Docker. This will use the latest versions of ComfyUI, ComfyUI Manager, and PyTorch available at the time of the image build. It will not always use the most recent version of CUDA and cuDNN, but may instead use a slightly older, but more broadly compatible version.
156+
- `0.6`, `0.6.1`: These tags will always use the specific version of ComfyUI Docker, and the latest versions of ComfyUI, ComfyUI Manager and PyTorch available at the time of the image build. It will not always use the most recent version of CUDA and cuDNN, but may instead use a slightly older, but more broadly compatible version.
157+
- `0.6-comfyui-0.8.2`, `0.6.1-comfyui-0.8.2`: These tags will always use the specific versions of ComfyUI Docker and ComfyUI, and the latest versions of ComfyUI Manager and PyTorch available at the time of the image build. It will not always use the most recent version of CUDA and cuDNN, but may instead use a slightly older, but more broadly compatible version.
158+
- `0.6-comfyui-0.8.2-comfyui-manager-4.0.5`, `0.6.0-comfyui-0.8.2-comfyui-manager-4.0.5`: These tags will always use the specific versions of ComfyUI Docker, ComfyUI, and ComfyUI Manager, and the latest version of PyTorch available at the time of the image build. It will not always use the most recent version of CUDA and cuDNN, but may instead use a slightly older, but more broadly compatible version.
159+
- `0.6-comfyui-0.8.2-comfyui-manager-4.0.5-pytorch-2.9.1-cuda-12.8-cudnn-9`, `0.6.1-comfyui-0.8.2-comfyui-manager-4.0.5-pytorch-2.9.1-cuda-12.8-cudnn-9`: These tags will always use the specific versions of ComfyUI Docker, ComfyUI, ComfyUI Manager, PyTorch, CUDA, and cuDNN.
160+
- `sha-<short-commit-sha>`: These tags point to ComfyUI Docker that were build from the specific commit. They will always use the versions of ComfyUI Docker, ComfyUI, ComfyUI Manager, and PyTorch that were the most recent at the time of the image build. It will not always use the most recent version of CUDA and cuDNN available at the time of the build, but may instead use a slightly older, but more broadly compatible version.
161+
162+
> [!WARNING]
163+
> For releases prior to v0.6.1, only a single PyTorch, CUDA and cuDNN version combination was available and the image tags did not include the PyTorch, CUDA and cuDNN versions. Starting from v0.6.1, multiple combinations of PyTorch, CUDA and cuDNN versions are built and made available. Please refer to the [Changelog](CHANGELOG.md) for more information.
164+
145165
## Updating
146166
147167
### Updating Using Docker Run

compose.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ name: comfyui-docker
44

55
services:
66
comfyui:
7-
image: ghcr.io/lecode-official/comfyui-docker:latest
7+
image: ghcr.io/lecode-official/comfyui-docker:${IMAGE_TAG:-latest}
88
container_name: comfyui
99
restart: unless-stopped
1010
environment:

source/Dockerfile

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,13 @@
11

2-
# Defines the versions of ComfyUI, ComfyUI Manager, and PyTorch to use
3-
ARG COMFYUI_VERSION=v0.8.2
2+
# Defines the versions of ComfyUI, ComfyUI Manager, PyTorch, CUDA, and cuDNN to use
3+
ARG COMFYUI_VERSION=0.8.2
44
ARG COMFYUI_MANAGER_VERSION=4.0.5
5-
ARG PYTORCH_VERSION=2.9.1-cuda12.8-cudnn9-runtime
5+
ARG PYTORCH_VERSION=2.9.1
6+
ARG CUDA_VERSION=12.8
7+
ARG CUDNN_VERSION=9
68

79
# This image is based on the latest official PyTorch image, because it already contains CUDA, CuDNN, and PyTorch
8-
FROM pytorch/pytorch:${PYTORCH_VERSION}
10+
FROM pytorch/pytorch:${PYTORCH_VERSION}-cuda${CUDA_VERSION}-cudnn${CUDNN_VERSION}-runtime
911

1012
# Installs Git, because ComfyUI and the ComfyUI Manager are installed by cloning their respective Git repositories
1113
RUN apt update --assume-yes && \
@@ -19,7 +21,7 @@ RUN apt update --assume-yes && \
1921
# Clones the ComfyUI repository and checks out the latest release
2022
RUN git clone https://github.com/Comfy-Org/ComfyUI.git /opt/comfyui && \
2123
cd /opt/comfyui && \
22-
git checkout ${COMFYUI_VERSION}
24+
git checkout v${COMFYUI_VERSION}
2325

2426
# Clones the ComfyUI Manager repository and checks out the latest release; ComfyUI Manager is an extension for ComfyUI that enables users to install
2527
# custom nodes and download models directly from the ComfyUI interface; instead of installing it to "/opt/comfyui/custom_nodes/ComfyUI-Manager", which

0 commit comments

Comments
 (0)