mirror of
https://gitlab.com/upRootNutrition/dotfiles.git
synced 2025-08-08 12:54:38 -05:00
feat: added comfy ui
This commit is contained in:
parent
02eb4737b9
commit
758f235736
3 changed files with 102 additions and 49 deletions
|
@ -121,6 +121,7 @@
|
||||||
ceres = inputs.self.lib.mkLinuxSystem [
|
ceres = inputs.self.lib.mkLinuxSystem [
|
||||||
./systems/ceres
|
./systems/ceres
|
||||||
./profiles/user0
|
./profiles/user0
|
||||||
|
./services/comfyui
|
||||||
config.nixosModules.ceres
|
config.nixosModules.ceres
|
||||||
config.nixosModules.core
|
config.nixosModules.core
|
||||||
config.nixosModules.mantle
|
config.nixosModules.mantle
|
||||||
|
|
|
@ -1,55 +1,19 @@
|
||||||
|
{ config, pkgs, ... }:
|
||||||
{
|
{
|
||||||
config,
|
|
||||||
pkgs,
|
|
||||||
flake,
|
|
||||||
...
|
|
||||||
}:
|
|
||||||
let
|
|
||||||
inherit (flake.config.machines.devices) ceres;
|
|
||||||
inherit (flake.config.services.instances) comfyui web;
|
|
||||||
inherit (flake.config.people) user0;
|
|
||||||
service = comfyui;
|
|
||||||
localhost = web.localhost.address1;
|
|
||||||
in
|
|
||||||
{
|
|
||||||
|
|
||||||
services.comfyui = {
|
services.comfyui = {
|
||||||
enable = true;
|
enable = true;
|
||||||
# package = pkgs.comfyui-nvidia;
|
openFirewall = true;
|
||||||
host = localhost;
|
host = "0.0.0.0"; # Allow external connections
|
||||||
user = service.name;
|
package = pkgs.comfyuiPackages.comfyui.override {
|
||||||
acceleration = "cuda";
|
extensions = with pkgs.comfyuiPackages.extensions; [
|
||||||
# models = builtins.attrValues {
|
acly-inpaint
|
||||||
# inherit (pkgs.nixified-ai)
|
acly-tooling
|
||||||
# models
|
cubiq-ipadapter-plus
|
||||||
# ;
|
fannovel16-controlnet-aux
|
||||||
# };
|
];
|
||||||
# customNodes = builtins.attrValues {
|
commandLineArgs = [
|
||||||
# inherit (comfyui.pkgs)
|
"--preview-method"
|
||||||
# comfyui-gguf
|
"auto"
|
||||||
# comfyui-impact-pack
|
|
||||||
# ;
|
|
||||||
# };
|
|
||||||
};
|
|
||||||
fileSystems."/var/lib/${service.name}" = {
|
|
||||||
device = service.paths.path0;
|
|
||||||
fsType = "none";
|
|
||||||
options = [
|
|
||||||
"bind"
|
|
||||||
];
|
|
||||||
depends = [
|
|
||||||
ceres.storage0.mount
|
|
||||||
];
|
|
||||||
};
|
|
||||||
|
|
||||||
systemd.tmpfiles.rules = [
|
|
||||||
"Z ${service.paths.path0} 755 ${service.name} ${service.name} -"
|
|
||||||
];
|
|
||||||
|
|
||||||
networking = {
|
|
||||||
firewall = {
|
|
||||||
allowedTCPPorts = [
|
|
||||||
service.ports.port0
|
|
||||||
];
|
];
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
88
services/comfyui/default.nix
Normal file
88
services/comfyui/default.nix
Normal file
|
@ -0,0 +1,88 @@
|
||||||
|
{
|
||||||
|
config,
|
||||||
|
lib,
|
||||||
|
pkgs,
|
||||||
|
...
|
||||||
|
}:
|
||||||
|
|
||||||
|
let
|
||||||
|
cfg = config.services.comfyui;
|
||||||
|
in
|
||||||
|
{
|
||||||
|
imports = [ ];
|
||||||
|
|
||||||
|
options = {
|
||||||
|
services.comfyui = with lib; {
|
||||||
|
enable = mkEnableOption "ComfyUI service";
|
||||||
|
|
||||||
|
package = mkOption {
|
||||||
|
type = types.package;
|
||||||
|
default = pkgs.comfyuiPackages.comfyui.override {
|
||||||
|
extensions = with pkgs.comfyuiPackages.extensions; [
|
||||||
|
# Add desired extensions here
|
||||||
|
# Example extensions:
|
||||||
|
# acly-inpaint
|
||||||
|
# acly-tooling
|
||||||
|
# cubiq-ipadapter-plus
|
||||||
|
# fannovel16-controlnet-aux
|
||||||
|
];
|
||||||
|
commandLineArgs = [
|
||||||
|
"--preview-method"
|
||||||
|
"auto"
|
||||||
|
];
|
||||||
|
};
|
||||||
|
description = "The ComfyUI package to use";
|
||||||
|
};
|
||||||
|
|
||||||
|
port = mkOption {
|
||||||
|
type = types.port;
|
||||||
|
default = 8188;
|
||||||
|
description = "Port to listen on";
|
||||||
|
};
|
||||||
|
|
||||||
|
host = mkOption {
|
||||||
|
type = types.str;
|
||||||
|
default = "127.0.0.1";
|
||||||
|
description = "Host to bind to";
|
||||||
|
};
|
||||||
|
|
||||||
|
openFirewall = mkOption {
|
||||||
|
type = types.bool;
|
||||||
|
default = false;
|
||||||
|
description = "Open ports in the firewall";
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
config = lib.mkIf cfg.enable {
|
||||||
|
environment.systemPackages = [ cfg.package ];
|
||||||
|
|
||||||
|
networking.firewall = lib.mkIf cfg.openFirewall {
|
||||||
|
allowedTCPPorts = [ cfg.port ];
|
||||||
|
};
|
||||||
|
|
||||||
|
systemd.services.comfyui = {
|
||||||
|
description = "ComfyUI Service";
|
||||||
|
wantedBy = [ "multi-user.target" ];
|
||||||
|
after = [ "network.target" ];
|
||||||
|
|
||||||
|
serviceConfig = {
|
||||||
|
Type = "simple";
|
||||||
|
ExecStart = "${cfg.package}/bin/comfyui --port ${toString cfg.port} --listen ${cfg.host}";
|
||||||
|
Restart = "on-failure";
|
||||||
|
User = "comfyui";
|
||||||
|
Group = "comfyui";
|
||||||
|
WorkingDirectory = "/var/lib/comfyui";
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
users.users.comfyui = {
|
||||||
|
group = "comfyui";
|
||||||
|
isSystemUser = true;
|
||||||
|
home = "/var/lib/comfyui";
|
||||||
|
createHome = true;
|
||||||
|
};
|
||||||
|
|
||||||
|
users.groups.comfyui = { };
|
||||||
|
};
|
||||||
|
}
|
Loading…
Add table
Add a link
Reference in a new issue