mmartial/ComfyUI-Nvidia-Docker

ComfyUI for NVIDIA GPU in a Docker container with user configurable uid/gid

What it solves

This project provides a Docker-based environment for running ComfyUI, a Stable Diffusion WebUI, specifically optimized for NVIDIA GPUs. It solves the problem of complex manual installations, host OS pollution, and dependency conflicts by encapsulating the entire setup—including CUDA, CuDNN, and Python virtual environments—within a container.

How it works

The project uses official NVIDIA CUDA containers as a base. It separates the installation into two primary directories: a run folder (containing the virtual environment and ComfyUI source code) and a basedir folder (containing user files, models, and custom nodes). This architecture allows for independent environment management while preserving user data. It supports various Ubuntu and CUDA version combinations to ensure compatibility with different NVIDIA hardware, from older GTX 10xx series to the latest Blackwell (RTX 50xx) GPUs. It also integrates ComfyUI-Manager for easier updates and allows users to map their own UID/GID to maintain proper file permissions on the host.

Who it’s for

Users who want to run ComfyUI on NVIDIA GPUs using Docker or Podman, including those on Windows (via WSL2), Linux, or Unraid, who prefer process isolation and a streamlined setup process.

Highlights

  • Broad Hardware Support: Dedicated container tags for different CUDA versions, including specific support for RTX 50xx (Blackwell) and GTX 10xx GPUs.
  • Permission Management: Custom UID/GID mapping to ensure the container user matches the host user's permissions.
  • Flexible Installation: Optional support for uv for faster Python package installations and TORCH_LOCK to prevent breaking updates.
  • Customizability: Ability to run custom bash scripts (user_script.bash) and pass additional command-line arguments via environment variables.
  • Pre-built Images: Ready-to-use images available on DockerHub, including Unraid-compatible versions.

Related

  • Project
  • Project
  • Project
  • Project
  • Project