Compare commits

..

No commits in common. "587d28827e7e7c5c2626af9551e9d06998b04924" and "72565f7b2fb58a2422d4453e00db0e9292b335de" have entirely different histories.

3 changed files with 17 additions and 12 deletions

View File

@ -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 -s --noconfirm
RUN sudo -u build makepkg -is --noconfirm
RUN mv -v stable-diffusion-ui*.pkg.tar.zst /stable-diffusion-ui.pkg.tar.zst
# Stage 1
@ -16,9 +16,12 @@ 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 which
RUN pacman -Suy --noconfirm
COPY init /init
COPY config.yaml /config.yaml
CMD /init
RUN pacman -S --noconfirm which nvidia-utils
RUN useradd -m -s /usr/bin/bash -d /srv/stable-diffusion stable-diffusion
ENTRYPOINT /init

4
config.yaml Normal file → Executable file
View File

@ -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: true
open_browser_on_start: false
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: realism/photon_v1
stable-diffusion: lazyphoton-0.50000
vae: vae-ft-mse-840000-ema-pruned
vram_usage_level: low

16
init
View File

@ -5,13 +5,15 @@ cfg="/opt/stable-diffusion-ui/config.yaml"
if [[ -f "$pkg" ]]; then
pacman -U --noconfirm --overwrite '/opt/stable-diffusion-ui/*' "$pkg"
rm -vf "$pkg"
fi
if ! [[ -f "$cfg" ]]; then
mv /config.yaml "$cfg" || {
printf 'Failed to move the default config file to %s!\n' "$cfg"
}
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 /usr/bin/stable-diffusion-ui-server
exec su stable-diffusion -c '/usr/bin/stable-diffusion-ui-server'