This commit is contained in:
Mikan
2026-10-16 12:36:58 +04:00
parent 486a718eab
commit fbff0edf77
6 changed files with 112 additions and 180 deletions

View File

@@ -17,7 +17,6 @@ start_comfy() {
fi
HOST_PROJECT_PATH="$HOST_PROJECT_PATH" \
PROJECT_HOST_DIR="$HOST_PROJECT_PATH" \
COMFY_BASE_HOST="$HOST_PROJECT_PATH/gpu/comfy" \
COMFY_RUN_HOST="$HOST_PROJECT_PATH/comfyui/run" \
COMFY_EXTRA_ARGS="$EXTRA_ARGS" \
@@ -31,29 +30,32 @@ start_comfy() {
echo
docker ps \
--filter "name=gpu-node-comfyui" \
--filter "label=node.role=comfyui" \
--filter "label=node.instance=${NODE_INSTANCE}" \
--format 'table {{.Names}}\t{{.Status}}\t{{.Ports}}'
}
model_worker_exec() {
MW_CONTAINER=$(get_service_container "model-worker") || {
echo "ERROR: model-worker container not found for instance '${NODE_INSTANCE}'" >&2
return 1
}
docker exec \
gpu-node-model-worker \
"$MW_CONTAINER" \
python3 \
/app/worker.py \
"$@"
}
list_comfy_models() {
model_worker_exec list "$@"
}
queue_comfy_models() {
model_worker_exec queue "$@"
}
add_comfy_model() {
if [ "$#" -ne 2 ]; then
echo "Usage: gpuctl comfy models add <URL> <type>" >&2
@@ -63,7 +65,6 @@ add_comfy_model() {
model_worker_exec add "$1" "$2"
}
remove_comfy_model() {
if [ "$#" -lt 1 ] || [ "$#" -gt 2 ]; then
echo "Usage: gpuctl comfy models rm <filename> [type]" >&2
@@ -73,42 +74,32 @@ remove_comfy_model() {
model_worker_exec rm "$@"
}
comfy_models_command() {
case "${1:-}" in
list)
shift
if [ "$#" -gt 1 ]; then
echo "Usage: gpuctl comfy models list [type]" >&2
return 1
fi
list_comfy_models "$@"
;;
queue)
shift
if [ "$#" -ne 0 ]; then
echo "Usage: gpuctl comfy models queue" >&2
return 1
fi
queue_comfy_models
;;
add)
shift
add_comfy_model "$@"
;;
rm)
shift
remove_comfy_model "$@"
;;
*)
echo "Usage:"
echo " gpuctl comfy models list [type]"
@@ -120,15 +111,12 @@ comfy_models_command() {
esac
}
comfy_command() {
case "${1:-}" in
models)
shift
comfy_models_command "$@"
;;
*)
echo "Usage:"
echo " gpuctl comfy models list [type]"
@@ -138,4 +126,4 @@ comfy_command() {
return 1
;;
esac
}
}