Signed-off-by: fbt <fbt@fleshless.org>
This commit is contained in:
Jack L. Frost 2023-10-23 01:42:57 +00:00
commit 1a54b137c3
4 changed files with 71 additions and 0 deletions

14
Containerfile Normal file
View File

@ -0,0 +1,14 @@
# podman run -it -e NVIDIA_DRIVER_CAPABILITIES=compute,utility spark:latest bash
FROM archlinux:latest
RUN pacman-key --init
RUN pacman -Suy --noconfirm
COPY stable-diffusion-ui.pkg.tar.zst /stable-diffusion-ui.pkg.tar.zst
COPY init /init
COPY config.yaml /config.yaml
RUN pacman -S --noconfirm curl which nvidia-utils
RUN useradd -m -s /usr/bin/bash -d /srv/stable-diffusion stable-diffusion
ENTRYPOINT /init

11
README.md Normal file
View File

@ -0,0 +1,11 @@
# HOWTO
- Build stable-diffusion-ui from AUR, put it here as `stable-diffusion-ui.pkg.tar.zst`.
- Set up GPU access in docker/podman.
- Run the following:
```
podman build --no-cache . -t 'stable-diffusion-ui-server
podman run -it --device nvidia.com/gpu=all --security-opt=label=disable --name stable-diffusion-ui -p 9000:9000 -v ./data:/opt/stable-diffusion-ui -e NVIDIA_DRIVER_CAPABILITIES=compute,utility localhost/stable-diffusion-ui-server
browser http://localhost:9000
```

27
config.yaml Executable file
View File

@ -0,0 +1,27 @@
# Change listen_port if port 9000 is already in use on your system
# Set listen_to_network to true to make Easy Diffusion accessibble on your local network
net:
listen_port: 9000
listen_to_network: true
# Multi GPU setup
render_devices: auto
# Set open_browser_on_start to false to disable opening a new browser tab on each restart
ui:
open_browser_on_start: true
update_branch: main
# Set force_save_path to enforce an auto save path. Clients will not be able to change or
# disable auto save when this option is set. Please adapt the path in the examples to your
# needs.
# Windows:
# force_save_path: C:\\Easy Diffusion Images\\
# Linux:
# force_save_path: /data/easy-diffusion-images/
use_v3_engine: true
models_dir: /opt/stable-diffusion-ui/models
model:
stable-diffusion: lazyphoton-0.50000
vae: vae-ft-mse-840000-ema-pruned
vram_usage_level: low

19
init Executable file
View File

@ -0,0 +1,19 @@
#!/usr/bin/env bash
pkg="/stable-diffusion-ui.pkg.tar.zst"
cfg="/opt/stable-diffusion-ui/config.yaml"
if [[ -f "$pkg" ]]; then
pacman -U --noconfirm --overwrite '/opt/stable-diffusion-ui/*' "$pkg"
if ! [[ -f "$cfg" ]]; then
mv /config.yaml "$cfg" || {
printf 'Failed to move the default config file to %s!\n' "$cfg"
}
fi
chown -R stable-diffusion:stable-diffusion /opt/stable-diffusion-ui
rm -vf "$pkg"
fi
exec su stable-diffusion -c '/usr/bin/stable-diffusion-ui-server'