Skip to content

Latest commit

 

History

8 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

ComfyUI Docker CUDA base

A reusable ComfyUI runtime built from one Dockerfile with PyTorch CUDA 13.0 wheels. It does not inherit from a prebuilt ComfyUI image.

The only container parent is Rocky Linux. PyTorch, NVIDIA runtime libraries, ComfyUI, ComfyUI Manager, CuPy, TAESD, and common workflow dependencies are installed by instructions owned in this repository.

The release target is linux/amd64, matching Runpod's x86-64 NVIDIA workers. ARM images are not built or supported.

Runtime stack

Image suffix PyTorch TorchVision TorchAudio Runtime
cu130 2.12.1 0.27.1 2.11.0 CUDA 13.0

CUDA 13.0 supports Turing and newer NVIDIA GPUs and requires an R580-or-newer host driver.

These are runtime images. They include CUDA through PyTorch's wheels but do not include nvcc or a full CUDA development toolkit. A downstream custom node that compiles CUDA source should use a separate devel image design or install a wheel matching the selected PyTorch/CUDA combination.

Build

Build the CUDA 13.0 image:

make build

Or call Docker directly:

docker buildx build \
  --platform linux/amd64 \
  --build-arg COMFYUI_REF=v0.28.2 \
  --load \
  -t comfyui-docker-cuda:base-cu130-pt2.12.1 \
  .

COMFYUI_REF must be an explicit Git tag or commit available from the configured ComfyUI repository.

Runtime layout

The image contains an immutable template at:

/default-comfyui-bundle/ComfyUI

At first start, the entrypoint overlays that template into:

/root/ComfyUI

Existing files are not overwritten. This permits persistent Pod storage and also preserves files added by older downstream images under /root/ComfyUI. The image deliberately does not declare VOLUME /root, so derived-image writes are retained.

Start ComfyUI:

docker run --rm --gpus all \
  -p 8188:8188 \
  -e CLI_ARGS="--fast" \
  comfyui-docker-cuda:base-cu130-pt2.12.1

To share models from another tree, set COMFYUI_EXTRA_MODEL_PATHS to a ComfyUI extra_model_paths.yaml file. The entrypoint symlinks it to /root/ComfyUI/extra_model_paths.yaml on each start. Missing path fails startup.

docker run --rm --gpus all \
  -p 8188:8188 \
  -v /models/extra_model_paths.yaml:/models/extra_model_paths.yaml:ro \
  -e COMFYUI_EXTRA_MODEL_PATHS=/models/extra_model_paths.yaml \
  comfyui-docker-cuda:base-cu130-pt2.12.1

Use from a workflow image

Publish the base to your own registry, then pin its digest in downstream Dockerfiles. Add build-time nodes and models to the template path:

FROM ghcr.io/your-org/comfyui-docker-cuda:base-cu130-pt2.12.1@sha256:YOUR_DIGEST

WORKDIR /default-comfyui-bundle/ComfyUI/custom_nodes

RUN git clone --depth=1 \
    https://github.com/Lightricks/ComfyUI-LTXVideo.git

RUN python -m pip install \
    -c /opt/comfyui-build/constraints.txt \
    -r ComfyUI-LTXVideo/requirements.txt

WORKDIR /default-comfyui-bundle/ComfyUI

Download workflow models into the appropriate directory under /default-comfyui-bundle/ComfyUI/models. Pin repository commits, Python package versions, image digests, model URLs, and model SHA-256 checksums in production images.

Legacy derived Dockerfiles that write into /root/ComfyUI/custom_nodes or /root/ComfyUI/models continue to work: on first startup, the core template is copied around those existing files without replacing them. New images should prefer the template path so the complete application can be validated during the image build.

Build contract

The Dockerfile owns one tested PyTorch and CUDA combination:

PyTorch index CuPy package Host guard
cu130 cupy-cuda13x cuda>=13.0

xFormers, FlashAttention, SageAttention, and other compiled accelerators are intentionally excluded. Install them in a CUDA-specific downstream image only after verifying their PyTorch ABI and GPU architecture support.

Validation

Run static checks:

make check

After building, inspect the embedded runtime without requiring a GPU:

make inspect

Run the GPU matrix-multiplication and scaled-dot-product-attention smoke test:

make smoke

Before publishing a tag, qualify it on a compatible NVIDIA worker. A CPU build or import test confirms packaging but cannot prove that CUDA kernels execute. For LTX 2.3, also run a small real workflow in the downstream image and verify the output with ffprobe.

Publishing

The GitHub Actions workflow uses Blacksmith's Docker builder and publishes one amd64-only image:

Runtime Stable tags
CUDA 13.0 base-cu130-pt2.12.1, cu130

Every published build also receives an immutable cu130-sha-<commit> tag. A Git tag such as v1.0.0 additionally publishes v1.0.0-cu130.

Both GitHub Actions workflows run only through manual dispatch. Each run builds and publishes to:

ghcr.io/<owner>/comfyui-docker-cuda

The workflow authenticates with GITHUB_TOKEN; it does not need Hugging Face or Civitai secrets because this base image does not download gated models.

Publish explicit tags that expose both CUDA and PyTorch versions:

base-cu130-pt2.12.1

Example release build:

docker buildx build \
  --platform linux/amd64 \
  --provenance=mode=max \
  --sbom=true \
  --push \
  -t ghcr.io/your-org/comfyui-docker-cuda:base-cu130-pt2.12.1 \
  .

Ownership and external inputs

This project removes the dependency on yanwk/comfyui-boot. It necessarily still consumes external software: an operating-system root filesystem, Python packages, NVIDIA runtime libraries, and Git repositories. Eliminating all third-party inputs would require maintaining a Linux distribution, CUDA, PyTorch, and ComfyUI themselves.

See NOTICE.md and LICENSE for attribution and terms.

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages