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
b3900949a8
commit
a2cebf3117
1 changed files with 13 additions and 37 deletions
|
@ -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";
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue