1

Reenable stablediffusion container

This commit is contained in:
2023-05-25 22:54:57 +02:00
parent 7f21b51143
commit 5a29dc4fd8
4 changed files with 41 additions and 11 deletions

View File

@ -12,6 +12,7 @@
vols ? [],
env ? {},
opts ? [],
extraConfig ? {},
netns ? "",
netdns ? "",
}: let
@ -24,7 +25,8 @@
++ (lib.optionals (netdns != "") [
"--dns=${netdns}"
]);
in {
in
lib.mergeAttrs extraConfig {
image = image;
autoStart = autoStart;
ports = ports ++ expanded-id-ports;

View File

@ -25,6 +25,30 @@ in {
];
});
# Development
# NOTE: PyTorch ROCM image is 36 GB large...
# NOTE: This requires to setup the PodmanROCM direcory beforehand, as described here:
# https://github.com/AUTOMATIC1111/stable-diffusion-webui/wiki/Install-and-Run-on-AMD-GPUs#running-inside-docker
# NOTE: This requires to manually link the launch.sh, since this is a system module (can't use home.file)
stablediffusion = mkIf cfg.stablediffusion.enable (mkOciContainer {
image = "rocm/pytorch:rocm5.5_ubuntu20.04_py3.8_pytorch_1.13.1";
vols = [
"/home/christoph/NoSync/StableDiffusionWebUI:/webui-data"
];
opts = [
"--network=host"
"--device=/dev/kfd"
"--device=/dev/dri"
"--group-add=video"
"--ipc=host"
"--cap-add=SYS_PTRACE"
"--security-opt=seccomp=unconfined"
];
extraConfig = {
entrypoint = "/webui-data/launch.sh";
};
});
# Multimedia
jellyfin = mkIf cfg.jellyfin.enable (mkOciContainer {
image = "linuxserver/jellyfin:10.8.10";

View File

@ -14,6 +14,9 @@ with mylib.modules; {
homeassistant = {
enable = mkEnableOpt "Enable HomeAssistant Container";
};
stablediffusion = {
enable = mkEnableOpt "Enable StableDiffusion Container with Automatic1111 WebUI";
};
jellyfin = {
enable = mkEnableOpt "Enable Jellyfin Container";
};

View File

@ -19,6 +19,7 @@
enable = true;
homeassistant.enable = false;
stablediffusion.enable = true;
jellyfin.enable = true;
fileflows.enable = false;
sonarr.enable = true;