Compare commits

...

11 Commits

Author SHA1 Message Date
fbt
253a8b7555 merge
Signed-off-by: fbt <fbt@fleshless.org>
2023-10-25 15:08:02 +00:00
fbt
0086e6c667 Don't need these
Signed-off-by: fbt <fbt@fleshless.org>
2023-10-25 15:07:21 +00:00
42377b6082 Update README.md 2023-10-25 13:11:23 +00:00
ee3b3a1efb Update README.md 2023-10-25 13:11:13 +00:00
e3e34f2784 Update README.md 2023-10-25 13:11:05 +00:00
fbt
102f719a47 Merge branch 'master' of ssh://code.fleshless.org:2290/fbt/stable-diffusion-ui-podman 2023-10-24 19:23:22 +00:00
fbt
114eaafb90 oh you do actually need this
Signed-off-by: fbt <fbt@fleshless.org>
2023-10-24 19:23:15 +00:00
83a79aae60 Update README.md 2023-10-24 19:11:22 +00:00
fbt
c9f5a6104e readme
Signed-off-by: fbt <fbt@fleshless.org>
2023-10-24 19:09:07 +00:00
fbt
587d28827e Merge branch 'master' of ssh://code.fleshless.org:2290/fbt/stable-diffusion-ui-podman 2023-10-24 18:53:13 +00:00
fbt
37df3b5430 Tweaks
Signed-off-by: fbt <fbt@fleshless.org>
2023-10-24 18:53:02 +00:00
4 changed files with 16 additions and 19 deletions

View File

@@ -8,7 +8,7 @@ RUN git clone https://aur.archlinux.org/stable-diffusion-ui.git /sdu
WORKDIR /sdu WORKDIR /sdu
RUN chown -R build:build /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 RUN mv -v stable-diffusion-ui*.pkg.tar.zst /stable-diffusion-ui.pkg.tar.zst
# Stage 1 # Stage 1
@@ -16,12 +16,9 @@ FROM archlinux:latest
COPY --from=0 /stable-diffusion-ui.pkg.tar.zst /stable-diffusion-ui.pkg.tar.zst COPY --from=0 /stable-diffusion-ui.pkg.tar.zst /stable-diffusion-ui.pkg.tar.zst
RUN pacman-key --init RUN pacman-key --init
RUN pacman -Suy --noconfirm RUN pacman -Suy --noconfirm which nvidia-utils
COPY init /init COPY init /init
COPY config.yaml /config.yaml COPY config.yaml /config.yaml
RUN pacman -S --noconfirm which nvidia-utils CMD /init
RUN useradd -m -s /usr/bin/bash -d /srv/stable-diffusion stable-diffusion
ENTRYPOINT /init

View File

@@ -2,6 +2,8 @@
This repo is an easy way to run Easy Diffusion in a podman container. I needed to put Easy Diffusion into a container for my own purposes, and publishing this wasn't a lot of effort; so here we are. This repo is an easy way to run Easy Diffusion in a podman container. I needed to put Easy Diffusion into a container for my own purposes, and publishing this wasn't a lot of effort; so here we are.
I highly recommend rootless podman, as otherwise running the container will result in the ui running as root in a privileged container.
~~This targets Nvidia and Arch, and nothing else, I'm old and lazy.~~ ~~This targets Nvidia and Arch, and nothing else, I'm old and lazy.~~
It should work on anything that has an Nvidia GPU, podman, and the nvidia container toolkit (with the nvidia devices setup hook). It should work on anything that has an Nvidia GPU, podman, and the nvidia container toolkit (with the nvidia devices setup hook).
@@ -15,10 +17,10 @@ Note that there's currently an issue with the AUR packages for Nvidia's containe
``` ```
# Build the image # Build the image
podman build --no-cache . -t 'stable-diffusion-ui-server' podman build . -t 'stable-diffusion-ui'
# Run the container # Run the container
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 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 localhost/stable-diffusion-ui
# Get to the interface # Get to the interface
browser http://localhost:9000 browser http://localhost:9000

4
config.yaml Executable file → Normal 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 # Set open_browser_on_start to false to disable opening a new browser tab on each restart
ui: ui:
open_browser_on_start: false open_browser_on_start: true
update_branch: main update_branch: main
# Set force_save_path to enforce an auto save path. Clients will not be able to change or # 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 use_v3_engine: true
models_dir: /opt/stable-diffusion-ui/models models_dir: /opt/stable-diffusion-ui/models
model: model:
stable-diffusion: lazyphoton-0.50000 stable-diffusion: realism/photon_v1
vae: vae-ft-mse-840000-ema-pruned vae: vae-ft-mse-840000-ema-pruned
vram_usage_level: low vram_usage_level: low

16
init
View File

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