feat(web-apps): add comfy-ui web app, update stable-diffusion-webui

This commit is contained in:
Mohammad Rafiq 2025-07-05 01:50:15 +08:00
parent 4dca26d81d
commit d082b03bf1
No known key found for this signature in database
4 changed files with 42 additions and 6 deletions

11
flake.lock generated
View file

@ -944,15 +944,16 @@
"python-flexseal": "python-flexseal"
},
"locked": {
"lastModified": 1750702421,
"narHash": "sha256-YqcUdBULlDDbRPo6bKM6GbmjnvKM++Sq+U2sgKY8/wc=",
"owner": "janrupf",
"lastModified": 1751651278,
"narHash": "sha256-RFP58g7aWQE9LW+Av0ljtOuuvwThICBikAx+l+cYL+4=",
"owner": "rrvsh",
"repo": "stable-diffusion-webui-nix",
"rev": "144487fbf9757f157833d0272d226d69e5bb3741",
"rev": "e7d156aef717cdeb1a98c7fe77cbd76c6e437c05",
"type": "github"
},
"original": {
"owner": "janrupf",
"owner": "rrvsh",
"ref": "fix/comfy-ui-data-directory",
"repo": "stable-diffusion-webui-nix",
"type": "github"
}

View file

@ -37,7 +37,7 @@
# Packages and services that we don't use nixpkgs for.
rrv-sh.url = "github:rrvsh/rrv.sh";
nvf.url = "github:rrvsh/nvf/uv-nvim";
stable-diffusion-webui-nix.url = "github:janrupf/stable-diffusion-webui-nix";
stable-diffusion-webui-nix.url = "github:rrvsh/stable-diffusion-webui-nix/fix/comfy-ui-data-directory";
zjstatus.url = "github:dj95/zjstatus";
};
}

View file

@ -0,0 +1,34 @@
{
config,
lib,
inputs,
...
}:
let
inherit (lib) singleton;
inherit (lib.pantheon.modules) mkWebApp;
upstreamCfg = config.services.comfyUi;
in
mkWebApp {
inherit config;
name = "comfy-ui";
defaultPort = 8188;
persistDirs = singleton {
directory = upstreamCfg.dataDir;
inherit (upstreamCfg) user group;
mode = "777";
};
extraConfig = {
assertions = singleton {
assertion = config.machine.gpu.nvidia.enable;
message = "You must run the comfy-ui service only with an nvidia gpu.";
};
services.comfyUi = {
enable = true;
listenHost = "0.0.0.0";
};
};
}
// {
imports = [ inputs.stable-diffusion-webui-nix.nixosModules.default ];
}

View file

@ -36,4 +36,5 @@
};
server.web-apps.sd-webui-forge.enable = true;
server.web-apps.comfy-ui.enable = true;
}