forked from dusty-nv/jetson-containers
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile
58 lines (52 loc) · 2.98 KB
/
Dockerfile
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
#---
# name: stable-diffusion-webui
# group: diffusion
# depends: [pytorch, torchvision, transformers, xformers, pycuda, opencv:deb, onnxruntime]
# requires: '>=34.1.0'
# docs: docs.md
# notes: disabled on JetPack 4
#---
ARG BASE_IMAGE
FROM ${BASE_IMAGE}
ARG STABLE_DIFFUSION_WEBUI_REF \
STABLE_DIFFUSION_WEBUI_SHA \
AUTOMATIC1111_ROOT_DIR="/opt/stable-diffusion-webui"
ADD https://api.github.com/repos/AUTOMATIC1111/stable-diffusion-webui/git/${STABLE_DIFFUSION_WEBUI_REF} /tmp/stable_diffusion_webui_version.json
COPY install_extensions.sh /tmp/
RUN set -ex \
&& git clone https://github.com/AUTOMATIC1111/stable-diffusion-webui /opt/stable-diffusion-webui \
&& git -C /opt/stable-diffusion-webui checkout ${STABLE_DIFFUSION_WEBUI_SHA} \
\
# Fix: ControlNet init warning: Unable to install insightface automatically. Please try run `pip install insightface` manually. \
# Fix: https://github.com/AUTOMATIC1111/stable-diffusion-webui/issues/13236 \
&& PYTHONPATH="$AUTOMATIC1111_ROOT_DIR" pip3 install --no-cache-dir --verbose httpx==0.24.1 insightface GitPython \
&& PYTHONPATH="$AUTOMATIC1111_ROOT_DIR" /tmp/install_extensions.sh \
https://github.com/dusty-nv/stable-diffusion-webui-tensorrt \
https://github.com/Mikubill/sd-webui-controlnet \
https://github.com/zanllp/sd-webui-infinite-image-browsing \
https://github.com/ahgsql/StyleSelectorXL \
https://github.com/thomasasfk/sd-webui-aspect-ratio-helper \
https://github.com/BlafKing/sd-civitai-browser-plus \
&& PYTHONPATH="$AUTOMATIC1111_ROOT_DIR" python3 -c 'from modules import launch_utils; launch_utils.args.skip_python_version_check=True; launch_utils.prepare_environment()' \
# partially initialized module 'cv2' has no attribute 'gapi_wip_gst_GStreamerPipeline' \
&& /tmp/opencv/install.sh \
# TypeError: 'type' object is not subscriptable \
&& sed 's|dict\[str, OptionInfo\]|dict|g' -i $AUTOMATIC1111_ROOT_DIR/modules/options.py \
&& sed 's|dict\[.*\]|dict|g' -i $AUTOMATIC1111_ROOT_DIR/modules/processing.py \
&& sed 's|list\[.*\]|list|g' -i $AUTOMATIC1111_ROOT_DIR/modules/processing.py \
&& sed 's|dict\[.*\]|dict|g' -i $AUTOMATIC1111_ROOT_DIR/modules/script_callbacks.py \
&& sed 's|list\[.*\]|list|g' -i $AUTOMATIC1111_ROOT_DIR/modules/script_callbacks.py \
\
# test that it loads \
&& cd /opt/stable-diffusion-webui \
&& PYTHONPATH="$AUTOMATIC1111_ROOT_DIR" python3 launch.py --help \
&& PYTHONPATH="$AUTOMATIC1111_ROOT_DIR" pip3 show insightface \
&& PYTHONPATH="$AUTOMATIC1111_ROOT_DIR" python3 -c 'import insightface; print(insightface.__version__);' \
\
# Cleanup \
&& rm -rf /var/lib/apt/lists/* \
&& apt-get clean
# set the cache dir for models
ENV DIFFUSERS_CACHE=/data/models/diffusers
# default start-up command
CMD ["/bin/bash", "-c", "cd /opt/stable-diffusion-webui && python3 launch.py --data=/data/models/stable-diffusion --enable-insecure-extension-access --xformers --listen --port=7860"]