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 deployment for ComfyUI, a Stable Diffusion WebUI. It solves the complexity of setting up the environment, managing NVIDIA GPU drivers, and handling Python dependencies across different hardware generations (from GTX 10xx to RTX 50xx/Blackwell) while ensuring host OS separation and proper user permission management.

How it works

It uses official NVIDIA CUDA containers as a base to ensure optimal GPU performance. The system separates the installation into two main directories: a run folder for the virtual environment and source code, and a basedir folder for user files, models, and custom nodes. It supports both Docker and Podman and allows users to map their own UID/GID to avoid permission issues with files created inside the container.

Who it’s for

Users of ComfyUI who want a portable, isolated installation that is easy to update and compatible with various NVIDIA GPUs, including those on Windows (via WSL2), Linux, and Unraid.

Highlights

  • Hardware-Specific Tags: Provides multiple Ubuntu and CUDA version combinations to support a wide range of GPUs, including specific tags for Blackwell (RTX 50xx) and older GTX 10xx cards.
  • Permission Management: Drops privileges to a regular user and preserves host permissions via custom UID/GID mapping.
  • Flexible Installation: Supports uv for faster package installation and includes a TORCH_LOCK mechanism to prevent breaking updates to PyTorch.
  • Integrated Management: Comes with ComfyUI-Manager pre-installed for easier updates and node management.
  • Customization: Allows command-line overrides via environment variables and the execution of custom bash scripts within the container.

Related

  • Project
  • Project
  • Project
  • Project
  • Project