Skip to content
Draft
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
48 changes: 48 additions & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
# 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
!DOCKER.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
78 changes: 78 additions & 0 deletions .github/workflows/docker-weekly-release.yml
Original file line number Diff line number Diff line change
@@ -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
137 changes: 137 additions & 0 deletions DOCKER.md
Original file line number Diff line number Diff line change
@@ -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
- `<version>` - Specific version (e.g., `0.13.0`)
- `<version>-<sha>` - 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
39 changes: 39 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -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"]
49 changes: 49 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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/).

Expand Down Expand Up @@ -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.
Expand Down