From 2a246f0c2629f7be8f0f9a22eabea0e981985080 Mon Sep 17 00:00:00 2001 From: Nick Date: Sun, 3 Aug 2025 21:31:58 -0500 Subject: [PATCH 01/13] feat: testing comfy --- modules/nixos/services/comfyui/default.nix | 33 +++++++++++++--------- systems/ceres/config/comfyui.nix | 30 ++++++++++---------- 2 files changed, 34 insertions(+), 29 deletions(-) diff --git a/modules/nixos/services/comfyui/default.nix b/modules/nixos/services/comfyui/default.nix index 90cb702..41184c9 100755 --- a/modules/nixos/services/comfyui/default.nix +++ b/modules/nixos/services/comfyui/default.nix @@ -19,22 +19,27 @@ in 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" - ]; - }; + default = pkgs.comfyuiPackages.comfyui; description = "The ComfyUI package to use"; }; + # 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; diff --git a/systems/ceres/config/comfyui.nix b/systems/ceres/config/comfyui.nix index 4a8a209..db71319 100755 --- a/systems/ceres/config/comfyui.nix +++ b/systems/ceres/config/comfyui.nix @@ -22,21 +22,21 @@ in enable = true; openFirewall = true; host = localhost; - package = pkgs.comfyuiPackages.comfyui.override { - extensions = with pkgs.comfyuiPackages.extensions; [ - acly-inpaint - acly-tooling - kosinkadink-advanced-controlnet - kosinkadink-animatediff-evolved - kosinkadink-video-helper-suite - lev145-images-grid - ssitu-ultimate-sd-upscale - ]; - commandLineArgs = [ - "--preview-method" - "auto" - ]; - }; + # package = pkgs.comfyuiPackages.comfyui.override { + # extensions = with pkgs.comfyuiPackages.extensions; [ + # acly-inpaint + # acly-tooling + # kosinkadink-advanced-controlnet + # kosinkadink-animatediff-evolved + # kosinkadink-video-helper-suite + # lev145-images-grid + # ssitu-ultimate-sd-upscale + # ]; + # commandLineArgs = [ + # "--preview-method" + # "auto" + # ]; + # }; }; caddy = { virtualHosts = { From 87642b8d0205f577ea7d8316efdfef3a3df30a8e Mon Sep 17 00:00:00 2001 From: Nick Date: Sun, 3 Aug 2025 21:40:43 -0500 Subject: [PATCH 02/13] feat: testing comfy --- systems/ceres/config/comfyui.nix | 1 + 1 file changed, 1 insertion(+) diff --git a/systems/ceres/config/comfyui.nix b/systems/ceres/config/comfyui.nix index db71319..9e2534c 100755 --- a/systems/ceres/config/comfyui.nix +++ b/systems/ceres/config/comfyui.nix @@ -66,6 +66,7 @@ in ]; }; systemd.tmpfiles.rules = [ + "d /var/lib/${service.name}/custom_nodes 755 ${service.name} ${service.name} -" "Z ${service.paths.path0}/models 755 root root -" "Z ${service.sops.path0} 755 caddy caddy -" ]; From 5e9eebe0c0446ea52f89d7ef6b1564a3fc5fbb48 Mon Sep 17 00:00:00 2001 From: Nick Date: Sun, 3 Aug 2025 21:44:31 -0500 Subject: [PATCH 03/13] feat: testing comfy --- modules/nixos/services/comfyui/default.nix | 1 + 1 file changed, 1 insertion(+) diff --git a/modules/nixos/services/comfyui/default.nix b/modules/nixos/services/comfyui/default.nix index 41184c9..a0dd027 100755 --- a/modules/nixos/services/comfyui/default.nix +++ b/modules/nixos/services/comfyui/default.nix @@ -75,6 +75,7 @@ in serviceConfig = { Type = "simple"; + ExecStartPre = "${pkgs.coreutils}/bin/mkdir -p /var/lib/comfyui/custom_nodes"; ExecStart = "${cfg.package}/bin/comfyui --port ${toString cfg.port} --listen ${cfg.host}"; Restart = "on-failure"; User = "comfyui"; From 34d98ee5e41d4c3902be768e7848e4c178ce0287 Mon Sep 17 00:00:00 2001 From: Nick Date: Sun, 3 Aug 2025 21:46:53 -0500 Subject: [PATCH 04/13] feat: testing comfy --- modules/nixos/services/comfyui/default.nix | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/modules/nixos/services/comfyui/default.nix b/modules/nixos/services/comfyui/default.nix index a0dd027..875c861 100755 --- a/modules/nixos/services/comfyui/default.nix +++ b/modules/nixos/services/comfyui/default.nix @@ -75,7 +75,10 @@ in serviceConfig = { Type = "simple"; - ExecStartPre = "${pkgs.coreutils}/bin/mkdir -p /var/lib/comfyui/custom_nodes"; + ExecStartPre = [ + "${pkgs.coreutils}/bin/mkdir -p /var/lib/comfyui/custom_nodes" + "${pkgs.coreutils}/bin/chown comfyui:comfyui /var/lib/comfyui/custom_nodes" + ]; ExecStart = "${cfg.package}/bin/comfyui --port ${toString cfg.port} --listen ${cfg.host}"; Restart = "on-failure"; User = "comfyui"; From 4db9fd2c39ff228d22ecd82b88e1ea1acfbe7df5 Mon Sep 17 00:00:00 2001 From: Nick Date: Sun, 3 Aug 2025 21:50:19 -0500 Subject: [PATCH 05/13] feat: testing comfy --- systems/ceres/config/comfyui.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/systems/ceres/config/comfyui.nix b/systems/ceres/config/comfyui.nix index 9e2534c..08f4cf4 100755 --- a/systems/ceres/config/comfyui.nix +++ b/systems/ceres/config/comfyui.nix @@ -66,7 +66,7 @@ in ]; }; systemd.tmpfiles.rules = [ - "d /var/lib/${service.name}/custom_nodes 755 ${service.name} ${service.name} -" + # "d /var/lib/${service.name}/custom_nodes 755 ${service.name} ${service.name} -" "Z ${service.paths.path0}/models 755 root root -" "Z ${service.sops.path0} 755 caddy caddy -" ]; From abc5f6dee4e602739f20d8984a48e21c17fee98a Mon Sep 17 00:00:00 2001 From: Nick Date: Sun, 3 Aug 2025 22:04:43 -0500 Subject: [PATCH 06/13] feat: testing comfy --- modules/nixos/services/comfyui/default.nix | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/modules/nixos/services/comfyui/default.nix b/modules/nixos/services/comfyui/default.nix index 875c861..a0dd027 100755 --- a/modules/nixos/services/comfyui/default.nix +++ b/modules/nixos/services/comfyui/default.nix @@ -75,10 +75,7 @@ in serviceConfig = { Type = "simple"; - ExecStartPre = [ - "${pkgs.coreutils}/bin/mkdir -p /var/lib/comfyui/custom_nodes" - "${pkgs.coreutils}/bin/chown comfyui:comfyui /var/lib/comfyui/custom_nodes" - ]; + ExecStartPre = "${pkgs.coreutils}/bin/mkdir -p /var/lib/comfyui/custom_nodes"; ExecStart = "${cfg.package}/bin/comfyui --port ${toString cfg.port} --listen ${cfg.host}"; Restart = "on-failure"; User = "comfyui"; From b3900949a8afb7bb33b4a8db8d449324914fffba Mon Sep 17 00:00:00 2001 From: Nick Date: Sun, 3 Aug 2025 22:17:03 -0500 Subject: [PATCH 07/13] feat: testing comfy --- modules/nixos/services/comfyui/default.nix | 50 ++++++++++++++++------ 1 file changed, 37 insertions(+), 13 deletions(-) diff --git a/modules/nixos/services/comfyui/default.nix b/modules/nixos/services/comfyui/default.nix index a0dd027..77b973f 100755 --- a/modules/nixos/services/comfyui/default.nix +++ b/modules/nixos/services/comfyui/default.nix @@ -68,21 +68,45 @@ in allowedTCPPorts = [ cfg.port ]; }; - systemd.services.comfyui = { - description = "ComfyUI Service"; - wantedBy = [ "multi-user.target" ]; - after = [ "network.target" ]; + systemd.services.comfyui = + let + comfyui-wrapper = pkgs.writeShellScript "comfyui-wrapper" '' + # Let ComfyUI initialize its files first + cd /var/lib/comfyui - serviceConfig = { - Type = "simple"; - ExecStartPre = "${pkgs.coreutils}/bin/mkdir -p /var/lib/comfyui/custom_nodes"; - ExecStart = "${cfg.package}/bin/comfyui --port ${toString cfg.port} --listen ${cfg.host}"; - Restart = "on-failure"; - User = "comfyui"; - Group = "comfyui"; - WorkingDirectory = "/var/lib/comfyui"; + # Start ComfyUI in background to initialize files + ${cfg.package}/bin/comfyui --port ${toString cfg.port} --listen ${cfg.host} & + COMFYUI_PID=$! + + # Wait a moment for file initialization + sleep 2 + + # Kill the initialization process + kill $COMFYUI_PID 2>/dev/null || true + wait $COMFYUI_PID 2>/dev/null || true + + # Now recreate the custom_nodes directory + mkdir -p /var/lib/comfyui/custom_nodes + + # Start ComfyUI properly + exec ${cfg.package}/bin/comfyui --port ${toString cfg.port} --listen ${cfg.host} + ''; + in + { + description = "ComfyUI Service"; + wantedBy = [ "multi-user.target" ]; + after = [ "network.target" ]; + + serviceConfig = { + Type = "simple"; + ExecStartPre = "${pkgs.coreutils}/bin/mkdir -p /var/lib/comfyui/custom_nodes"; + ExecStart = "${comfyui-wrapper}"; + Restart = "on-failure"; + User = "comfyui"; + Group = "comfyui"; + WorkingDirectory = "/var/lib/comfyui"; + }; }; - }; users.users.comfyui = { group = "comfyui"; From a2cebf3117d43e22987ce669fb40440261f04ab2 Mon Sep 17 00:00:00 2001 From: Nick Date: Sun, 3 Aug 2025 22:19:54 -0500 Subject: [PATCH 08/13] feat: testing comfy --- modules/nixos/services/comfyui/default.nix | 50 ++++++---------------- 1 file changed, 13 insertions(+), 37 deletions(-) diff --git a/modules/nixos/services/comfyui/default.nix b/modules/nixos/services/comfyui/default.nix index 77b973f..04d4794 100755 --- a/modules/nixos/services/comfyui/default.nix +++ b/modules/nixos/services/comfyui/default.nix @@ -68,45 +68,21 @@ in allowedTCPPorts = [ cfg.port ]; }; - systemd.services.comfyui = - let - comfyui-wrapper = pkgs.writeShellScript "comfyui-wrapper" '' - # Let ComfyUI initialize its files first - cd /var/lib/comfyui + systemd.services.comfyui = { + description = "ComfyUI Service"; + wantedBy = [ "multi-user.target" ]; + after = [ "network.target" ]; - # Start ComfyUI in background to initialize files - ${cfg.package}/bin/comfyui --port ${toString cfg.port} --listen ${cfg.host} & - COMFYUI_PID=$! - - # Wait a moment for file initialization - sleep 2 - - # Kill the initialization process - kill $COMFYUI_PID 2>/dev/null || true - wait $COMFYUI_PID 2>/dev/null || true - - # Now recreate the custom_nodes directory - mkdir -p /var/lib/comfyui/custom_nodes - - # Start ComfyUI properly - exec ${cfg.package}/bin/comfyui --port ${toString cfg.port} --listen ${cfg.host} - ''; - in - { - description = "ComfyUI Service"; - wantedBy = [ "multi-user.target" ]; - after = [ "network.target" ]; - - serviceConfig = { - Type = "simple"; - ExecStartPre = "${pkgs.coreutils}/bin/mkdir -p /var/lib/comfyui/custom_nodes"; - ExecStart = "${comfyui-wrapper}"; - Restart = "on-failure"; - User = "comfyui"; - Group = "comfyui"; - WorkingDirectory = "/var/lib/comfyui"; - }; + serviceConfig = { + Type = "simple"; + ExecStart = "${cfg.package}/bin/comfyui --port ${toString cfg.port} --listen ${cfg.host}"; + ExecStartPost = "${pkgs.bash}/bin/bash -c 'sleep 5 && mkdir -p /var/lib/comfyui/custom_nodes'"; + Restart = "on-failure"; + User = "comfyui"; + Group = "comfyui"; + WorkingDirectory = "/var/lib/comfyui"; }; + }; users.users.comfyui = { group = "comfyui"; From f7b42554d8f0d49bf0463546659c3402edd971a8 Mon Sep 17 00:00:00 2001 From: Nick Date: Sun, 3 Aug 2025 22:22:18 -0500 Subject: [PATCH 09/13] feat: testing comfy --- modules/nixos/services/comfyui/default.nix | 34 +++++++++------------- systems/ceres/config/comfyui.nix | 31 ++++++++++---------- 2 files changed, 29 insertions(+), 36 deletions(-) diff --git a/modules/nixos/services/comfyui/default.nix b/modules/nixos/services/comfyui/default.nix index 04d4794..90cb702 100755 --- a/modules/nixos/services/comfyui/default.nix +++ b/modules/nixos/services/comfyui/default.nix @@ -19,27 +19,22 @@ in package = mkOption { type = types.package; - default = pkgs.comfyuiPackages.comfyui; + 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"; }; - # 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; @@ -76,7 +71,6 @@ in serviceConfig = { Type = "simple"; ExecStart = "${cfg.package}/bin/comfyui --port ${toString cfg.port} --listen ${cfg.host}"; - ExecStartPost = "${pkgs.bash}/bin/bash -c 'sleep 5 && mkdir -p /var/lib/comfyui/custom_nodes'"; Restart = "on-failure"; User = "comfyui"; Group = "comfyui"; diff --git a/systems/ceres/config/comfyui.nix b/systems/ceres/config/comfyui.nix index 08f4cf4..4a8a209 100755 --- a/systems/ceres/config/comfyui.nix +++ b/systems/ceres/config/comfyui.nix @@ -22,21 +22,21 @@ in enable = true; openFirewall = true; host = localhost; - # package = pkgs.comfyuiPackages.comfyui.override { - # extensions = with pkgs.comfyuiPackages.extensions; [ - # acly-inpaint - # acly-tooling - # kosinkadink-advanced-controlnet - # kosinkadink-animatediff-evolved - # kosinkadink-video-helper-suite - # lev145-images-grid - # ssitu-ultimate-sd-upscale - # ]; - # commandLineArgs = [ - # "--preview-method" - # "auto" - # ]; - # }; + package = pkgs.comfyuiPackages.comfyui.override { + extensions = with pkgs.comfyuiPackages.extensions; [ + acly-inpaint + acly-tooling + kosinkadink-advanced-controlnet + kosinkadink-animatediff-evolved + kosinkadink-video-helper-suite + lev145-images-grid + ssitu-ultimate-sd-upscale + ]; + commandLineArgs = [ + "--preview-method" + "auto" + ]; + }; }; caddy = { virtualHosts = { @@ -66,7 +66,6 @@ in ]; }; systemd.tmpfiles.rules = [ - # "d /var/lib/${service.name}/custom_nodes 755 ${service.name} ${service.name} -" "Z ${service.paths.path0}/models 755 root root -" "Z ${service.sops.path0} 755 caddy caddy -" ]; From 9123195656eaad33f57154d9da0b67e10adc54b3 Mon Sep 17 00:00:00 2001 From: Nick Date: Sun, 3 Aug 2025 22:28:56 -0500 Subject: [PATCH 10/13] feat: testing comfy --- systems/ceres/config/comfyui.nix | 10 +--------- 1 file changed, 1 insertion(+), 9 deletions(-) diff --git a/systems/ceres/config/comfyui.nix b/systems/ceres/config/comfyui.nix index 4a8a209..ee63461 100755 --- a/systems/ceres/config/comfyui.nix +++ b/systems/ceres/config/comfyui.nix @@ -23,15 +23,7 @@ in openFirewall = true; host = localhost; package = pkgs.comfyuiPackages.comfyui.override { - extensions = with pkgs.comfyuiPackages.extensions; [ - acly-inpaint - acly-tooling - kosinkadink-advanced-controlnet - kosinkadink-animatediff-evolved - kosinkadink-video-helper-suite - lev145-images-grid - ssitu-ultimate-sd-upscale - ]; + stateDirs = [ "custom_nodes" ]; commandLineArgs = [ "--preview-method" "auto" From e602ffe3cc40ba29694feba6096e08bd06121b29 Mon Sep 17 00:00:00 2001 From: Nick Date: Sun, 3 Aug 2025 22:34:25 -0500 Subject: [PATCH 11/13] feat: testing comfy --- modules/nixos/services/comfyui/default.nix | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/modules/nixos/services/comfyui/default.nix b/modules/nixos/services/comfyui/default.nix index 90cb702..0093e24 100755 --- a/modules/nixos/services/comfyui/default.nix +++ b/modules/nixos/services/comfyui/default.nix @@ -20,14 +20,14 @@ in 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 - ]; + # 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" From e957c7e8e19df817080517eb5db83cd2a3f1cc6d Mon Sep 17 00:00:00 2001 From: Nick Date: Sun, 3 Aug 2025 23:34:09 -0500 Subject: [PATCH 12/13] feat: testing comfy --- modules/nixos/services/comfyui/default.nix | 16 ++++++++-------- systems/ceres/config/comfyui.nix | 8 +++++++- 2 files changed, 15 insertions(+), 9 deletions(-) diff --git a/modules/nixos/services/comfyui/default.nix b/modules/nixos/services/comfyui/default.nix index 0093e24..90cb702 100755 --- a/modules/nixos/services/comfyui/default.nix +++ b/modules/nixos/services/comfyui/default.nix @@ -20,14 +20,14 @@ in 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 - # ]; + 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" diff --git a/systems/ceres/config/comfyui.nix b/systems/ceres/config/comfyui.nix index ee63461..89da639 100755 --- a/systems/ceres/config/comfyui.nix +++ b/systems/ceres/config/comfyui.nix @@ -23,7 +23,13 @@ in openFirewall = true; host = localhost; package = pkgs.comfyuiPackages.comfyui.override { - stateDirs = [ "custom_nodes" ]; + stateDirs = [ + "custom_nodes" + ]; + + extensions = [ + ]; + commandLineArgs = [ "--preview-method" "auto" From bcd85c05e77e1e7c3c0e016b3570082ba6ec9722 Mon Sep 17 00:00:00 2001 From: Nick Date: Sun, 3 Aug 2025 23:44:38 -0500 Subject: [PATCH 13/13] feat: testing comfy --- systems/ceres/config/comfyui.nix | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/systems/ceres/config/comfyui.nix b/systems/ceres/config/comfyui.nix index 89da639..4a8a209 100755 --- a/systems/ceres/config/comfyui.nix +++ b/systems/ceres/config/comfyui.nix @@ -23,13 +23,15 @@ in openFirewall = true; host = localhost; package = pkgs.comfyuiPackages.comfyui.override { - stateDirs = [ - "custom_nodes" + extensions = with pkgs.comfyuiPackages.extensions; [ + acly-inpaint + acly-tooling + kosinkadink-advanced-controlnet + kosinkadink-animatediff-evolved + kosinkadink-video-helper-suite + lev145-images-grid + ssitu-ultimate-sd-upscale ]; - - extensions = [ - ]; - commandLineArgs = [ "--preview-method" "auto"