This commit is contained in:
807 2025-04-11 11:52:05 -04:00 committed by GitHub
commit 852a3e4081
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 136 additions and 0 deletions

62
flake.lock Normal file
View File

@ -0,0 +1,62 @@
{
"nodes": {
"nixpkgs": {
"locked": {
"lastModified": 1741708242,
"narHash": "sha256-cNRqdQD4sZpN7JLqxVOze4+WsWTmv2DGH0wNCOVwrWc=",
"owner": "NixOS",
"repo": "nixpkgs",
"rev": "b62d2a95c72fb068aecd374a7262b37ed92df82b",
"type": "github"
},
"original": {
"owner": "NixOS",
"ref": "nixpkgs-unstable",
"repo": "nixpkgs",
"type": "github"
}
},
"nixpkgs_2": {
"locked": {
"lastModified": 1741513245,
"narHash": "sha256-7rTAMNTY1xoBwz0h7ZMtEcd8LELk9R5TzBPoHuhNSCk=",
"owner": "nixos",
"repo": "nixpkgs",
"rev": "e3e32b642a31e6714ec1b712de8c91a3352ce7e1",
"type": "github"
},
"original": {
"owner": "nixos",
"ref": "nixos-unstable",
"repo": "nixpkgs",
"type": "github"
}
},
"pyproject-nix": {
"inputs": {
"nixpkgs": "nixpkgs_2"
},
"locked": {
"lastModified": 1741648141,
"narHash": "sha256-jQEZCSCgm60NGmBg3JPu290DDhNVI1GVVEd0P8VCnME=",
"owner": "pyproject-nix",
"repo": "pyproject.nix",
"rev": "7747e5a058245c7abe033a798f818f0572d8e155",
"type": "github"
},
"original": {
"owner": "pyproject-nix",
"repo": "pyproject.nix",
"type": "github"
}
},
"root": {
"inputs": {
"nixpkgs": "nixpkgs",
"pyproject-nix": "pyproject-nix"
}
}
},
"root": "root",
"version": 7
}

74
flake.nix Normal file
View File

@ -0,0 +1,74 @@
{
description = "ComfyUI with requirements.txt";
inputs = {
nixpkgs.url = "github:NixOS/nixpkgs/nixpkgs-unstable";
pyproject-nix.url = "github:pyproject-nix/pyproject.nix";
};
outputs = {
self,
nixpkgs,
pyproject-nix,
...
} @ inputs: let
system = "x86_64-linux";
pkgs = import nixpkgs {
inherit system;
config.allowUnfree = true;
config.cudaSupport = true;
};
python = let
packageOverrides = self: super:
{
"comfyui-frontend-package" = super.buildPythonPackage
{
pname = "comfyui-frontend-package";
version = "1.12.14";
src = fetchTarball {
url = "https://files.pythonhosted.org/packages/cc/33/0ca463657227a7538b8b1d924840e4e25307f8c8d20c683439d7ea97ba6d/comfyui_frontend_package-1.12.14.tar.gz";
sha256 = "1c5j01xqkzxqzj5nf646jrs7g095b0pzliy9b3b60wrspkaa2296";
};
propagatedBuildInputs = [
super.setuptools
];
COMFYUI_FRONTEND_VERSION = "1.12.14";
};
"spandrel" = super.buildPythonPackage {
pname = "spandrel";
pyproject = true;
version = "0.4.1";
src = fetchTarball {
url = "https://files.pythonhosted.org/packages/45/e0/048cd03119a9f2b685a79601a52311d5910ff6fd710c01f4ed6769a2892f/spandrel-0.4.1.tar.gz";
sha256 = "1byaq7mzjs27qhs9d7aw6xflqlj3qzm47mgawdxrlcw9qj4gk9w4";
};
buildInputs = [
super.torch
super.torchvision
super.safetensors
super.einops
];
};
};
in
pkgs.python3.override {
inherit packageOverrides;
self = python;
};
project = pyproject-nix.lib.project.loadRequirementsTxt {
projectRoot = ./.;
};
pythonEnv = assert project.validators.validateVersionConstraints {inherit python;} == {}; (
python.withPackages (project.renderers.withPackages {
inherit python;
})
);
in {
formatter.${system} = nixpkgs.legacyPackages.${system}.alejandra;
devShells.${system}.default = pkgs.mkShell {
packages = [
pythonEnv
#(python.withPackages (ps: with ps; [ comfyui-frontend-package ]))
];
};
};
}