Skip to content

Commit

Permalink
stable-diffusion-webui: integrate with open webui
Browse files Browse the repository at this point in the history
  • Loading branch information
xddxdd committed Nov 26, 2024
1 parent ee2c075 commit 6bb45db
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 3 deletions.
6 changes: 6 additions & 0 deletions nixos/optional-apps/open-webui.nix
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,12 @@
OAUTH_ROLES_CLAIM = "groups";
OPENID_PROVIDER_URL = "https://login.lantian.pub/.well-known/openid-configuration";

ENABLE_IMAGE_GENERATION = "true";
IMAGE_GENERATION_ENGINE = "automatic1111";
AUTOMATIC1111_BASE_URL = "https://stable-diffusion.xuyh0120.win";
IMAGE_SIZE = "512x512";
IMAGE_STEPS = "20";

ENABLE_RAG_WEB_SEARCH = "true";
ENABLE_SEARCH_QUERY = "true";
RAG_WEB_SEARCH_ENGINE = "brave";
Expand Down
11 changes: 8 additions & 3 deletions nixos/optional-apps/stable-diffusion-webui.nix
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
{
LT,
pkgs,
...
}:
let
Expand All @@ -16,6 +17,10 @@ let
"venv"
"repositories"
];

webui-user-sh = pkgs.writeShellScript "webui-user.sh" ''
export COMMANDLINE_ARGS="--api --disable-console-progressbars --xformers --no-half-vae"
'';
in
{
virtualisation.oci-containers.containers.stable-diffusion = {
Expand All @@ -27,9 +32,9 @@ in
];
image = "universonic/stable-diffusion-webui";
ports = [ "127.0.0.1:${LT.portStr.StableDiffusionWebUI}:8080" ];
volumes = builtins.map (
f: "/var/lib/stable-diffusion/${f}:/app/stable-diffusion-webui/${f}"
) subfolders;
volumes = [
"${webui-user-sh}:/app/stable-diffusion-webui/webui-user.sh:ro"
] ++ builtins.map (f: "/var/lib/stable-diffusion/${f}:/app/stable-diffusion-webui/${f}") subfolders;
};

# Container uses UID/GID 1000
Expand Down

0 comments on commit 6bb45db

Please sign in to comment.