mirror of
https://github.com/AbdBarho/stable-diffusion-webui-docker.git
synced 2026-03-15 09:43:59 +01:00
working
This commit is contained in:
parent
73b2e33326
commit
85645ae66c
|
|
@ -1,28 +1,26 @@
|
||||||
FROM pytorch/pytorch:2.3.0-cuda12.1-cudnn8-runtime
|
FROM pytorch/pytorch:2.3.0-cuda12.1-cudnn8-runtime
|
||||||
|
|
||||||
ENV DEBIAN_FRONTEND=noninteractive PIP_PREFER_BINARY=1
|
ENV DEBIAN_FRONTEND=noninteractive
|
||||||
|
ENV PIP_PREFER_BINARY=1
|
||||||
|
ENV APPLICATION_ROOT=/stable-diffusion
|
||||||
|
ENV NVIDIA_VISIBLE_DEVICES=all
|
||||||
|
ENV PYTHONPATH="${PYTHONPATH}:${PWD}"
|
||||||
|
ENV CLI_ARGS=""
|
||||||
|
|
||||||
RUN apt-get update && apt-get install -y git && apt-get clean
|
RUN apt-get update && \
|
||||||
|
apt-get install -y git && \
|
||||||
|
apt-get clean && \
|
||||||
|
git clone --branch v0.3.19 --depth 1 https://github.com/comfyanonymous/ComfyUI.git ${APPLICATION_ROOT}
|
||||||
|
|
||||||
# Set USER here? https://stackoverflow.com/questions/24549746/switching-users-inside-docker-image-to-a-non-root-user
|
WORKDIR ${APPLICATION_ROOT}
|
||||||
# USER ${uid}:${gid}
|
|
||||||
|
|
||||||
# RUN --mount=type=cache,target=/root/.cache/pip \
|
COPY . .
|
||||||
# put Cache somehwere else or don't define target?
|
|
||||||
# PIP_CACHE_DIR pip cache dir
|
|
||||||
|
|
||||||
ENV ROOT=/stable-diffusion
|
|
||||||
RUN --mount=type=cache,target=/root/.cache/pip \
|
RUN --mount=type=cache,target=/root/.cache/pip \
|
||||||
git clone https://github.com/comfyanonymous/ComfyUI.git ${ROOT} && \
|
pip install -r requirements.txt && \
|
||||||
cd ${ROOT} && \
|
chmod u+x ./entrypoint.sh
|
||||||
git checkout v0.3.19 && \
|
|
||||||
pip install -r requirements.txt
|
|
||||||
|
|
||||||
WORKDIR ${ROOT}
|
|
||||||
COPY . /docker/
|
|
||||||
RUN chmod u+x /docker/entrypoint.sh && cp /docker/extra_model_paths.yaml ${ROOT}
|
|
||||||
|
|
||||||
ENV NVIDIA_VISIBLE_DEVICES=all PYTHONPATH="${PYTHONPATH}:${PWD}" CLI_ARGS=""
|
|
||||||
EXPOSE 7860
|
EXPOSE 7860
|
||||||
ENTRYPOINT ["/docker/entrypoint.sh"]
|
|
||||||
|
ENTRYPOINT ["./entrypoint.sh"]
|
||||||
CMD python -u main.py --listen --port 7860 ${CLI_ARGS}
|
CMD python -u main.py --listen --port 7860 ${CLI_ARGS}
|
||||||
|
|
@ -6,9 +6,9 @@ mkdir -vp /data/config/comfy/custom_nodes
|
||||||
|
|
||||||
declare -A MOUNTS
|
declare -A MOUNTS
|
||||||
|
|
||||||
MOUNTS["/root/.cache"]="/data/.cache"
|
# MOUNTS["/root/.cache"]="/data/.cache" # Determine why the original author decided to do this.
|
||||||
MOUNTS["${ROOT}/input"]="/data/config/comfy/input"
|
MOUNTS["${APPLICATION_ROOT}/input"]="/data/config/comfy/input"
|
||||||
MOUNTS["${ROOT}/output"]="/output/comfy"
|
MOUNTS["${APPLICATION_ROOT}/output"]="/output/comfy"
|
||||||
|
|
||||||
for to_path in "${!MOUNTS[@]}"; do
|
for to_path in "${!MOUNTS[@]}"; do
|
||||||
set -Eeuo pipefail
|
set -Eeuo pipefail
|
||||||
|
|
@ -23,7 +23,7 @@ for to_path in "${!MOUNTS[@]}"; do
|
||||||
done
|
done
|
||||||
|
|
||||||
if [ -f "/data/config/comfy/startup.sh" ]; then
|
if [ -f "/data/config/comfy/startup.sh" ]; then
|
||||||
pushd ${ROOT}
|
pushd ${APPLICATION_ROOT}
|
||||||
. /data/config/comfy/startup.sh
|
. /data/config/comfy/startup.sh
|
||||||
popd
|
popd
|
||||||
fi
|
fi
|
||||||
|
|
|
||||||
|
|
@ -16,6 +16,7 @@ a111:
|
||||||
clip: models/CLIPEncoder
|
clip: models/CLIPEncoder
|
||||||
embeddings: embeddings
|
embeddings: embeddings
|
||||||
|
|
||||||
|
# This isn't a real value as far as I can tell?
|
||||||
custom_nodes: config/comfy/custom_nodes
|
custom_nodes: config/comfy/custom_nodes
|
||||||
|
|
||||||
# TODO: I am unsure about these, need more testing
|
# TODO: I am unsure about these, need more testing
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue