How do you guys run ComfyUI on NixOS?

I have a handful of options for doing so: nix-comfyui, but it hasn’t been updated in months, I could use some nix soution to set it up, or try a docker container. I’m actually surprised there isn’t an official container given the popularity, amount of maintainers, and the funding ComfyUI has received.

I’m interested in this too, I’m disappointed to see this thread hasn’t gotten any replies. I’m trying out aldenparker/comfyui-nix-devshell but it is giving me trouble with my AMD GPU

I too would love to play with comfyui & krita.

I actually did get it working, IIRC, I followed this guide and added the following:

environment.systemPackages = [  
pkgs.uv
]

programs.nix-ld = {
enable = true;
libraries = [ config.boot.kernelPackages.nvidia_x11 ]; 
}

My nvidia config:

  hardware = {
    graphics.enable = true;
    nvidia = {
      nvidiaSettings = true;
      open = true;
    };
  };

I looked at this comfyui issue, then downloaded comfyui and ran these commands in the directory: uv add --requirements requirements.txt, uv sync --extra cu126.

1 Like

I have built a flake for ComfyUI, it started off as an impure quick hacky way to test comfyui on my M4, but I have been working on it lately to make it a pure flake. comfyui-nix

2 Likes

Nice ! Are you going to upstream your work on NixOS/nixpkgs ?

2 Likes

I think the approach is still too birttle.. i think if i did it with the extension manager disabled and fully declartive it could be a thing. ComfyUI development seems chaotic with multiple releases a week at times. If people think it could be done cleanly I would be all for it