Compare commits
15 Commits
ef75dd32ab
...
master
Author | SHA1 | Date | |
---|---|---|---|
253a8b7555 | |||
0086e6c667 | |||
42377b6082 | |||
ee3b3a1efb | |||
e3e34f2784 | |||
102f719a47 | |||
114eaafb90 | |||
83a79aae60 | |||
c9f5a6104e | |||
587d28827e | |||
37df3b5430 | |||
72565f7b2f | |||
f738ec2282 | |||
6d7b63e174 | |||
f68a4c08ae |
@@ -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 nvidia-utils
|
||||
|
||||
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
|
||||
|
16
README.md
16
README.md
@@ -1,18 +1,26 @@
|
||||
# HOWTO
|
||||
# What is this?
|
||||
|
||||
This targets Nvidia and Arch, and nothing else, I'm old and lazy.
|
||||
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.~~
|
||||
|
||||
It should work on anything that has an Nvidia GPU, podman, and the nvidia container toolkit (with the nvidia devices setup hook).
|
||||
|
||||
Note that there's currently an issue with the AUR packages for Nvidia's container toolkit. See [this issue](https://gitlab.com/nvidia/container-toolkit/container-toolkit/-/issues/17) for details and a [workaround](https://gitlab.com/nvidia/container-toolkit/container-toolkit/-/issues/17#note_1530784413).
|
||||
|
||||
# HOWTO
|
||||
|
||||
* [Set up GPU access in podman](https://docs.nvidia.com/datacenter/cloud-native/container-toolkit/latest/install-guide.html#configuring-podman)
|
||||
* Run the following:
|
||||
|
||||
```
|
||||
# Build the image
|
||||
podman build --no-cache . -t 'stable-diffusion-ui-server'
|
||||
podman build . -t 'stable-diffusion-ui'
|
||||
|
||||
# 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
|
||||
browser http://localhost:9000
|
||||
|
2
config.yaml
Executable file → Normal file
2
config.yaml
Executable file → Normal file
@@ -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
|
||||
|
16
init
16
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
|
||||
|
Reference in New Issue
Block a user