This commit is contained in:
Brian Gebel 2025-04-28 14:47:23 -07:00
parent 85645ae66c
commit c2a700fa51
6 changed files with 26 additions and 24 deletions

4
.gitignore vendored
View file

@ -4,3 +4,7 @@
# VSCode specific
*.code-workspace
/.vscode
# Service data
/data/*
!/data/.gitkeep

4
data/.gitignore vendored
View file

@ -1,4 +0,0 @@
/.cache
/config
/embeddings
/models

0
data/.gitkeep Normal file
View file

View file

@ -7,13 +7,16 @@ ENV NVIDIA_VISIBLE_DEVICES=all
ENV PYTHONPATH="${PYTHONPATH}:${PWD}"
ENV CLI_ARGS=""
WORKDIR ${APPLICATION_ROOT}
# Explore how we can use the CLI to do this instead
# https://docs.comfy.org/installation/system_requirements
# https://docs.comfy.org/comfy-cli/getting-started
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}
WORKDIR ${APPLICATION_ROOT}
COPY . .
RUN --mount=type=cache,target=/root/.cache/pip \

View file

@ -2,25 +2,21 @@
set -Eeuo pipefail
mkdir -vp /data/config/comfy/custom_nodes
BASE_DIRECTORY="/data/config/comfy"
OUTPUT_DIRECTORY="/data/output"
declare -A MOUNTS
mkdir -vp ${BASE_DIRECTORY}
mkdir -vp ${BASE_DIRECTORY}/temp
mkdir -vp ${BASE_DIRECTORY}/user
mkdir -vp ${BASE_DIRECTORY}/custom_nodes
mkdir -vp ${OUTPUT_DIRECTORY}
# MOUNTS["/root/.cache"]="/data/.cache" # Determine why the original author decided to do this.
MOUNTS["${APPLICATION_ROOT}/input"]="/data/config/comfy/input"
MOUNTS["${APPLICATION_ROOT}/output"]="/output/comfy"
# --base-directory BASE_DIRECTORY
# Set the ComfyUI base directory for models,
# custom_nodes, input, output, temp, and user directories.
CLI_ARGS+="${CLI_ARGS} --base-directory ${BASE_DIRECTORY} --output-directory ${OUTPUT_DIRECTORY}"
for to_path in "${!MOUNTS[@]}"; do
set -Eeuo pipefail
from_path="${MOUNTS[${to_path}]}"
rm -rf "${to_path}"
if [ ! -f "$from_path" ]; then
mkdir -vp "$from_path"
fi
mkdir -vp "$(dirname "${to_path}")"
ln -sT "${from_path}" "${to_path}"
echo Mounted $(basename "${from_path}")
done
echo ${CLI_ARGS}
if [ -f "/data/config/comfy/startup.sh" ]; then
pushd ${APPLICATION_ROOT}

View file

@ -1,3 +1,4 @@
# https://github.com/comfyanonymous/ComfyUI/blob/master/extra_model_paths.yaml.example
a111:
base_path: /data
@ -16,8 +17,10 @@ a111:
clip: models/CLIPEncoder
embeddings: embeddings
# This isn't a real value as far as I can tell?
custom_nodes: config/comfy/custom_nodes
comfyui:
base_path: /data
# custom_nodes: config/comfy/custom_nodes
# TODO: I am unsure about these, need more testing
# style_models: data/config/comfy/style_models