Compare commits

1 Commits

Author SHA1 Message Date
lainedfles
4bd0ee8896 Merge 6a0366cf45 into 802d0bcd68 2024-09-29 09:53:17 +00:00
3 changed files with 16 additions and 56 deletions

View File

@@ -1,30 +1,29 @@
FROM pytorch/pytorch:2.3.1-cuda12.1-cudnn8-runtime
# Limited system user UID # Limited system user UID
ARG USE_UID=991 ARG USE_UID=991
# Limited system user GID # Limited system user GID
ARG USE_GID=991 ARG USE_GID=991
# Latest tag or bleeding edge commit # Latest tag or bleeding edge commit
ARG USE_EDGE=false ARG USE_EDGE=false
# ComfyUI-GGUF # ComfyUI-GGUF support
ARG USE_GGUF=false ARG USE_GGUF=false
# x-flux-comfyui # x-flux-comfyui support
ARG USE_XFLUX=false ARG USE_XFLUX=false
# comfyui_controlnet_aux # comfyui_controlnet_aux support
ARG USE_CNAUX=false ARG USE_CNAUX=false
# krita-ai-diffusion
ARG USE_KRITA=false FROM pytorch/pytorch:2.3.0-cuda12.1-cudnn8-runtime
# ComfyUI_IPAdapter_plus
ARG USE_IPAPLUS=false # Use args
# comfyui-inpaint-nodes ARG USE_UID
ARG USE_INPAINT=false ARG USE_GID
# comfyui-tooling-nodes ARG USE_EDGE
ARG USE_TOOLING=false ARG USE_GGUF
ARG USE_XFLUX
ARG USE_CNAUX
ENV DEBIAN_FRONTEND=noninteractive PIP_PREFER_BINARY=1 USE_EDGE=$USE_EDGE ENV DEBIAN_FRONTEND=noninteractive PIP_PREFER_BINARY=1 USE_EDGE=$USE_EDGE
ENV USE_GGUF=$USE_GGUF USE_XFLUX=$USE_XFLUX ROOT=/stable-diffusion ENV USE_GGUF=$USE_GGUF USE_XFLUX=$USE_XFLUX ROOT=/stable-diffusion
ENV CACHE=/home/app/.cache USE_CNAUX=$USE_CNAUX USE_KRITA=$USE_KRITA ENV CACHE=/home/app/.cache USE_CNAUX=$USE_CNAUX
ENV USE_IPAPLUS=$USE_IPAPLUS USE_INPAINT=$USE_INPAINT USE_TOOLING=$USE_TOOLING
# User/Group # User/Group
RUN groupadd -r app -g ${USE_GID} && useradd --no-log-init -m -r -g app app -u ${USE_UID} && \ RUN groupadd -r app -g ${USE_GID} && useradd --no-log-init -m -r -g app app -u ${USE_UID} && \
@@ -46,14 +45,6 @@ RUN --mount=type=cache,uid=${USE_UID},gid=${USE_GID},target=${CACHE} \
if [ "${USE_EDGE}" = "true" ]; then VERSION=$(git describe --abbrev=7); fi && \ if [ "${USE_EDGE}" = "true" ]; then VERSION=$(git describe --abbrev=7); fi && \
git reset --hard ${VERSION}' && \ git reset --hard ${VERSION}' && \
pip --cache-dir=${CACHE}/pip install -r requirements.txt && \ pip --cache-dir=${CACHE}/pip install -r requirements.txt && \
if [ "${USE_KRITA}" = "true" ]; then \
pip --cache-dir=${CACHE}/pip install aiohttp tqdm && \
git clone https://github.com/Acly/krita-ai-diffusion.git && \
cd krita-ai-diffusion && git checkout main && \
git submodule update --init && cd ..; \
export USE_CNAUX="true" USE_IPAPLUS="true" \
USE_INPAINT="true" USE_TOOLING="true"; \
fi; \
if [ "${USE_GGUF}" = "true" ]; then \ if [ "${USE_GGUF}" = "true" ]; then \
git clone https://github.com/city96/ComfyUI-GGUF.git && \ git clone https://github.com/city96/ComfyUI-GGUF.git && \
cd ComfyUI-GGUF && git checkout main && \ cd ComfyUI-GGUF && git checkout main && \
@@ -68,21 +59,8 @@ RUN --mount=type=cache,uid=${USE_UID},gid=${USE_GID},target=${CACHE} \
git clone https://github.com/Fannovel16/comfyui_controlnet_aux.git && \ git clone https://github.com/Fannovel16/comfyui_controlnet_aux.git && \
cd comfyui_controlnet_aux && git checkout main && \ cd comfyui_controlnet_aux && git checkout main && \
pip --cache-dir=${CACHE}/pip install -r requirements.txt && \ pip --cache-dir=${CACHE}/pip install -r requirements.txt && \
# This extra step to separate onnxruntime installation is required to restore onnx cuda support \ # This extra step to separate onnxruntime installation is required to restore onnx cuda support
pip --cache-dir=${CACHE}/pip install onnxruntime && pip --cache-dir=${CACHE}/pip install onnxruntime-gpu && cd ..; \ pip --cache-dir=${CACHE}/pip install onnxruntime && pip --cache-dir=${CACHE}/pip install onnxruntime-gpu && cd ..; \
fi; \
if [ "${USE_IPAPLUS}" = "true" ]; then \
git clone https://github.com/cubiq/ComfyUI_IPAdapter_plus.git && \
cd ComfyUI_IPAdapter_plus && git checkout main && cd ..; \
fi; \
if [ "${USE_INPAINT}" = "true" ]; then \
git clone https://github.com/Acly/comfyui-inpaint-nodes.git && \
cd comfyui-inpaint-nodes && git checkout main && \
pip --cache-dir=${CACHE}/pip install opencv-python && cd ..; \
fi; \
if [ "${USE_TOOLING}" = "true" ]; then \
git clone https://github.com/Acly/comfyui-tooling-nodes.git && \
cd comfyui-tooling-nodes && git checkout main && cd ..; \
fi fi
WORKDIR ${ROOT} WORKDIR ${ROOT}

View File

@@ -23,14 +23,6 @@ for to_path in "${!MOUNTS[@]}"; do
echo Mounted $(basename "${from_path}") echo Mounted $(basename "${from_path}")
done done
if [ "${USE_KRITA}" = "true" ]; then
if [ "${KRITA_DOWNLOAD_MODELS:-false}" = "true" ]; then
cd "${ROOT}/krita-ai-diffusion/scripts" && python scripts/download_models.py --recommended /data && cd ..
cd "${ROOT}/models/" mv -v upscale_models upscale_models.stock && ln -sT /data/models/upscale_models upscale_models
fi
export USE_CNAUX="true" USE_IPAPLUS="true" USE_INPAINT="true"; USE_TOOLING="true"
fi
if [ "${USE_GGUF}" = "true" ]; then if [ "${USE_GGUF}" = "true" ]; then
[ ! -e "${CUSTOM_NODES}/ComfyUI-GGUF" ] && mv "${ROOT}/ComfyUI-GGUF" "${CUSTOM_NODES}"/ [ ! -e "${CUSTOM_NODES}/ComfyUI-GGUF" ] && mv "${ROOT}/ComfyUI-GGUF" "${CUSTOM_NODES}"/
fi fi
@@ -50,15 +42,7 @@ fi
if [ "${USE_CNAUX}" = "true" ]; then if [ "${USE_CNAUX}" = "true" ]; then
[ ! -e "${CUSTOM_NODES}/comfyui_controlnet_aux" ] && mv "${ROOT}/comfyui_controlnet_aux" "${CUSTOM_NODES}"/ [ ! -e "${CUSTOM_NODES}/comfyui_controlnet_aux" ] && mv "${ROOT}/comfyui_controlnet_aux" "${CUSTOM_NODES}"/
fi fi
if [ "${USE_IPAPLUS}" = "true" ]; then
[ ! -e "${CUSTOM_NODES}/ComfyUI_IPAdapter_plus" ] && mv "${ROOT}/ComfyUI_IPAdapter_plus" "${CUSTOM_NODES}"/
fi
if [ "${USE_INPAINT}" = "true" ]; then
[ ! -e "${CUSTOM_NODES}/comfyui-inpaint-nodes" ] && mv "${ROOT}/comfyui-inpaint-nodes" "${CUSTOM_NODES}"/
fi
if [ "${USE_TOOLING}" = "true" ]; then
[ ! -e "${CUSTOM_NODES}/comfyui-tooling-nodes" ] && mv "${ROOT}/comfyui-tooling-nodes" "${CUSTOM_NODES}"/
fi
if [ -f "/data/config/comfy/startup.sh" ]; then if [ -f "/data/config/comfy/startup.sh" ]; then
pushd ${ROOT} pushd ${ROOT}

View File

@@ -18,8 +18,6 @@ a111:
unet: models/unet unet: models/unet
clip_vision: models/clip_vision clip_vision: models/clip_vision
xlabs: models/xlabs xlabs: models/xlabs
inpaint: models/inpaint
ipadapter: models/ipadapter
custom_nodes: config/comfy/custom_nodes custom_nodes: config/comfy/custom_nodes