mirror of
https://github.com/AbdBarho/stable-diffusion-webui-docker.git
synced 2026-01-21 07:50:25 +01:00
Update swarmui & comfyui, pre-install custom nodes requirements for swarmui, fix permissions & TODOs
This commit is contained in:
parent
01f26a3704
commit
1e1c593cd1
|
|
@ -8,7 +8,10 @@ supports:
|
|||
- fooocus
|
||||
- forge
|
||||
- reforge
|
||||
- swarmui
|
||||
- swarmui _**(be aware comfyui backend can take some time to start, up to a minute or 2)**_
|
||||
|
||||
#### TODOs
|
||||
1. [ ] Fix [Warning] [ComfyUI-0/STDERR] NameError: name 'NODE_CLASS_MAPPINGS' is not defined
|
||||
|
||||
# Stable Diffusion WebUI Docker
|
||||
|
||||
|
|
|
|||
|
|
@ -113,11 +113,14 @@ services:
|
|||
- ./data/embeddings:/SwarmUI/Models/Embeddings
|
||||
# comfyui
|
||||
- ./data/config/comfy/custom_nodes:/SwarmUI/dlbackend/ComfyUI/custom_nodes
|
||||
# TODO fix permissions
|
||||
- ./data/models/configs:/SwarmUI/dlbackend/ComfyUI/user/default/
|
||||
# - ./data/models/configs:/SwarmUI/dlbackend/ComfyUI/user/default/ # TODO rm old
|
||||
- ./data/config/configs:/SwarmUI/dlbackend/ComfyUI/user/default/
|
||||
# output
|
||||
- ./output/swarmui:/SwarmUI/Output
|
||||
- ./output/swarmui/comfy:/SwarmUI/dlbackend/ComfyUI/output
|
||||
environment:
|
||||
- COMFYUI_PATH=/opt/comfyui
|
||||
- COMFYUI_MODEL_PATH=/opt/comfyui/models
|
||||
|
||||
reforge: &reforge
|
||||
<<: *base_service
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
# Defines the versions of ComfyUI, ComfyUI Manager, and PyTorch to use
|
||||
ARG COMFYUI_VERSION=v0.3.52
|
||||
ARG COMFYUI_MANAGER_VERSION=3.33.8
|
||||
ARG COMFYUI_VERSION=v0.3.57
|
||||
ARG COMFYUI_MANAGER_VERSION=3.35
|
||||
ARG PYTORCH_VERSION=2.7.1-cuda12.8-cudnn9-runtime
|
||||
|
||||
# This image is based on the latest official PyTorch image, because it already contains CUDA, CuDNN, and PyTorch
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
#!/bin/bash
|
||||
# Get custom nodes requirements and merge latest versions
|
||||
REQ_PATH="data/config/comfy/custom_nodes"
|
||||
BUILD_PATH="services/comfy/install"
|
||||
BUILD_PATH=$(dirname "$0")
|
||||
|
||||
mkdir -p ${BUILD_PATH}/reqs
|
||||
for f in ${REQ_PATH}/*/requirements.txt; do \
|
||||
|
|
|
|||
|
|
@ -1,10 +1,11 @@
|
|||
ARG SWARMUI_VERSION=0.9.6-Beta
|
||||
ARG COMFYUI_VERSION=v0.3.50
|
||||
ARG COMFYUI_MANAGER_VERSION=3.33.8
|
||||
ARG COMFYUI_VERSION=v0.3.57
|
||||
ARG COMFYUI_MANAGER_VERSION=3.35
|
||||
ARG DOTNET_VERSION=8.0-bookworm-slim
|
||||
ARG SWARM_PATH="/SwarmUI"
|
||||
#ENV SWARM_PATH=/opt/swarmui
|
||||
|
||||
# BUILD
|
||||
FROM mcr.microsoft.com/dotnet/sdk:${DOTNET_VERSION} AS build
|
||||
ARG SWARM_PATH
|
||||
ENV DOTNET_CLI_TELEMETRY_OPTOUT=1
|
||||
|
|
@ -58,6 +59,7 @@ RUN --mount=type=cache,target=/var/cache/apt \
|
|||
libglib2.0-0 \
|
||||
libgl1
|
||||
|
||||
# Install ComfyUI
|
||||
RUN git clone --depth=1 https://github.com/comfyanonymous/ComfyUI.git /opt/comfyui && \
|
||||
cd /opt/comfyui && \
|
||||
git fetch origin ${COMFYUI_VERSION} && \
|
||||
|
|
@ -69,19 +71,21 @@ RUN git clone --depth=1 https://github.com/Comfy-Org/ComfyUI-Manager.git /opt/co
|
|||
git checkout FETCH_HEAD
|
||||
|
||||
WORKDIR ${SWARM_PATH}
|
||||
RUN chown -R swarmui:swarmui /opt/comfyui
|
||||
RUN git config --global --add safe.directory /opt/comfyui
|
||||
|
||||
ENV COMFYUI_PATH="/SwarmUI/dlbackend/ComfyUI"
|
||||
ENV CUSTOM_NODES_PATH="/SwarmUI/dlbackend/ComfyUI/custom_nodes"
|
||||
|
||||
# Pre-install previously used custom nodes requirements from volume
|
||||
COPY ./install/merged-requirements.txt* /docker/requirements.txt
|
||||
COPY comfy-install-linux.sh ${SWARM_PATH}/launchtools/
|
||||
RUN chmod +x ${SWARM_PATH}/launchtools/comfy-install-linux.sh && \
|
||||
${SWARM_PATH}/launchtools/comfy-install-linux.sh ${GPU_TYPE}
|
||||
|
||||
RUN chown -R swarmui:swarmui ${COMFYUI_PATH}/venv
|
||||
RUN chown -R swarmui:swarmui ${COMFYUI_PATH}
|
||||
RUN git config --global --add safe.directory ${COMFYUI_PATH}
|
||||
|
||||
RUN chown -R swarmui:swarmui ${COMFYUI_PATH}/venv # Reapplied again bc of permissions issues, maybe related to a symlink/docker/windows bug
|
||||
ENV PATH="${COMFYUI_PATH}/venv/bin:$PATH"
|
||||
ENV PYTHONPATH="${CUSTOM_NODES_PATH}:${PYTHONPATH}"
|
||||
ENV PYTHONPATH="${CUSTOM_NODES_PATH}:\${PYTHONPATH}"
|
||||
USER swarmui
|
||||
EXPOSE 7801
|
||||
|
||||
|
|
|
|||
|
|
@ -93,4 +93,12 @@ $python -s -m pip install --no-cache-dir \
|
|||
--requirement ${COMFYUI_PATH}/requirements.txt \
|
||||
--requirement ${CUSTOM_NODES_PATH}/ComfyUI-Manager/requirements.txt
|
||||
|
||||
# Pre-install previously used custom nodes requirements from volume
|
||||
if [ -f "/docker/requirements.txt" ]; then
|
||||
echo "pre-install custom nodes requirements..."
|
||||
$python -s -m pip install --no-cache-dir -r /docker/requirements.txt
|
||||
elif [ "$GPU_TYPE" == "amd" ]; then
|
||||
echo "merged-requirements.txt not found, skipping pre-install."
|
||||
fi
|
||||
|
||||
echo "Installation completed for $GPU_TYPE GPU."
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
#!/usr/bin/env bash
|
||||
#set -x
|
||||
set -x
|
||||
# Ensure correct local path.
|
||||
SCRIPT_DIR=$( cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd )
|
||||
cd "$SCRIPT_DIR"
|
||||
|
|
@ -11,8 +11,6 @@ export PATH="$SCRIPT_DIR/.dotnet:~/.dotnet:$PATH"
|
|||
export ASPNETCORE_ENVIRONMENT="Production"
|
||||
export ASPNETCORE_URLS="http://*:7801"
|
||||
|
||||
# TODO fix permissions
|
||||
#chown -R swarmui:swarmui ${COMFYUI_PATH}/user/default/
|
||||
chmod -R 755 ${COMFYUI_PATH}/user/default/
|
||||
chmod -R 755 /opt/comfyui/user/default/
|
||||
|
||||
|
|
|
|||
2
services/swarmui/install/.gitignore
vendored
Normal file
2
services/swarmui/install/.gitignore
vendored
Normal file
|
|
@ -0,0 +1,2 @@
|
|||
reqs
|
||||
merged-requirements.txt
|
||||
52
services/swarmui/install/install.sh
Normal file
52
services/swarmui/install/install.sh
Normal file
|
|
@ -0,0 +1,52 @@
|
|||
#!/bin/bash
|
||||
# Get custom nodes requirements and merge latest versions
|
||||
REQ_PATH="data/config/comfy/custom_nodes"
|
||||
BUILD_PATH=$(dirname "$0")
|
||||
|
||||
mkdir -p ${BUILD_PATH}/reqs
|
||||
for f in ${REQ_PATH}/*/requirements.txt; do \
|
||||
node=$(basename $(dirname "$f")); \
|
||||
cp "$f" ${BUILD_PATH}/reqs/${node}-requirements.txt; \
|
||||
done
|
||||
find ${BUILD_PATH}/reqs -maxdepth 1 -name "*requirements.txt" -exec cat {} + \
|
||||
| grep -v '^#' \
|
||||
| grep -v '^git' \
|
||||
| sed 's/==.*//' \
|
||||
| awk '{print tolower($0)}' \
|
||||
| sed 's/[[:space:]]//g' \
|
||||
| sort -u \
|
||||
| awk '
|
||||
{
|
||||
line = $0;
|
||||
if (line ~ /^[[:space:]]*$/) { next }
|
||||
if (line ~ /git\+/ || line ~ /\[.*\]/) {
|
||||
print "Z_" line, "0", line
|
||||
next
|
||||
}
|
||||
split(line, a, "[<>=]")
|
||||
package = a[1]
|
||||
version = a[2]
|
||||
gsub(/[[:space:]]+/, "", package)
|
||||
gsub(/_/, "-", package)
|
||||
if (version == "") {
|
||||
version = "0"
|
||||
}
|
||||
print package, version, line
|
||||
}
|
||||
' \
|
||||
| sort -k1,1 -V -k2,2 \
|
||||
| awk '
|
||||
{
|
||||
if (prev_package != $1) {
|
||||
if (NR > 1) {
|
||||
print prev_line
|
||||
}
|
||||
prev_package = $1
|
||||
}
|
||||
prev_line = $3
|
||||
}
|
||||
END {
|
||||
print prev_line
|
||||
}
|
||||
' \
|
||||
> ${BUILD_PATH}/merged-requirements.txt
|
||||
Loading…
Reference in a new issue