1.4 KiB
1.4 KiB
modules/nixos/server/services/comfyui/
ComfyUI (Stable Diffusion workflow UI) running in Docker with GPU acceleration. Supports both
ROCm (AMD) and CUDA (NVIDIA) via a mode switch, with shared options/assertions in
shared.nix.
Files
comfyui/
├── default.nix # imports shared + rocm + rocm-docker + cuda
├── shared.nix # skyg.nixos.server.services.comfyui.* — options, firewall, assertions
├── rocm.nix # ROCm (AMD) path
├── rocm-docker.nix # ROCm container/image wiring
├── cuda.nix # CUDA (NVIDIA) path
├── rocm.Containerfile# ROCm image definition
└── init.sh # Container init script
Behaviour
modeselects"rocm"(default) or"cuda". Web UI onport(default 8188),openFirewalldefaults to true.shared.nixasserts that Docker,hardware.graphics, andhardware.enableAllFirmwareare all enabled — ComfyUI needs the GPU passed through to the container.
Option Namespace
skyg.nixos.server.services.comfyui.enable
skyg.nixos.server.services.comfyui.mode # "rocm" | "cuda"
skyg.nixos.server.services.comfyui.port # default 8188
skyg.nixos.server.services.comfyui.openFirewall # default true
Conventions
- Pick the GPU
modematching the host hardware; the unused path stays inert. - This module requires Docker (not Podman) and the relevant
hardware/*GPU module enabled.