Skip to content

About

ComfyUI Docker Images

Resources

Stars

44 stars

Watchers

0 watching

Forks

Latest commit

 

History

75 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

ComfyUI Prebuilt Docker Images

This repository provides Docker build configurations that package ComfyUI together with all prerequisites, in a few different flavors. It also contains GitHub Actions definitions that can build and publish them to the GitHub Container Registry.

Use cases

Motivation

The images are ready-to-run with all necessary dependencies already installed. This means that upgrading to a new version of ComfyUI simply means downloading a new image, instead of updating existing files in place. So no fear of breaking an existing installation while updating!

Automatic builds on upstream changes

The ComfyUI repository is checked periodically for updates, to ensure the images stay up to date.

latest master cpu-latest cpu-master amd-latest amd-master
base base latest base master base cpu-latest base cpu-master base amd-latest base amd-master
extensions ext latest ext master ext cpu-latest ext cpu-master ext amd-latest ext amd-master
ssh ssh latest ssh master ssh cpu-latest ssh cpu-master ssh amd-latest ssh amd-master

Available images

These images are currently published to the GitHub Container Registry under ghcr.io/offloadr:

The images moved here from ghcr.io/radiatingreverberations. The old names still receive every update for now, but new setups should use ghcr.io/offloadr.

Image Additional installed components
comfyui-base NVIDIA images: xFormers, SageAttention2++
comfyui-extensions ComfyUI-Manager
comfyui-ssh OpenSSH server

The NVIDIA images include xFormers and SageAttention2++.

Current ComfyUI releases also include Comfy Kitchen attention, available with --use-ck-attention. Compare its speed, VRAM use and output quality on your workflows before switching from --use-sage-attention.

Hugging Face downloads use the transfer implementation supplied by huggingface_hub. Manager's optional Matrix sharing feature requires installing matrix-nio in a derived image; normal Manager operation does not require it.

Available tags

Tag Description
latest Latest tagged release of ComfyUI for NVIDIA / CUDA 13.0.3
vX.Y.Z Latest image built for a specific tagged ComfyUI release for NVIDIA / CUDA 13.0.3
master Latest commit of the ComfyUI master branch for NVIDIA / CUDA 13.0.3
amd-latest / amd-master As above, but for AMD / ROCm 7.2.3
cpu-latest / cpu-master As above, but a plain Ubuntu base image without GPU support
amd-vX.Y.Z / cpu-vX.Y.Z Release-specific tags for AMD / ROCm 7.2.3 and CPU-only images

Release-specific tags track the current image for that upstream ComfyUI release and may move when this repository's Docker build logic changes.

Running locally

Basic usage

docker run --gpus=all -p 8188:8188 ghcr.io/offloadr/comfyui-extensions:latest

Additional options

Additional arguments will be forwarded to ComfyUI. For example, to enable SageAttention:

docker run --gpus=all -p 8188:8188 ghcr.io/offloadr/comfyui-extensions:latest --use-sage-attention

On container start, the entrypoint activates the baked virtual environment at /opt/venv. Application dependencies are installed into that venv when the image is built.

With persistent storage

Without any additional configuration, any files created from ComfyUI will be lost whenever the container is removed or recreated, such as when updating to a new version. So when running locally, you most likely want certain directories to be located outside of the container. For persistent storage, mount these directories:

Container Path Purpose
/comfyui/models Model files
/comfyui/user User settings and ComfyUI-Manager data
/comfyui/input Input images/videos
/comfyui/output Generated outputs

Persist custom nodes

When using the extensions image that includes ComfyUI-Manager, you may also want the custom nodes you install to persist across Docker image updates. Mount this additional directory:

Container Path Purpose
/comfyui/custom_nodes Custom nodes

Note that it is not recommended to update ComfyUI itself using ComfyUI-Manager - update to a later version of the Docker image instead.

Using Docker Compose

An example of putting it all together using Docker Compose:

services:
  comfyui:
    image: ghcr.io/offloadr/comfyui-extensions:latest
    container_name: comfyui
    command:
      - --use-sage-attention
    ports:
      - "8188:8188"
    volumes:
      - ./models:/comfyui/models
      - ./user:/comfyui/user
      - ./input:/comfyui/input
      - ./output:/comfyui/output
      - ./custom_nodes:/comfyui/custom_nodes
    deploy:
      resources:
        reservations:
          devices:
            - driver: nvidia
              count: all
              capabilities: [gpu]
    restart: unless-stopped

Windows specific notes

When running Docker images on Windows, it most likely runs on a Linux VM under WSL2. This means that they cannot access the Windows file systems directly, but have to use drvfs. This can make models take longer to load. The workaround is to put such files on a Linux file system directly inside WSL2.

Running on a cloud provider

The NVIDIA images use PyTorch 2.14.1 and CUDA 13.0.3. The host supplies the NVIDIA driver; its installed CUDA Toolkit does not need to match the container. On Vast.ai, QuickPod, RunPod, Shadeform and similar services, choose a host advertising CUDA 13.0 or newer (driver branch R580 or newer). Check the actual driver capability before renting; a GPU model or template's installed CUDA Toolkit version alone does not establish compatibility. Hosts below CUDA 13.0 need a separately maintained older runtime. See NVIDIA's compatibility documentation for driver requirements and PTX/JIT limitations.

If you want to run ComfyUI on a cloud provider without exposing the web UI directly, use the ssh image and connect through an SSH tunnel. The full setup and security notes are documented in SSH.md.

Building

Instead of using the pre-built images it is also possible to build them locally.

docker buildx bake

By default local builds consume:

  • ghcr.io/offloadr/base/cpu-core:py3.12-torch2.14.1-cpu
  • ghcr.io/offloadr/base/amd-core:py3.12-torch2.14.1-rocm7.2.4
  • ghcr.io/offloadr/base/nvidia-full:py3.12-torch2.14.1-cuda13.0.3

To override them, pass one or more Bake variables such as CPU_BASE_IMAGE, AMD_BASE_IMAGE, or NVIDIA_BASE_IMAGE.

For Hopper GPUs (H100/H800), the base-image repository also provides an opt-in nvidia-hopper build with FlashAttention 3. Build that target in the base-image repository and select its tag for a custom ComfyUI build:

NVIDIA_BASE_IMAGE=ghcr.io/offloadr/base/nvidia-hopper:py3.12-torch2.14.1-cuda13.0.3 BASE_FLAVOR=nvidia docker buildx bake

FlashAttention 3 can serve xFormers on supported Hopper hardware. It does not provide the flash_attn module expected by ComfyUI's --use-flash-attention option.

All three image variants are targets in src/dockerfile. Their dependency stages receive only upstream requirements files; ComfyUI source is copied near the end of each image. Updating source without changing requirements reuses the Python, Git, Manager, and SSH installation layers. A cached dependency baseline also contains the large frontend, workflow templates and documentation packages. Upstream requirements select the final installed versions; updates install changed packages above that baseline instead of reinstalling all template media. Dependency or base-image updates can still require larger downloads. The downloaded source archive stays in a build stage and is not included in the published images.

CI builds the resolved ComfyUI commit SHA, so the source matches the image's comfyui.sha label even if the upstream branch moves during a build.

To verify layer reuse, select two ComfyUI commit SHAs with identical requirements.txt and manager_requirements.txt, then run:

python tests/check_layer_reuse.py <before-sha> <after-sha> --flavor nvidia

This builds all three variants locally and checks that only their source layer changes, then removes its test images even if the check fails. Use --keep-images to retain them for debugging. The first build may download the base image and Python dependencies; Docker's build cache remains available for reuse.

To check a small upstream dependency update, add --requirements-change. This checks baseline reuse, limits the upstream requirements installation layer to 128 MiB, and verifies installed package requirements in both images. GitHub runs both source-only and dependency-update checks before publishing repository changes.

Image details

ComfyUI base image

ComfyUI extensions image

ComfyUI SSH image

About

ComfyUI Docker Images

Resources

Stars

44 stars

Watchers

0 watching

Forks

Packages

Contributors

Languages