-
Notifications
You must be signed in to change notification settings - Fork 4
/
Dockerfile.sygil
68 lines (55 loc) · 3.05 KB
/
Dockerfile.sygil
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
FROM nvidia/cuda:11.3.1-base-ubuntu20.04
SHELL ["/bin/bash", "-c"]
WORKDIR /root
RUN apt update \
&& apt install --no-install-recommends -y curl wget git libglib2.0-0 libgl1 build-essential fonts-dejavu \
&& apt-get clean
VOLUME /root/.cache
VOLUME /res
ENV PYTHONUNBUFFERED=1
ENV GRADIO_SERVER_NAME=0.0.0.0
ENV GRADIO_SERVER_PORT=7860
EXPOSE 7860
ENV BASH_ENV=/etc/profile
ENV CONDA_DEFAULT_ENV=base
RUN mkdir ~/.conda \
&& wget https://repo.anaconda.com/miniconda/Miniconda3-py38_4.12.0-Linux-x86_64.sh -O ~/miniconda.sh -q \
&& mkdir -p /opt \
&& bash ~/miniconda.sh -b -p /opt/conda \
&& rm ~/miniconda.sh \
&& ln -s /opt/conda/etc/profile.d/conda.sh /etc/profile.d/conda.sh \
&& echo ". /opt/conda/etc/profile.d/conda.sh" >> /etc/profile \
&& echo "conda activate \$CONDA_DEFAULT_ENV" >> /etc/profile \
&& echo ". /opt/conda/etc/profile.d/conda.sh" >> ~/.bashrc \
&& echo "conda activate \$CONDA_DEFAULT_ENV" >> ~/.bashrc \
&& find /opt/conda/ -follow -type f -name '*.a' -delete \
&& find /opt/conda/ -follow -type f -name '*.js.map' -delete \
&& /opt/conda/bin/conda clean -afy
RUN apt update \
&& DEBIAN_FRONTEND=noninteractive apt install --no-install-recommends -y libsndfile1 \
&& apt-get clean
ARG GIT_CHECKOUT=master
RUN git clone https://github.com/Sygil-Dev/sygil-webui.git stable-diffusion-webui \
&& cd stable-diffusion-webui \
&& git checkout $GIT_CHECKOUT \
&& conda env update -n $CONDA_DEFAULT_ENV -f /root/stable-diffusion-webui/environment.yaml
ENV STREAMLIT_SERVER_HEADLESS=true
RUN mkdir -p /root/stable-diffusion-webui/models/ldm/stable-diffusion-v1 \
&& ln -s /res/target-model.ckpt /root/stable-diffusion-webui/models/ldm/stable-diffusion-v1/model.ckpt \
&& ln -s /res/target-model.ckpt /root/stable-diffusion-webui/models/ldm/stable-diffusion-v1/Stable\ Diffusion\ v1.5.ckpt \
&& mkdir -p /root/stable-diffusion-webui/gfpgan/weights \
&& ln -s /res/detection_Resnet50_Final.pth /root/stable-diffusion-webui/gfpgan/weights/detection_Resnet50_Final.pth \
&& ln -s /res/parsing_parsenet.pth /root/stable-diffusion-webui/gfpgan/weights/parsing_parsenet.pth \
&& mkdir -p /root/stable-diffusion-webui/models/gfpgan \
&& ln -s /res/GFPGANv1.3.pth /root/stable-diffusion-webui/models/gfpgan/GFPGANv1.3.pth \
&& ln -s /res/GFPGANv1.4.pth /root/stable-diffusion-webui/models/gfpgan/GFPGANv1.4.pth \
&& mkdir -p /root/stable-diffusion-webui/models/realesrgan \
&& ln -s /res/RealESRGAN_x4plus.pth /root/stable-diffusion-webui/models/realesrgan/RealESRGAN_x4plus.pth \
&& ln -s /res/RealESRGAN_x4plus_anime_6B.pth /root/stable-diffusion-webui/models/realesrgan/RealESRGAN_x4plus_anime_6B.pth \
&& rm -rf /root/stable-diffusion-webui/models/ldsr \
&& git clone https://github.com/devilismyfriend/latent-diffusion.git /root/stable-diffusion-webui/models/ldsr \
&& cd /root/stable-diffusion-webui/models/ldsr \
&& git checkout 6d61fc03f15273a457950f2cdc10dddf53ba6809 \
&& ln -s /res/LDSR.ckpt /root/stable-diffusion-webui/models/ldsr/model.ckpt \
&& ln -s /res/LDSR.yaml /root/stable-diffusion-webui/models/ldsr/project.yaml
WORKDIR /root/stable-diffusion-webui