From 37df3b543047b89aacd6008e6184aa8798fd5399 Mon Sep 17 00:00:00 2001 From: fbt Date: Tue, 24 Oct 2023 18:53:02 +0000 Subject: [PATCH] Tweaks Signed-off-by: fbt --- Containerfile | 9 +++------ config.yaml | 4 ++-- init | 16 +++++++--------- 3 files changed, 12 insertions(+), 17 deletions(-) mode change 100755 => 100644 config.yaml diff --git a/Containerfile b/Containerfile index 9997173..d8793b5 100644 --- a/Containerfile +++ b/Containerfile @@ -8,7 +8,7 @@ RUN git clone https://aur.archlinux.org/stable-diffusion-ui.git /sdu WORKDIR /sdu RUN chown -R build:build /sdu -RUN sudo -u build makepkg -is --noconfirm +RUN sudo -u build makepkg -s --noconfirm RUN mv -v stable-diffusion-ui*.pkg.tar.zst /stable-diffusion-ui.pkg.tar.zst # Stage 1 @@ -16,12 +16,9 @@ FROM archlinux:latest COPY --from=0 /stable-diffusion-ui.pkg.tar.zst /stable-diffusion-ui.pkg.tar.zst RUN pacman-key --init -RUN pacman -Suy --noconfirm +RUN pacman -Suy --noconfirm which COPY init /init COPY config.yaml /config.yaml -RUN pacman -S --noconfirm which nvidia-utils -RUN useradd -m -s /usr/bin/bash -d /srv/stable-diffusion stable-diffusion - -ENTRYPOINT /init +CMD /init diff --git a/config.yaml b/config.yaml old mode 100755 new mode 100644 index df5fc98..85d15eb --- a/config.yaml +++ b/config.yaml @@ -9,7 +9,7 @@ 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: false + 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 @@ -22,6 +22,6 @@ update_branch: main use_v3_engine: true models_dir: /opt/stable-diffusion-ui/models model: - stable-diffusion: lazyphoton-0.50000 + stable-diffusion: realism/photon_v1 vae: vae-ft-mse-840000-ema-pruned vram_usage_level: low diff --git a/init b/init index d1cb239..8ac435d 100755 --- a/init +++ b/init @@ -5,15 +5,13 @@ 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 + +if ! [[ -f "$cfg" ]]; then + mv /config.yaml "$cfg" || { + printf 'Failed to move the default config file to %s!\n' "$cfg" + } fi -exec su stable-diffusion -c '/usr/bin/stable-diffusion-ui-server' +exec /usr/bin/stable-diffusion-ui-server