Initial attempt; going to try something different now.

This commit is contained in:
2025-08-26 12:17:44 -07:00
parent 00ed153b61
commit b8f8e4d6a6
2 changed files with 146 additions and 0 deletions

67
flake.nix Normal file
View File

@@ -0,0 +1,67 @@
{
description = "ComfyUI as a Nix Flake";
inputs = {
nixpkgs.url = "github:nixos/nixpkgs/nixos-unstable";
flake-utils.url = "github:numtide/flake-utils";
comfyuigit = {
flake = false;
url = "github:comfyanonymous/ComfyUi/v0.3.50";
};
};
outputs = { comfyuigit, flake-utils, nixpkgs, ... }:
flake-utils.lib.eachDefaultSystem (system:
let pkgs = import nixpkgs {
inherit system;
};
pyenv = pkgs.python312.buildEnv.override {
extraLibs = with pkgs.python312Packages; [
torchvision
torchaudio
torchsde
einops
transformers
safetensors
pyyaml
pillow
scipy
tqdm
psutil
kornia
numba
opencv4
GitPython
numexpr
matplotlib
pandas
imageio-ffmpeg
scikit-image
pip
accelerate
];
};
in rec {
packages = rec {
comfyui = pkgs.stdenv.mkDerivation {
name = "comfyui";
src = comfyuigit;
installPhase = ''
mkdir -p $out/bin
cp -r $src/* $out
echo "${pyenv}/bin/python main.py" > $out/bin/comfyui
chmod +x $out/bin/comfyui
'';
};
default = comfyui;
};
devShell = pkgs.mkShell {
buildInputs = [packages.comfyuimain pyenv];
};
}
);
}