mirror of
https://gitlab.com/upRootNutrition/dotfiles.git
synced 2025-08-08 04:44:39 -05:00
feat: testing comfy
This commit is contained in:
parent
abc5f6dee4
commit
b3900949a8
1 changed files with 37 additions and 13 deletions
|
@ -68,21 +68,45 @@ in
|
||||||
allowedTCPPorts = [ cfg.port ];
|
allowedTCPPorts = [ cfg.port ];
|
||||||
};
|
};
|
||||||
|
|
||||||
systemd.services.comfyui = {
|
systemd.services.comfyui =
|
||||||
description = "ComfyUI Service";
|
let
|
||||||
wantedBy = [ "multi-user.target" ];
|
comfyui-wrapper = pkgs.writeShellScript "comfyui-wrapper" ''
|
||||||
after = [ "network.target" ];
|
# Let ComfyUI initialize its files first
|
||||||
|
cd /var/lib/comfyui
|
||||||
|
|
||||||
serviceConfig = {
|
# Start ComfyUI in background to initialize files
|
||||||
Type = "simple";
|
${cfg.package}/bin/comfyui --port ${toString cfg.port} --listen ${cfg.host} &
|
||||||
ExecStartPre = "${pkgs.coreutils}/bin/mkdir -p /var/lib/comfyui/custom_nodes";
|
COMFYUI_PID=$!
|
||||||
ExecStart = "${cfg.package}/bin/comfyui --port ${toString cfg.port} --listen ${cfg.host}";
|
|
||||||
Restart = "on-failure";
|
# Wait a moment for file initialization
|
||||||
User = "comfyui";
|
sleep 2
|
||||||
Group = "comfyui";
|
|
||||||
WorkingDirectory = "/var/lib/comfyui";
|
# 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 = {
|
users.users.comfyui = {
|
||||||
group = "comfyui";
|
group = "comfyui";
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue