mirror of
https://github.com/AbdBarho/stable-diffusion-webui-docker.git
synced 2025-10-28 00:34:34 -04:00
New ComfyUI Dockerfile features
- Non-root default - Use `git describe` to automatically use latest ComfyUI tag (or `USE_EDGE=true` variable for latest commit) - Support custom_nodes: * **ComfyUI-GGUF support** (`USE_GGUF=true`) * **x-flux-comfyui support** (`USE_XFLUX=true`) * **comfyui_controlnet_aux support** (`USE_CNAUX=false`)
This commit is contained in:
@@ -2,11 +2,12 @@
|
||||
|
||||
set -Eeuo pipefail
|
||||
|
||||
mkdir -vp /data/config/comfy/custom_nodes
|
||||
CUSTOM_NODES="/data/config/comfy/custom_nodes"
|
||||
mkdir -vp "${CUSTOM_NODES}"
|
||||
|
||||
declare -A MOUNTS
|
||||
|
||||
MOUNTS["/root/.cache"]="/data/.cache"
|
||||
MOUNTS["${CACHE}"]="/data/.cache"
|
||||
MOUNTS["${ROOT}/input"]="/data/config/comfy/input"
|
||||
MOUNTS["${ROOT}/output"]="/output/comfy"
|
||||
|
||||
@@ -22,6 +23,27 @@ for to_path in "${!MOUNTS[@]}"; do
|
||||
echo Mounted $(basename "${from_path}")
|
||||
done
|
||||
|
||||
if [ "${USE_GGUF}" = "true" ]; then
|
||||
[ ! -e "${CUSTOM_NODES}/ComfyUI-GGUF" ] && mv "${ROOT}/ComfyUI-GGUF" "${CUSTOM_NODES}"/
|
||||
fi
|
||||
if [ "${USE_XFLUX}" = "true" ]; then
|
||||
[ ! -e "${CUSTOM_NODES}/x-flux-comfyui" ] && mv "${ROOT}/x-flux-comfyui" "${CUSTOM_NODES}"/
|
||||
[ ! -e "/data/models/clip_vision" ] && mkdir -p /data/models/clip_vision
|
||||
[ ! -e "/data/models/clip_vision/model.safetensors" ] && cd /data/models/clip_vision && \
|
||||
python -c 'import sys; from urllib.request import urlopen; from pathlib import Path; Path(sys.argv[2]).write_bytes(urlopen("".join([sys.argv[1],sys.argv[2]])).read())' \
|
||||
"https://huggingface.co/openai/clip-vit-large-patch14/resolve/main/" "model.safetensors"
|
||||
[ ! -e "/data/models/xlabs" ] && mkdir -p /data/models/xlabs/{ipadapters,loras,controlnets}
|
||||
[ ! -e "/data/models/xlabs/ipadapters/flux-ip-adapter.safetensors" ] && cd /data/models/xlabs/ipadapters && \
|
||||
python -c 'import sys; from urllib.request import urlopen; from pathlib import Path; Path(sys.argv[2]).write_bytes(urlopen("".join([sys.argv[1],sys.argv[2]])).read())' \
|
||||
"https://huggingface.co/XLabs-AI/flux-ip-adapter/resolve/main/" "flux-ip-adapter.safetensors"
|
||||
[ -d "${ROOT}/models/xlabs" ] && rm -rf "${ROOT}/models/xlabs"
|
||||
[ ! -e "${ROOT}/models/xlabs" ] && cd "${ROOT}/models" && ln -sT /data/models/xlabs xlabs && cd ..
|
||||
fi
|
||||
if [ "${USE_CNAUX}" = "true" ]; then
|
||||
[ ! -e "${CUSTOM_NODES}/comfyui_controlnet_aux" ] && mv "${ROOT}/comfyui_controlnet_aux" "${CUSTOM_NODES}"/
|
||||
fi
|
||||
|
||||
|
||||
if [ -f "/data/config/comfy/startup.sh" ]; then
|
||||
pushd ${ROOT}
|
||||
. /data/config/comfy/startup.sh
|
||||
|
||||
Reference in New Issue
Block a user