From 75e08c7cf4c0abcacb4d2ad59b08525c320da442 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Mon, 16 Feb 2026 13:09:01 +0000 Subject: [PATCH 1/4] Initial plan From a005e04a6705a852ec7f6205a10f9589ce0e3545 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Mon, 16 Feb 2026 13:11:01 +0000 Subject: [PATCH 2/4] Add Dockerfile and weekly Docker release workflow Co-authored-by: bjoernbethge <8515720+bjoernbethge@users.noreply.github.com> --- .dockerignore | 47 +++++++++++++ .github/workflows/docker-weekly-release.yml | 78 +++++++++++++++++++++ Dockerfile | 39 +++++++++++ 3 files changed, 164 insertions(+) create mode 100644 .dockerignore create mode 100644 .github/workflows/docker-weekly-release.yml create mode 100644 Dockerfile diff --git a/.dockerignore b/.dockerignore new file mode 100644 index 000000000000..46418d95e91e --- /dev/null +++ b/.dockerignore @@ -0,0 +1,47 @@ +# Git +.git +.gitignore +.gitattributes + +# Python +__pycache__ +*.py[cod] +*$py.class +*.so +.Python +venv/ +env/ +ENV/ + +# IDE +.vscode +.idea +*.swp +*.swo +*~ + +# Testing +.pytest_cache +.coverage +htmlcov/ + +# Documentation +*.md +!README.md +docs/ + +# CI/CD +.github/ +.ci/ + +# Models and data (large files that should be downloaded separately) +models/* +input/* +output/* +temp/* + +# Custom nodes (users can add their own) +custom_nodes/* + +# Logs +*.log diff --git a/.github/workflows/docker-weekly-release.yml b/.github/workflows/docker-weekly-release.yml new file mode 100644 index 000000000000..74f514e13386 --- /dev/null +++ b/.github/workflows/docker-weekly-release.yml @@ -0,0 +1,78 @@ +name: Weekly Docker Image Release + +on: + # Run every Monday at 00:00 UTC + schedule: + - cron: '0 0 * * 1' + # Allow manual trigger + workflow_dispatch: + +env: + REGISTRY: ghcr.io + IMAGE_NAME: ${{ github.repository }} + +jobs: + build-and-push: + runs-on: ubuntu-latest + permissions: + contents: read + packages: write + + steps: + - name: Checkout repository + uses: actions/checkout@v4 + + - name: Set up Docker Buildx + uses: docker/setup-buildx-action@v3 + + - name: Log in to the Container registry + uses: docker/login-action@v3 + with: + registry: ${{ env.REGISTRY }} + username: ${{ github.actor }} + password: ${{ secrets.GITHUB_TOKEN }} + + - name: Extract version from pyproject.toml + id: version + run: | + # Read version from pyproject.toml + VERSION=$(grep -oP 'version = "\K[^"]+' pyproject.toml) + echo "version=$VERSION" >> $GITHUB_OUTPUT + echo "ComfyUI Version: $VERSION" + + - name: Extract metadata (tags, labels) for Docker + id: meta + uses: docker/metadata-action@v5 + with: + images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }} + tags: | + type=raw,value=latest + type=raw,value=${{ steps.version.outputs.version }} + type=sha,prefix=${{ steps.version.outputs.version }}- + + - name: Build and push Docker image + uses: docker/build-push-action@v5 + with: + context: . + push: true + tags: ${{ steps.meta.outputs.tags }} + labels: ${{ steps.meta.outputs.labels }} + cache-from: type=gha + cache-to: type=gha,mode=max + platforms: linux/amd64 + + - name: Image summary + run: | + echo "## Docker Image Published :rocket:" >> $GITHUB_STEP_SUMMARY + echo "" >> $GITHUB_STEP_SUMMARY + echo "**Version:** ${{ steps.version.outputs.version }}" >> $GITHUB_STEP_SUMMARY + echo "" >> $GITHUB_STEP_SUMMARY + echo "**Images:**" >> $GITHUB_STEP_SUMMARY + echo '```' >> $GITHUB_STEP_SUMMARY + echo "${{ steps.meta.outputs.tags }}" >> $GITHUB_STEP_SUMMARY + echo '```' >> $GITHUB_STEP_SUMMARY + echo "" >> $GITHUB_STEP_SUMMARY + echo "**Pull command:**" >> $GITHUB_STEP_SUMMARY + echo '```bash' >> $GITHUB_STEP_SUMMARY + echo "docker pull ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:latest" >> $GITHUB_STEP_SUMMARY + echo '```' >> $GITHUB_STEP_SUMMARY diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 000000000000..67a2f76b5475 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,39 @@ +# ComfyUI Docker Image +FROM python:3.11-slim + +# Set working directory +WORKDIR /app + +# Install system dependencies +RUN apt-get update && apt-get install -y \ + git \ + libgl1-mesa-glx \ + libglib2.0-0 \ + && rm -rf /var/lib/apt/lists/* + +# Copy requirements first for better caching +COPY requirements.txt . + +# Install Python dependencies +RUN pip install --no-cache-dir --upgrade pip && \ + pip install --no-cache-dir -r requirements.txt + +# Copy the application +COPY . . + +# Create necessary directories +RUN mkdir -p models/checkpoints models/vae models/loras models/controlnet \ + models/clip models/unet models/upscale_models models/embeddings \ + models/clip_vision models/style_models models/vae_approx \ + input output temp custom_nodes + +# Expose the default port +EXPOSE 8188 + +# Set environment variables +ENV PYTHONUNBUFFERED=1 +ENV HF_HUB_DISABLE_TELEMETRY=1 +ENV DO_NOT_TRACK=1 + +# Run ComfyUI +CMD ["python", "main.py", "--listen", "0.0.0.0", "--port", "8188"] From 3447ff6050ca853829f34bd06d6a0a252a62d910 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Mon, 16 Feb 2026 13:12:43 +0000 Subject: [PATCH 3/4] Add Docker documentation to README and create DOCKER.md Co-authored-by: bjoernbethge <8515720+bjoernbethge@users.noreply.github.com> --- DOCKER.md | 137 ++++++++++++++++++++++++++++++++++++++++++++++++++++++ README.md | 49 +++++++++++++++++++ 2 files changed, 186 insertions(+) create mode 100644 DOCKER.md diff --git a/DOCKER.md b/DOCKER.md new file mode 100644 index 000000000000..32ecfb4b5856 --- /dev/null +++ b/DOCKER.md @@ -0,0 +1,137 @@ +# ComfyUI Docker Image + +This repository includes automated Docker image builds that are released weekly. + +## Automated Builds + +A Docker image is automatically built and published to GitHub Container Registry (ghcr.io) every Monday at 00:00 UTC via GitHub Actions workflow. + +## Using the Docker Image + +### Pull the latest image + +```bash +docker pull ghcr.io/synapticore-studio/comfyui:latest +``` + +### Pull a specific version + +```bash +docker pull ghcr.io/synapticore-studio/comfyui:0.13.0 +``` + +### Run ComfyUI in a container + +```bash +docker run -d \ + --name comfyui \ + -p 8188:8188 \ + -v $(pwd)/models:/app/models \ + -v $(pwd)/input:/app/input \ + -v $(pwd)/output:/app/output \ + ghcr.io/synapticore-studio/comfyui:latest +``` + +Access ComfyUI at: http://localhost:8188 + +### Run with GPU support (NVIDIA) + +For GPU support, you need nvidia-docker: + +```bash +docker run -d \ + --name comfyui \ + --gpus all \ + -p 8188:8188 \ + -v $(pwd)/models:/app/models \ + -v $(pwd)/input:/app/input \ + -v $(pwd)/output:/app/output \ + ghcr.io/synapticore-studio/comfyui:latest +``` + +## Building Locally + +If you want to build the Docker image locally: + +```bash +docker build -t comfyui:local . +``` + +## Docker Compose + +Create a `docker-compose.yml` file: + +```yaml +version: '3.8' + +services: + comfyui: + image: ghcr.io/synapticore-studio/comfyui:latest + ports: + - "8188:8188" + volumes: + - ./models:/app/models + - ./input:/app/input + - ./output:/app/output + - ./custom_nodes:/app/custom_nodes + environment: + - PYTHONUNBUFFERED=1 + # Uncomment for GPU support + # deploy: + # resources: + # reservations: + # devices: + # - driver: nvidia + # count: all + # capabilities: [gpu] +``` + +Run with: + +```bash +docker-compose up -d +``` + +## Volumes + +The Docker image uses the following directories: + +- `/app/models` - Store your AI models here +- `/app/input` - Input files for processing +- `/app/output` - Generated output files +- `/app/custom_nodes` - Custom nodes directory + +Mount these directories as volumes to persist data between container restarts. + +## Configuration + +The default command runs ComfyUI with: +- Listen on all interfaces (`--listen 0.0.0.0`) +- Port 8188 (`--port 8188`) + +You can override this by providing your own command: + +```bash +docker run -p 8188:8188 ghcr.io/synapticore-studio/comfyui:latest \ + python main.py --listen 0.0.0.0 --port 8188 --cpu +``` + +## Manual Workflow Trigger + +The Docker build workflow can also be triggered manually: + +1. Go to Actions tab in GitHub +2. Select "Weekly Docker Image Release" +3. Click "Run workflow" + +## Image Tags + +- `latest` - The most recent build +- `` - Specific version (e.g., `0.13.0`) +- `-` - Version with git commit SHA + +## Notes + +- Models are not included in the Docker image and need to be downloaded separately +- The image is optimized for CPU execution by default +- For GPU support, ensure you have the appropriate NVIDIA drivers and nvidia-docker installed diff --git a/README.md b/README.md index 3ccdc9c19af1..204eeaee5ade 100644 --- a/README.md +++ b/README.md @@ -49,6 +49,11 @@ ComfyUI lets you design and execute advanced stable diffusion pipelines using a #### [Manual Install](#manual-install-windows-linux) Supports all operating systems and GPU types (NVIDIA, AMD, Intel, Apple Silicon, Ascend). +#### [Docker](#docker-deployment) +- Run ComfyUI in a containerized environment. +- Weekly automated builds available on GitHub Container Registry. +- See [DOCKER.md](DOCKER.md) for detailed instructions. + ## [Examples](https://comfyanonymous.github.io/ComfyUI_examples/) See what ComfyUI can do with the [example workflows](https://comfyanonymous.github.io/ComfyUI_examples/). @@ -326,6 +331,50 @@ For models compatible with Iluvatar Extension for PyTorch. Here's a step-by-step 2. Launch ComfyUI by running `python main.py` +## Docker Deployment + +ComfyUI can be run in a Docker container with automated weekly builds. + +### Quick Start + +```bash +# Pull the latest image +docker pull ghcr.io/synapticore-studio/comfyui:latest + +# Run ComfyUI +docker run -d \ + --name comfyui \ + -p 8188:8188 \ + -v $(pwd)/models:/app/models \ + -v $(pwd)/input:/app/input \ + -v $(pwd)/output:/app/output \ + ghcr.io/synapticore-studio/comfyui:latest +``` + +Access ComfyUI at: http://localhost:8188 + +### GPU Support + +For NVIDIA GPU support: + +```bash +docker run -d \ + --name comfyui \ + --gpus all \ + -p 8188:8188 \ + -v $(pwd)/models:/app/models \ + ghcr.io/synapticore-studio/comfyui:latest +``` + +### More Information + +See [DOCKER.md](DOCKER.md) for detailed Docker instructions including: +- Automated weekly builds +- Docker Compose setup +- Volume configuration +- Building locally + + ## [ComfyUI-Manager](https://github.com/Comfy-Org/ComfyUI-Manager/tree/manager-v4) **ComfyUI-Manager** is an extension that allows you to easily install, update, and manage custom nodes for ComfyUI. From d612b025ec9462fd1b472199d0250700e55f89c9 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Mon, 16 Feb 2026 13:13:30 +0000 Subject: [PATCH 4/4] Include DOCKER.md in Docker image Co-authored-by: bjoernbethge <8515720+bjoernbethge@users.noreply.github.com> --- .dockerignore | 1 + 1 file changed, 1 insertion(+) diff --git a/.dockerignore b/.dockerignore index 46418d95e91e..3c0bdf3e0ffe 100644 --- a/.dockerignore +++ b/.dockerignore @@ -28,6 +28,7 @@ htmlcov/ # Documentation *.md !README.md +!DOCKER.md docs/ # CI/CD