This commit is contained in:
Denis Manherz 2024-02-24 18:57:40 +01:00
parent a227d57d28
commit 45e0082ede
9 changed files with 530 additions and 584 deletions

View file

@ -3,11 +3,11 @@
"a1111-src": {
"flake": false,
"locked": {
"lastModified": 1699030214,
"narHash": "sha256-UQ2cJ92JdSHOe0g5IkaCXPO0MYyWpLAcp6f8p+T6bxs=",
"lastModified": 1702709887,
"narHash": "sha256-xOId/D5eJszmRn0tCZtS+/u5WQUBpdPQ0I5XZIv3FvE=",
"owner": "automatic1111",
"repo": "stable-diffusion-webui",
"rev": "4afaaf8a020c1df457bcf7250cb1c7f609699fa7",
"rev": "cf2772fab0af5573da775e7437e6acdca424f26e",
"type": "github"
},
"original": {
@ -35,11 +35,11 @@
"comfyui-src": {
"flake": false,
"locked": {
"lastModified": 1702736172,
"narHash": "sha256-BYZHfnhdubasOAhUyq/iW4HvYKPiqBwiXY3ozZXU1Oc=",
"lastModified": 1708708880,
"narHash": "sha256-0ibYcqMczdT9oN026EwxlnGeeBcKISJ+OToHp7cOUlY=",
"owner": "comfyanonymous",
"repo": "ComfyUI",
"rev": "6453dc1ca2d98d89af7cf312bb48d1e3fd2ca27f",
"rev": "1e5f0f66be93182f30d5d453dc8df50f3f7c1826",
"type": "github"
},
"original": {
@ -55,11 +55,11 @@
]
},
"locked": {
"lastModified": 1685662779,
"narHash": "sha256-cKDDciXGpMEjP1n6HlzKinN0H+oLmNpgeCTzYnsA2po=",
"lastModified": 1706830856,
"narHash": "sha256-a0NYyp+h9hlb7ddVz4LUn1vT/PLwqfrWYcHMvFB1xYg=",
"owner": "hercules-ci",
"repo": "flake-parts",
"rev": "71fb97f0d875fd4de4994dfb849f2c75e17eb6c3",
"rev": "b253292d9c0a5ead9bc98c4e9a26c6312e27d69f",
"type": "github"
},
"original": {
@ -70,14 +70,17 @@
},
"flake-parts_2": {
"inputs": {
"nixpkgs-lib": "nixpkgs-lib"
"nixpkgs-lib": [
"hercules-ci-effects",
"nixpkgs"
]
},
"locked": {
"lastModified": 1685662779,
"narHash": "sha256-cKDDciXGpMEjP1n6HlzKinN0H+oLmNpgeCTzYnsA2po=",
"lastModified": 1701473968,
"narHash": "sha256-YcVE5emp1qQ8ieHUnxt1wCZCC3ZfAS+SRRWZ2TMda7E=",
"owner": "hercules-ci",
"repo": "flake-parts",
"rev": "71fb97f0d875fd4de4994dfb849f2c75e17eb6c3",
"rev": "34fed993f1674c8d06d58b37ce1e0fe5eebcb9f5",
"type": "github"
},
"original": {
@ -85,77 +88,19 @@
"type": "indirect"
}
},
"flake-parts_3": {
"inputs": {
"nixpkgs-lib": [
"hercules-ci-effects",
"hercules-ci-agent",
"nixpkgs"
]
},
"locked": {
"lastModified": 1685662779,
"narHash": "sha256-cKDDciXGpMEjP1n6HlzKinN0H+oLmNpgeCTzYnsA2po=",
"owner": "hercules-ci",
"repo": "flake-parts",
"rev": "71fb97f0d875fd4de4994dfb849f2c75e17eb6c3",
"type": "github"
},
"original": {
"owner": "hercules-ci",
"repo": "flake-parts",
"type": "github"
}
},
"haskell-flake": {
"locked": {
"lastModified": 1684780604,
"narHash": "sha256-2uMZsewmRn7rRtAnnQNw1lj0uZBMh4m6Cs/7dV5YF08=",
"owner": "srid",
"repo": "haskell-flake",
"rev": "74210fa80a49f1b6f67223debdbf1494596ff9f2",
"type": "github"
},
"original": {
"owner": "srid",
"ref": "0.3.0",
"repo": "haskell-flake",
"type": "github"
}
},
"hercules-ci-agent": {
"inputs": {
"flake-parts": "flake-parts_3",
"haskell-flake": "haskell-flake",
"nixpkgs": "nixpkgs"
},
"locked": {
"lastModified": 1686721748,
"narHash": "sha256-ilD6ANYID+b0/+GTFbuZXfmu92bqVqY5ITKXSxqIp5A=",
"owner": "hercules-ci",
"repo": "hercules-ci-agent",
"rev": "7192b83935ab292a8e894db590dfd44f976e183b",
"type": "github"
},
"original": {
"id": "hercules-ci-agent",
"type": "indirect"
}
},
"hercules-ci-effects": {
"inputs": {
"flake-parts": "flake-parts_2",
"hercules-ci-agent": "hercules-ci-agent",
"nixpkgs": [
"nixpkgs"
]
},
"locked": {
"lastModified": 1686830987,
"narHash": "sha256-1XLTM0lFr3NV+0rd55SQW/8oQ3ACnqlYcda3FelIwHU=",
"lastModified": 1708547820,
"narHash": "sha256-xU/KC1PWqq5zL9dQ9wYhcdgxAwdeF/dJCLPH3PNZEBg=",
"owner": "hercules-ci",
"repo": "hercules-ci-effects",
"rev": "04e4ab63b9eed2452edee1bb698827e1cb8265c6",
"rev": "0ca27bd58e4d5be3135a4bef66b582e57abe8f4a",
"type": "github"
},
"original": {
@ -184,11 +129,11 @@
"kohya_ss-src": {
"flake": false,
"locked": {
"lastModified": 1699706768,
"narHash": "sha256-/9YWOUbqErxrG5igF7CgUTGzxjSkOPhMA79wekGPfaQ=",
"lastModified": 1708209234,
"narHash": "sha256-ae/bkcIdSsV4FBnAj0EiBHNoRLJSgSbRnlsK6XZwmGA=",
"owner": "bmaltais",
"repo": "kohya_ss",
"rev": "9eb5da23002c6e00f084a19d62da6fc82074c773",
"rev": "f8d2673641778ed5b362f107f9f92a20aa15979a",
"type": "github"
},
"original": {
@ -199,11 +144,11 @@
},
"nixpkgs": {
"locked": {
"lastModified": 1686501370,
"narHash": "sha256-G0WuM9fqTPRc2URKP9Lgi5nhZMqsfHGrdEbrLvAPJcg=",
"lastModified": 1708655239,
"narHash": "sha256-ZrP/yACUvDB+zbqYJsln4iwotbH6CTZiTkANJ0AgDv4=",
"owner": "NixOS",
"repo": "nixpkgs",
"rev": "75a5ebf473cd60148ba9aec0d219f72e5cf52519",
"rev": "cbc4211f0afffe6dfd2478a62615dd5175a13f9a",
"type": "github"
},
"original": {
@ -213,52 +158,18 @@
"type": "github"
}
},
"nixpkgs-lib": {
"locked": {
"dir": "lib",
"lastModified": 1685564631,
"narHash": "sha256-8ywr3AkblY4++3lIVxmrWZFzac7+f32ZEhH/A8pNscI=",
"owner": "NixOS",
"repo": "nixpkgs",
"rev": "4f53efe34b3a8877ac923b9350c874e3dcd5dc0a",
"type": "github"
},
"original": {
"dir": "lib",
"owner": "NixOS",
"ref": "nixos-unstable",
"repo": "nixpkgs",
"type": "github"
}
},
"nixpkgs-stable": {
"locked": {
"lastModified": 1700403855,
"narHash": "sha256-Q0Uzjik9kUTN9pd/kp52XJi5kletBhy29ctBlAG+III=",
"lastModified": 1708566995,
"narHash": "sha256-e/THimsoxxMAHSbwMKov5f5Yg+utTj6XVGEo24Lhx+0=",
"owner": "NixOS",
"repo": "nixpkgs",
"rev": "0c5678df521e1407884205fe3ce3cf1d7df297db",
"rev": "3cb4ae6689d2aa3f363516234572613b31212b78",
"type": "github"
},
"original": {
"owner": "NixOS",
"ref": "nixos-23.05",
"repo": "nixpkgs",
"type": "github"
}
},
"nixpkgs_2": {
"locked": {
"lastModified": 1697059129,
"narHash": "sha256-9NJcFF9CEYPvHJ5ckE8kvINvI84SZZ87PvqMbH6pro0=",
"owner": "NixOS",
"repo": "nixpkgs",
"rev": "5e4c2ada4fcd54b99d56d7bd62f384511a7e2593",
"type": "github"
},
"original": {
"owner": "NixOS",
"ref": "nixos-unstable",
"ref": "nixos-23.11",
"repo": "nixpkgs",
"type": "github"
}
@ -272,7 +183,7 @@
"hercules-ci-effects": "hercules-ci-effects",
"invokeai-src": "invokeai-src",
"kohya_ss-src": "kohya_ss-src",
"nixpkgs": "nixpkgs_2",
"nixpkgs": "nixpkgs",
"nixpkgs-stable": "nixpkgs-stable",
"sd-src": "sd-src",
"sgm-src": "sgm-src",
@ -298,11 +209,11 @@
"sgm-src": {
"flake": false,
"locked": {
"lastModified": 1692287310,
"narHash": "sha256-Gvpjfv5hFEeQl67OeTXVhiB4zvgV5UZ5B/ar4rBW0d0=",
"lastModified": 1708536887,
"narHash": "sha256-1jGByyT7EDHsCifLjlcvg9Y5BYb7cr3xR3+hsiQOaEA=",
"owner": "Stability-AI",
"repo": "generative-models",
"rev": "477d8b9a7730d9b2e92b326a770c0420d00308c9",
"rev": "1e30a2df801a18c82a24223adfbdc71be0e8ca20",
"type": "github"
},
"original": {

View file

@ -8,11 +8,11 @@
inputs = {
comfyui-src = {
url = github:comfyanonymous/ComfyUI;
url = "github:comfyanonymous/ComfyUI";
flake = false;
};
nixpkgs-stable = {
url = github:NixOS/nixpkgs/nixos-23.05;
url = "github:NixOS/nixpkgs/nixos-23.11";
};
bark-gui-src = {
url = "github:C0untFloyd/bark-gui";
@ -54,32 +54,21 @@
inputs.nixpkgs.follows = "nixpkgs";
};
};
outputs = { flake-parts, invokeai-src, hercules-ci-effects, ... }@inputs:
outputs = {
flake-parts,
invokeai-src,
hercules-ci-effects,
...
} @ inputs:
flake-parts.lib.mkFlake {inherit inputs;} {
perSystem = {system, ...}: {
# _module.args.pkgs = import inputs.nixpkgs { config.allowUnfree = true; inherit system; config.cudaSupport = true; };
_module.args.pkgs = import inputs.nixpkgs {
inherit system;
/*overlays = [
(
final: prev: {
final.python310 = prev.python310.override {
enableOptimizations = true;
reproducibleBuild = false;
self = final.python310;
buildInputs = [ final.ffmpeg-full ];
config = {
allowUnfree = true;
cudaSupport = true;
};
pythonPackagesExtensions = prev.pythonPackagesExtensions ++ [
(
python-final: python-prev: {
torch = python-prev.torch-bin;
}
)
];
}
)
];*/
config = { allowUnfree = true; cudaSupport = true; };
};
legacyPackages = {
koboldai = builtins.throw ''
@ -103,8 +92,8 @@
./projects/automatic1111
./projects/invokeai
./projects/textgen
./projects/kohya_ss
./projects/bark-gui
#./projects/kohya_ss
#./projects/bark-gui
./website
];
};

View file

@ -1,12 +1,11 @@
lib: {
fixPackages = final: prev:
let
relaxProtobuf = pkg: pkg.overrideAttrs (old: {
fixPackages = final: prev: let
relaxProtobuf = pkg:
pkg.overrideAttrs (old: {
nativeBuildInputs = old.nativeBuildInputs ++ [final.pythonRelaxDepsHook];
pythonRelaxDeps = ["protobuf"];
});
in
{
in {
invisible-watermark = prev.invisible-watermark.overridePythonAttrs {
pythonImportsCheck = [];
};
@ -18,12 +17,20 @@ lib: {
wandb = relaxProtobuf (prev.wandb.overridePythonAttrs {
doCheck = false;
});
anyio = prev.anyio.overridePythonAttrs { doCheck = false; dontUsePytestCheck = true; };
mocket = prev.mocket.overridePythonAttrs { doCheck = false; dontUsePytestCheck = true; };
anyio = prev.anyio.overridePythonAttrs {
doCheck = false;
dontUsePytestCheck = true;
};
mocket = prev.mocket.overridePythonAttrs {
doCheck = false;
dontUsePytestCheck = true;
};
markdown-it-py = prev.markdown-it-py.overrideAttrs (old: {
nativeBuildInputs = old.nativeBuildInputs ++ [final.pythonRelaxDepsHook];
pythonRelaxDeps = ["linkify-it-py"];
passthru = old.passthru // {
passthru =
old.passthru
// {
optional-dependencies = with final; {
linkify = [linkify-it-py];
plugins = [mdit-py-plugins];
@ -38,12 +45,13 @@ lib: {
propagatedBuildInputs = old.propagatedBuildInputs ++ [final.packaging];
pythonImportsCheck = ["shap"];
meta = old.meta // {
meta =
old.meta
// {
broken = false;
};
});
streamlit =
let
streamlit = let
streamlit = final.callPackage (final.pkgs.path + "/pkgs/applications/science/machine-learning/streamlit") {
protobuf3 = final.protobuf;
};

View file

@ -1,21 +1,41 @@
{ config, lib, ... }:
let
inherit (lib)
mkIf mkOption mkEnableOption mkRenamedOptionModule types
escapeShellArgs flatten getExe mapAttrsToList
isBool isFloat isInt isList isString
floatToString optionalString
{
config,
lib,
...
}: let
inherit
(lib)
mkIf
mkOption
mkEnableOption
mkRenamedOptionModule
types
escapeShellArgs
flatten
getExe
mapAttrsToList
isBool
isFloat
isInt
isList
isString
floatToString
optionalString
;
cfg = config.services.a1111;
in
{
imports = map ({ old, new ? old }: mkRenamedOptionModule [ "services" "a1111" old ] [ "services" "a1111" "settings" new ]) [
in {
imports = map ({
old,
new ? old,
}:
mkRenamedOptionModule ["services" "a1111" old] ["services" "a1111" "settings" new]) [
{old = "host";}
{old = "port";}
{ old = "dataDir"; new = "root"; }
{
old = "dataDir";
new = "root";
}
{old = "precision";}
];
options.services.a1111 = {
@ -49,7 +69,8 @@ in
int
float
]);
in attrsOf (either atom (listOf atom));
in
attrsOf (either atom (listOf atom));
options = {
#listen = mkOption {
# description = "Launch gradio with 0.0.0.0 as server name, allowing to respond to network requests.";
@ -86,18 +107,26 @@ in
};
config = let
cliArgs = (flatten (mapAttrsToList (n: v:
if v == null then []
cliArgs =
(flatten (mapAttrsToList (
n: v:
if v == null
then []
#else if isBool v then [ "--${optionalString (!v) "no-"}${n}" ]
else if isInt v then [ "--${n}" "${toString v}" ]
else if isFloat v then [ "--${n}" "${floatToString v}" ]
else if isString v then ["--${n}" v ]
else if isList v then [ "--${n}" (toString v) ]
else if isInt v
then ["--${n}" "${toString v}"]
else if isFloat v
then ["--${n}" "${floatToString v}"]
else if isString v
then ["--${n}" v]
else if isList v
then ["--${n}" (toString v)]
else throw "Unhandled type for setting \"${n}\""
) cfg.settings)) ++ cfg.extraArgs;
in mkIf cfg.enable {
)
cfg.settings))
++ cfg.extraArgs;
in
mkIf cfg.enable {
users.users = mkIf (cfg.user == "a1111") {
a1111 = {
isSystemUser = true;
@ -119,6 +148,7 @@ in
User = cfg.user;
Group = cfg.group;
ExecStart = "${getExe cfg.package}";
Restart = "always";
PrivateTmp = true;
};
};

View file

@ -1,40 +1,73 @@
{ config, inputs, lib, withSystem, ... }:
{
perSystem = { config, pkgs, system, ... }:
let
config,
inputs,
lib,
withSystem,
...
}: {
perSystem = {
config,
pkgs,
system,
...
}: let
src = inputs.comfyui-src;
stable-pkgs = import inputs.nixpkgs-stable {
allowUnfree = true;
cudaSupport = true;
inherit system;
inherit overlays;
};
overlays = [
(
final: prev: {
final.python310 = prev.python310.override {
enableOptimizations = true;
reproducibleBuild = false;
self = final.python310;
buildInputs = [final.ffmpeg-full];
};
pythonPackagesExtensions =
prev.pythonPackagesExtensions
++ [
(
python-final: python-prev: {
torch = python-prev.torch.override {
rocmSupport = false;
cudaSupport = true;
};
}
)
];
}
)
];
mkComfyUIVariant = args: pkgs.python310Packages.callPackage ./package.nix ({
mkComfyUIVariant = args:
stable-pkgs.python310Packages.callPackage ./package.nix ({
inherit src;
} // args);
in
{
}
// args);
in {
packages = {
comfyui-nvidia = mkComfyUIVariant {};
};
};
#flake.nixosModules =
/* let
flake.nixosModules = let
packageModule = pkgAttrName: {pkgs, ...}: {
services.comfyui.package = withSystem pkgs.system (
{config, ...}: lib.mkOptionDefault config.packages.${pkgAttrName}
);
};
in
{
in {
comfyui = ./nixos;
comfyui-nvidia = {
imports = [
config.flake.nixosModules.a1111
config.flake.nixosModules.comfyui
(packageModule "comfyui-nvidia")
];
};
};*/
};
}

View file

@ -1,83 +1,63 @@
{ config, lib, ... }:
let
inherit (lib)
mkIf mkOption mkEnableOption mkRenamedOptionModule types
escapeShellArgs flatten getExe mapAttrsToList
isBool isFloat isInt isList isString
floatToString optionalString
{
config,
lib,
...
}: let
inherit
(lib)
mkIf
mkOption
mkEnableOption
mkRenamedOptionModule
types
escapeShellArgs
flatten
getExe
mapAttrsToList
isBool
isFloat
isInt
isList
isString
floatToString
optionalString
;
cfg = config.services.comfyui;
in
{
imports = map ({ old, new ? old }: mkRenamedOptionModule [ "services" "comfyui" old ] [ "services" "comfyui" "settings" new ]) [
in {
imports = map ({
old,
new ? old,
}:
mkRenamedOptionModule ["services" "comfyui" old] ["services" "comfyui" "settings" new]) [
{old = "host";}
{old = "port";}
{ old = "dataDir"; new = "root"; }
{
old = "dataDir";
new = "root";
}
{old = "precision";}
];
options.services.a1111 = {
enable = mkEnableOption "Automatic1111 UI for Stable Diffusion";
options.services.comfyui = {
enable = mkEnableOption "ComfyUI for Stable Diffusion";
package = mkOption {
description = "Which Automatic1111 package to use.";
description = "Which ComfyUI package to use.";
type = types.package;
};
user = mkOption {
description = "Which user to run A1111 as.";
default = "a1111";
description = "Which user to run ComfyUI as.";
default = "comfyui";
type = types.str;
};
group = mkOption {
description = "Which group to run A1111 as.";
default = "a1111";
description = "Which group to run ComfyUI as.";
default = "comfyui";
type = types.str;
};
settings = mkOption {
description = "Structured command line arguments.";
default = { };
type = types.submodule {
freeformType = with types; let
atom = nullOr (oneOf [
bool
str
int
float
]);
in attrsOf (either atom (listOf atom));
options = {
#listen = mkOption {
# description = "Launch gradio with 0.0.0.0 as server name, allowing to respond to network requests.";
# default = false;
# type = types.bool;
#};
port = mkOption {
description = "Launch gradio with given server port, you need root/admin rights for ports < 1024; defaults to 7860 if available.";
default = 7860;
type = types.port;
};
data-dir = mkOption {
description = "Where to store A1111's state.";
default = "/var/lib/a1111";
type = types.path;
};
ckpt-dir = mkOption {
description = "Path to A1111's SD models.";
default = "/var/lib/models/ckpt";
type = types.path;
};
};
};
};
extraArgs = mkOption {
description = "Additional raw command line arguments.";
default = [];
@ -86,26 +66,17 @@ in
};
config = let
cliArgs = (flatten (mapAttrsToList (n: v:
if v == null then []
#else if isBool v then [ "--${optionalString (!v) "no-"}${n}" ]
else if isInt v then [ "--${n}" "${toString v}" ]
else if isFloat v then [ "--${n}" "${floatToString v}" ]
else if isString v then ["--${n}" v ]
else if isList v then [ "--${n}" (toString v) ]
else throw "Unhandled type for setting \"${n}\""
) cfg.settings)) ++ cfg.extraArgs;
in mkIf cfg.enable {
users.users = mkIf (cfg.user == "a1111") {
a1111 = {
cliArgs = cfg.extraArgs;
in
mkIf cfg.enable {
users.users = mkIf (cfg.user == "comfyui") {
comfyui = {
isSystemUser = true;
inherit (cfg) group;
};
};
users.groups = mkIf (cfg.group == "a1111") {
a1111 = {};
users.groups = mkIf (cfg.group == "comfyui") {
comfyui = {};
};
systemd.services.a1111 = {
after = ["network.target"];

View file

@ -1,17 +1,16 @@
{ src
, buildPythonPackage
, torchvision-bin
, torch-bin
, safetensors
, psutil
, einops
, transformers
, scipy
, torchsde
, pillow
, torch
, torchvision
, accelerate
{
src,
buildPythonPackage,
safetensors,
psutil,
einops,
transformers,
scipy,
torchsde,
pillow,
torch,
torchvision,
accelerate,
}:
buildPythonPackage {
pname = "ComfyUI";
@ -31,15 +30,17 @@ buildPythonPackage {
torchsde
];
buildPhase =
''
buildPhase = ''
runHook preBuild
mkdir -p dist
cp -R . $out
chmod -R +w $out
cd $out
substituteInPlace ./folder_paths.py --replace 'os.path.join(base_path, "models")' '"/home/denis/comfyui/models"'
substituteInPlace ./folder_paths.py --replace 'os.path.join(os.path.dirname(os.path.realpath(__file__)), "temp")' '"/home/denis/comfyui/temp"'
substituteInPlace ./folder_paths.py --replace 'os.path.join(os.path.dirname(os.path.realpath(__file__)), "output")' '"/home/denis/comfyui/output"'
substituteInPlace ./folder_paths.py --replace 'os.path.join(os.path.dirname(os.path.realpath(__file__)), "input")' '"/home/denis/comfyui/input"'
#make main.py executable > shebang
mkdir -p $out/bin
cat <<-EOF > main.py
@ -60,11 +61,4 @@ buildPythonPackage {
homepage = "https://github.com/comfyanonymous/ComfyUI.git";
mainProgram = "main-wrapped.py";
};
#Tiled VAE supported without additional dependencies
#Infinit image browser couple of deps
#civit-ai browser + couple of deps
#animatediff --> needs deforum for frame interpolation
#deforum
#controlnet
}

View file

@ -1,12 +1,18 @@
{ config, inputs, lib, withSystem, ... }:
let
{
config,
inputs,
lib,
withSystem,
...
}: let
l = lib // config.flake.lib;
inherit (config.flake) overlays;
in
{
perSystem = { config, pkgs, ... }: let
in {
perSystem = {
config,
pkgs,
...
}: let
commonOverlays = [
overlays.python-fixPackages
(l.overlays.callManyPackages [
@ -44,13 +50,17 @@ in
../../packages/mediapipe
../../packages/python-engineio
])
(final: prev: lib.mapAttrs
(_: pkg: pkg.overrideAttrs (old: {
(
final: prev:
lib.mapAttrs
(_: pkg:
pkg.overrideAttrs (old: {
nativeBuildInputs = old.nativeBuildInputs ++ [final.pythonRelaxDepsHook];
pythonRemoveDeps = ["opencv-python-headless" "opencv-python" "tb-nightly" "clip"];
}))
{
inherit (prev)
inherit
(prev)
albumentations
qudida
gfpgan
@ -64,10 +74,12 @@ in
];
python3Variants = {
amd = l.overlays.applyOverlays pkgs.python3Packages (commonOverlays ++ [
amd = l.overlays.applyOverlays pkgs.python3Packages (commonOverlays
++ [
overlays.python-torchRocm
]);
nvidia = l.overlays.applyOverlays pkgs.python3Packages (commonOverlays ++ [
nvidia = l.overlays.applyOverlays pkgs.python3Packages (commonOverlays
++ [
overlays.python-torchCuda
]);
};

View file

@ -1,19 +1,17 @@
{ python3Packages
{
python3Packages,
# misc
, lib
, src
, pkgs
lib,
src,
pkgs,
# extra deps
}:
let
}: let
getVersion = lib.flip lib.pipe [
(src: builtins.readFile "${src}/invokeai/version/invokeai_version.py")
(builtins.match ".*__version__ = \"([^\"]+)\".*")
builtins.head
];
in
python3Packages.buildPythonPackage {
pname = "InvokeAI";
format = "pyproject";
@ -26,7 +24,7 @@ python3Packages.buildPythonPackage {
torchsde
uvicorn
pyperclip
invisible-watermark
#invisible-watermark
fastapi
fastapi-events
fastapi-socketio
@ -82,7 +80,7 @@ python3Packages.buildPythonPackage {
];
nativeBuildInputs = with python3Packages; [pythonRelaxDepsHook pip];
pythonRemoveDeps = ["clip" "pyreadline3" "flaskwebgui" "opencv-python" "fastapi-socketio"];
pythonRelaxDeps = [ "dnspython" "flask" "requests" "numpy" "pytorch-lightning" "torchsde" "uvicorn" "invisible-watermark" "accelerate" "scikit-image" "safetensors" "huggingface-hub" "torchvision" "test-tube" "fastapi" ];
pythonRelaxDeps = ["dnspython" "flask" "requests" "numpy" "pytorch-lightning" "torchsde" "uvicorn" "accelerate" "scikit-image" "safetensors" "huggingface-hub" "torchvision" "test-tube" "fastapi"];
makeWrapperArgs = [
'' --run '
if [ -d "/usr/lib/wsl/lib" ]