From 87cd87c6e2fc21b98a9f7b1ae077cbddad15398d Mon Sep 17 00:00:00 2001 From: jdacode <49216638+jdacode@users.noreply.github.com> Date: Tue, 19 Aug 2025 14:05:19 +0930 Subject: [PATCH 01/12] Init ComfyUI dev branch Testing --- ct/comfyui.sh | 52 +++ frontend/public/json/comfyui.json | 47 +++ install/comfyui-install.sh | 506 ++++++++++++++++++++++++++++++ misc/build.func | 18 +- misc/install.func | 4 +- 5 files changed, 616 insertions(+), 11 deletions(-) create mode 100644 ct/comfyui.sh create mode 100644 frontend/public/json/comfyui.json create mode 100644 install/comfyui-install.sh diff --git a/ct/comfyui.sh b/ct/comfyui.sh new file mode 100644 index 000000000..5206e0741 --- /dev/null +++ b/ct/comfyui.sh @@ -0,0 +1,52 @@ +#!/usr/bin/env bash +source <(curl -fsSL https://raw.githubusercontent.com/jdacode/ProxmoxVED/refs/heads/comfyui/misc/build.func) +# Copyright (c) 2021-2025 community-scripts ORG +# Author: jdacode +# License: MIT | https://github.com/community-scripts/ProxmoxVE/raw/main/LICENSE +# Source: https://github.com/comfyanonymous/ComfyUI + +# App Default Values +# Name of the app (e.g. Google, Adventurelog, Apache-Guacamole" +APP="ComfyUI" +# Tags for Proxmox VE, maximum 2 pcs., no spaces allowed, separated by a semicolon ; (e.g. database | adblock;dhcp) +var_tags="${var_tags:-ai}" +# Number of cores (1-X) (e.g. 4) - default are 2 +var_cpu="${var_cpu:-4}" +# Amount of used RAM in MB (e.g. 2048 or 4096) +var_ram="${var_ram:-8192}" +# Amount of used disk space in GB (e.g. 4 or 10) +var_disk="${var_disk:-25}" +# Default OS (e.g. debian, ubuntu, alpine) +var_os="${var_os:-debian}" +# Default OS version (e.g. 12 for debian, 24.04 for ubuntu, 3.20 for alpine) +var_version="${var_version:-12}" +# 1 = unprivileged container, 0 = privileged container +var_unprivileged="${var_unprivileged:-1}" + +header_info "$APP" +variables +color +catch_errors + +function update_script() { + header_info + check_container_storage + check_container_resources + + # Check if installation is present | -f for file, -d for folder + if [[ ! -f /opt/${APP} ]]; then + msg_error "No ${APP} Installation Found!" + exit + fi + msg_error "To update use the ${APP} Manager." + exit +} + +start +build_container +description + +msg_ok "Completed Successfully!\n" +echo -e "${CREATING}${GN}${APP} setup has been successfully initialized!${CL}" +echo -e "${INFO}${YW} Access it using the following URL:${CL}" +echo -e "${TAB}${GATEWAY}${BGN}http://${IP}:8188${CL}" diff --git a/frontend/public/json/comfyui.json b/frontend/public/json/comfyui.json new file mode 100644 index 000000000..7dde60335 --- /dev/null +++ b/frontend/public/json/comfyui.json @@ -0,0 +1,47 @@ +{ + "name": "ComfyUI", + "slug": "comfyui", + "categories": [ + 20 + ], + "date_created": "2025-08-01", + "type": "ct", + "updateable": true, + "privileged": false, + "interface_port": 8188, + "documentation": "https://github.com/comfyanonymous/ComfyUI", + "website": "https://www.comfy.org/", + "logo": "https://framerusercontent.com/images/3cNQMWKzIhIrQ5KErBm7dSmbd2w.png", + "description": "ComfyUI is a node-based interface and inference engine for generative AI. Users can combine various AI models and operations through nodes to achieve highly customizable and controllable content generation. ComfyUI is completely open source and can run on your local device", + "install_methods": [ + { + "type": "default", + "script": "ct/comfyui.sh", + "resources": { + "cpu": 4, + "ram": 8192, + "hdd": 25, + "os": "debian", + "version": "12" + } + } + ], + "default_credentials": { + "username": null, + "password": null + }, + "notes": [ + { + "text": "Application takes long time to install. Please be patient!", + "type": "warning" + }, + { + "text": "Please check that you have installed the drivers for your GPU.", + "type": "info" + }, + { + "text": "You can always skip manual configuration by using dynamic variables. For example: `skip_user_config=\"Y|y|N|n\" comfyui_version=\"latest|v0.3.49\" python_version_uv=\"3.12\" port_arg=\"8188\" comfyui_python_args=\"--cpu\" gpu_type=\"None|NVIDIA|AMD|Intel\" comfyui_python_index_url_nvidia=\"https://download.pytorch.org/whl/cu128\" comfyui_python_index_url_amd=\"https://download.pytorch.org/whl/rocm6.3\" comfyui_python_index_url_intel=\"https://download.pytorch.org/whl/xpu\" comfyui_manager_enabled=\"Y|y|N|n\" comfyui_manager_version=\"latest|3.35\" bash -c \"$(curl -fsSL https://raw.githubusercontent.com/community-scripts/ProxmoxVE/main/ct/comfyui.sh)\"`", + "type": "info" + } + ] +} diff --git a/install/comfyui-install.sh b/install/comfyui-install.sh new file mode 100644 index 000000000..eef442481 --- /dev/null +++ b/install/comfyui-install.sh @@ -0,0 +1,506 @@ +#!/usr/bin/env bash + +# Copyright (c) 2021-2025 community-scripts ORG +# Author: jdacode +# License: MIT | https://github.com/community-scripts/ProxmoxVE/raw/main/LICENSE +# Source: https://github.com/comfyanonymous/ComfyUI + +# Import Functions und Setup +source /dev/stdin <<<"$FUNCTIONS_FILE_PATH" +color +verb_ip6 +catch_errors +setting_up_container +network_check +update_os + + + +# Installing Dependencies +msg_info "Installing Dependencies" +$STD apt-get install -y \ + git \ + nvtop +msg_ok "Installed Dependencies" + + + +# Default configuration variables +# NO Configurable variables +application_name="${APPLICATION}" +app_path="/opt/${application_name}" +python_path="${app_path}/venv/bin/python" + +# Configurable variables +skip_user_config="${skip_user_config:-N}" +# Versions +comfyui_version="${comfyui_version:-latest}" +python_version_uv="${python_version_uv:-3.12}" +# Python main.py arguments +port_arg="${port_arg:-8188}" +comfyui_python_net_args="--listen" +comfyui_python_port_args="--port ${port_arg}" +comfyui_python_args="${comfyui_python_args:---cpu}" +# GPU Settings +gpu_type="${gpu_type:-None}" +comfyui_python_index_url_nvidia="${comfyui_python_index_url_nvidia:-https://download.pytorch.org/whl/cu128}" +comfyui_python_index_url_amd="${comfyui_python_index_url_amd:-https://download.pytorch.org/whl/rocm6.3}" +comfyui_python_index_url_intel="${comfyui_python_index_url_intel:-https://download.pytorch.org/whl/xpu}" +# ComfyUI Manager +comfyui_manager_enabled="${comfyui_manager_enabled:-Y}" +comfyui_manager_version="${comfyui_manager_version:-latest}" + + + + +# Current configuration variables +current_settings_info() { + echo + echo "${TAB3}${TAB3}Current configuration summary:" + echo "${TAB3}${TAB3}-------------------------------" + echo "${TAB3}${TAB3}${TAB3}ComfyUI version : ${comfyui_version}" + echo "${TAB3}${TAB3}${TAB3}GPU : ${gpu_type}" + echo "${TAB3}${TAB3}${TAB3}Python version (uv) : ${python_version_uv}" + echo "${TAB3}${TAB3}${TAB3}Port : ${port_arg}" + echo "${TAB3}${TAB3}${TAB3}ComfyUI python args : ${comfyui_python_args}" + echo "${TAB3}${TAB3}${TAB3}ComfyUI Manager : ${comfyui_manager_enabled}" + echo "${TAB3}${TAB3}${TAB3}ComfyUI Manager Version : ${comfyui_manager_version}" + echo "${TAB3}${TAB3}${TAB3}Preview ExecStart command : main.py ${comfyui_python_net_args} ${comfyui_python_port_args} ${comfyui_python_args}" + echo +} + + + +# GPU selection +select_gpu_type() { + # Determine default based on current gpu_type + case "${gpu_type}" in + "None") default_choice=1 ;; + "NVIDIA") default_choice=2 ;; + "AMD") default_choice=3 ;; + "Intel") default_choice=4 ;; + *) default_choice=1 ;; # fallback default + esac + + while true; do + echo + echo "${TAB3}${TAB3}Choose the GPU type for ComfyUI:" + echo "${TAB3}${TAB3}-------------------------------" + echo "${TAB3}${TAB3}${TAB3} 1. None" + echo "${TAB3}${TAB3}${TAB3} 2. NVIDIA" + echo "${TAB3}${TAB3}${TAB3} 3. AMD" + echo "${TAB3}${TAB3}${TAB3} 4. Intel" + echo + read -rp "${TAB3}${TAB3}${TAB3}Enter your choice [1-4] (Current: ${default_choice}. ${gpu_type}): " gpu_choice + gpu_choice=${gpu_choice:-$default_choice} + case "$gpu_choice" in + 1) gpu_type="None"; break ;; + 2) gpu_type="NVIDIA"; break ;; + 3) gpu_type="AMD"; break ;; + 4) gpu_type="Intel"; break ;; + *) echo "${TAB3}${TAB3}${TAB3}${TAB3}Invalid choice. Please enter a number between 1 and 4." ;; + esac + done +} + + + +# ComfyUI version +set_comfyui_version() { + while true; do + echo + read -re -i "${comfyui_version}" -p "${TAB3}${TAB3}Enter ComfyUI version (e.g. v0.3.49 or 'latest') [Current: ${comfyui_version}]: " input_version + input_version=${input_version:-$comfyui_version} + if [[ "$input_version" == "latest" || "$input_version" =~ ^v[0-9]+\.[0-9]+\.[0-9]+$ ]]; then + comfyui_version="$input_version" + break + else + echo "${TAB3}${TAB3}${TAB3}${TAB3}Invalid input. Use 'latest' or a version like v0.3.49." + fi + done +} + + + +# Python version +set_python_version() { + read -re -i "${python_version_uv}" -p "${TAB3}${TAB3}Enter Python version (uv) [Current: ${python_version_uv}]: " input_python + python_version_uv=${input_python:-$python_version_uv} +} + + + +# Port number +set_port_number() { + while true; do + echo + read -re -i "${port_arg}" -p "${TAB3}${TAB3}Enter port number [Current: ${port_arg}]: " input_port + input_port=${input_port:-$port_arg} + if [[ "$input_port" =~ ^[0-9]+$ ]]; then + port_arg="$input_port" + comfyui_python_port_args="--port ${port_arg}" + break + else + echo "${TAB3}${TAB3}${TAB3}${TAB3}Invalid port. Must be a number." + fi + done +} + + + +# ComfyUI arguments +set_comfyui_args() { + read -re -i "${comfyui_python_args}" -p "${TAB3}${TAB3}Enter ComfyUI python args. (e.g. --gpu-only) [Current: ${comfyui_python_args}]: " input_args + comfyui_python_args=${input_args} +} + + + +# Set ComfyUI manager +set_comfyui_manager() { + while true; do + echo + read -re -i "${comfyui_manager_enabled}" -p "${TAB3}${TAB3}Enable ComfyUI-Manager? [Y/n] (Current: ${comfyui_manager_enabled}): " input_manager + input_manager=${input_manager:-$comfyui_manager_enabled} + case "${input_manager,,}" in + [Yy]) + comfyui_manager_enabled="Y" + break + ;; + [Nn]) + comfyui_manager_enabled="N" + break + ;; + *) + echo "${TAB3}${TAB3}${TAB3}Please enter Y/y or N/n." + ;; + esac + done +} + + + +# ComfyUI Manager version +set_comfyui_manager_version() { + if [[ "${comfyui_manager_enabled}" == "Y" ]]; then + while true; do + echo + read -re -i "${comfyui_manager_version}" -p "${TAB3}${TAB3}Enter ComfyUI Manager version (e.g. 3.35 or 'latest' ) [Current: ${comfyui_manager_version}]: " input_version + input_version=${input_version:-$comfyui_manager_version} + if [[ "$input_version" == "latest" || "$input_version" =~ ^[0-9]+\.[0-9]+(\.[0-9]+)?$ ]]; then + comfyui_manager_version="$input_version" + break + else + echo "${TAB3}${TAB3}${TAB3}${TAB3}Invalid input. Use 'latest' or a version like 3.35." + fi + done + fi +} + + + +# Installation ComfyUI Manager +install_comfyui_manager() { + # Define the target directory + local custom_nodes_dir="${app_path}/custom_nodes" + local comfyui_manager_dir="${custom_nodes_dir}/comfyui-manager" + + # Check if the directory exists + if [[ ! -d "${custom_nodes_dir}" ]]; then + echo "${TAB3}${TAB3}${TAB3}Error: Directory not found: ${custom_nodes_dir}" + return 1 + fi + + if [[ -d "${comfyui_manager_dir}" ]]; then + echo "${TAB3}${TAB3}${TAB3}ComfyUI-Manager already exists. Skipping installation." + else + if [[ "${comfyui_manager_version}" == "latest" ]]; then + # Clone the manager + git clone https://github.com/ltdrdata/ComfyUI-Manager "${comfyui_manager_dir}" + else + # Download Release + curl -fsSL -o "${comfyui_manager_version}.zip" "https://github.com/Comfy-Org/ComfyUI-Manager/archive/refs/tags/${comfyui_manager_version}.zip" + # Unzip Release + unzip -q "${comfyui_manager_version}.zip" + # Move and rename + mv "ComfyUI-Manager-${comfyui_manager_version}" "${comfyui_manager_dir}" + # Clean up the zip file + rm -f "${comfyui_manager_version}.zip" + fi + # Install Manager dependencies with uv + $STD uv pip install -r "${comfyui_manager_dir}/requirements.txt" --python="${python_path}" + fi +} + + + +# Confirm configuration +confirm_configuration() { + while true; do + echo + echo + read -rp "${TAB3}${TAB3}${TAB3}Do you want to keep this configuration? [Y/n]: " CONFIG_CONFIRM + CONFIG_CONFIRM=${CONFIG_CONFIRM:-y} + + case "$CONFIG_CONFIRM" in + [Yy]) + echo "${TAB3}${TAB3}${TAB3}${TAB3}Current configuration accepted." + break + ;; + [Nn]) + echo "${TAB3}${TAB3}${TAB3}${TAB3}Switching to advanced configuration..." + break + ;; + *) + echo "${TAB3}${TAB3}${TAB3}${TAB3}Please enter Y/y or N/n." + ;; + esac + done +} + + + +# Division line +division_line() { + echo + echo + echo "${TAB3}==============================================================" + echo +} + + + +# Advanced configuration wrapper +advanced_config() { + select_gpu_type + division_line + set_comfyui_version + division_line + set_python_version + division_line + set_port_number + division_line + set_comfyui_args + division_line + set_comfyui_manager + division_line + set_comfyui_manager_version +} + + +# Notification +notification() { + echo + echo "You can always skip manual configuration by using dynamic variables. For example:" + echo + echo "skip_user_config=\"Y|y|N|n\" \\" + echo "comfyui_version=\"latest|v0.3.49\" \\" + echo "python_version_uv=\"${python_version_uv}\" \\" + echo "port_arg=\"${port_arg}\" \\" + echo "comfyui_python_args=\"${comfyui_python_args}\" \\" + echo "gpu_type=\"None|NVIDIA|AMD|Intel\" \\" + echo "comfyui_python_index_url_nvidia=\"${comfyui_python_index_url_nvidia}\" \\" + echo "comfyui_python_index_url_amd=\"${comfyui_python_index_url_amd}\" \\" + echo "comfyui_python_index_url_intel=\"${comfyui_python_index_url_intel}\" \\" + echo "comfyui_manager_enabled=\"Y|y|N|n\" \\" + echo "comfyui_manager_version=\"latest|3.35\" \\" + echo "bash -c \"\$(curl -fsSL https://raw.githubusercontent.com/community-scripts/ProxmoxVE/main/ct/comfyui.sh)\"" + echo +} + + +# Notification2 +notification2() { + echo + echo "You can reuse the same configuration by defining dynamic variables, using the following command:" + echo + echo "skip_user_config=\"Y\" \\" + echo "comfyui_version=\"${comfyui_version}\" \\" + echo "python_version_uv=\"${python_version_uv}\" \\" + echo "port_arg=\"${port_arg}\" \\" + echo "comfyui_python_args=\"${comfyui_python_args}\" \\" + echo "gpu_type=\"${gpu_type}\" \\" + gpu_type_noti="${gpu_type,,}" + if [[ "$gpu_type_noti" == "nvidia" ]]; then + echo "comfyui_python_index_url_nvidia=\"${comfyui_python_index_url_nvidia}\" \\" + elif [[ "$gpu_type_noti" == "amd" ]]; then + echo "comfyui_python_index_url_amd=\"${comfyui_python_index_url_amd}\" \\" + elif [[ "$gpu_type_noti" == "intel" ]]; then + echo "comfyui_python_index_url_intel=\"${comfyui_python_index_url_intel}\" \\" + fi + echo "comfyui_manager_enabled=\"${comfyui_manager_enabled}\" \\" + echo "comfyui_manager_version=\"${comfyui_manager_version}\" \\" + echo "bash -c \"\$(curl -fsSL https://raw.githubusercontent.com/community-scripts/ProxmoxVE/main/ct/comfyui.sh)\"" + echo +} + + + +# User configuration menu +division_line +notification +division_line +if ! [[ "$skip_user_config" =~ ^[Yy]$ ]]; then + # Basic config + msg_info "${application_name} configuration" + division_line + select_gpu_type + # Advanced config loop until config_confirm_clean is "n" + while true; do + division_line + current_settings_info + confirm_configuration + division_line + config_confirm_clean=${CONFIG_CONFIRM,,} + if [[ "$config_confirm_clean" == "n" ]]; then + # Advanced config + advanced_config + else + break + fi + done + msg_ok "${application_name} configuration" + division_line + notification2 + division_line + else + echo "Skipping user config" + division_line +fi + + + +# Display current configuration variables +echo -e "${CM}${BOLD}${DGN}Skip User Config : ${BGN}${skip_user_config}${CL}" +echo -e "${CM}${BOLD}${DGN}Application name : ${BGN}${application_name}${CL}" +echo -e "${CM}${BOLD}${DGN}Application path : ${BGN}${app_path}${CL}" +echo -e "${CM}${BOLD}${DGN}ComfyUI version : ${BGN}${comfyui_version}${CL}" +echo -e "${CM}${BOLD}${DGN}GPU : ${BGN}${gpu_type}${CL}" +echo -e "${CM}${BOLD}${DGN}Port : ${BGN}${port_arg}${CL}" +echo -e "${CM}${BOLD}${DGN}ComfyUI Manager : ${BGN}${comfyui_manager_enabled}${CL}" +echo -e "${CM}${BOLD}${DGN}ComfyUI Manager Version : ${BGN}${comfyui_manager_version}${CL}" +echo -e "${CM}${BOLD}${DGN}Python version (uv) : ${BGN}${python_version_uv}${CL}" +echo -e "${CM}${BOLD}${DGN}Python path (uv) : ${BGN}${python_path}${CL}" +echo -e "${CM}${BOLD}${DGN}ComfyUI python args : ${BGN}${comfyui_python_args}${CL}" +echo -e "${CM}${BOLD}${DGN}Pip Nvidia index-url : ${BGN}${comfyui_python_index_url_nvidia}${CL}" +echo -e "${CM}${BOLD}${DGN}Pip AMD index-url : ${BGN}${comfyui_python_index_url_amd}${CL}" +echo -e "${CM}${BOLD}${DGN}Pip Intel index-url : ${BGN}${comfyui_python_index_url_intel}${CL}" +echo -e "${CM}${BOLD}${DGN}Preview ExecStart command : ${BGN}main.py ${comfyui_python_net_args} ${comfyui_python_port_args} ${comfyui_python_args}${CL}" + + + +# ComfyUI installation start from here! +# Installs uv +msg_info "Setup uv" +PYTHON_VERSION="${python_version_uv}" setup_uv +msg_ok "Setup uv" + + + +# Comfy Version +msg_info "Setup ${application_name}" +if [[ "$comfyui_version" == "latest" ]]; then + echo "Version is set to 'latest'; skipping version check." + RELEASE=$(curl -fsSL https://api.github.com/repos/comfyanonymous/ComfyUI/releases/latest | grep "tag_name" | awk '{print substr($2, 2, length($2)-3) }') +else + RELEASE="$comfyui_version" +fi +msg_ok "Setup ${application_name}" + + + +# Comfy Release +msg_info "Installing ComfyUI version: ${RELEASE}" +curl -fsSL -o "${application_name}.zip" "https://github.com/comfyanonymous/ComfyUI/archive/refs/tags/${RELEASE}.zip" +unzip -q "${application_name}.zip" +# Remove v +CLEAN_RELEASE="${RELEASE//v/}" +# Move app to opt +mv "${application_name}-${CLEAN_RELEASE}/" "${app_path}" +echo "${RELEASE}" >/opt/"${application_name}"_version.txt +msg_ok "Installed ComfyUI version: ${RELEASE}" + + + +# Dependencies +msg_info "Python dependencies" +$STD uv venv "${app_path}/venv" +gpu_type="${gpu_type,,}" +if [[ "$gpu_type" == "nvidia" ]]; then + echo "NVIDIA GPU selected" + $STD uv pip install \ + torch \ + torchvision \ + torchaudio \ + --extra-index-url "${comfyui_python_index_url_nvidia}" \ + --python="${python_path}" +elif [[ "$gpu_type" == "amd" ]]; then + echo "AMD GPU selected" + $STD uv pip install \ + torch \ + torchvision \ + torchaudio \ + --index-url "${comfyui_python_index_url_amd}" \ + --python="${python_path}" +elif [[ "$gpu_type" == "intel" ]]; then + echo "Intel GPU selected" + $STD uv pip install \ + torch \ + torchvision \ + torchaudio \ + --index-url "${comfyui_python_index_url_intel}" \ + --python="${python_path}" +else + echo "No GPU selected" +fi +$STD uv pip install -r "${app_path}/requirements.txt" --python="${python_path}" +msg_ok "Python dependencies" + + + +# Comfyui manager installation +if [[ "${comfyui_manager_enabled}" =~ ^[Yy]$ ]]; then + msg_info "Install ${application_name} Manager" + install_comfyui_manager + msg_ok "Installed ${application_name} Manager" +else + msg_error "No installed ${application_name} Manager" +fi + + + +# Creating Service +msg_info "Creating Service" +cat </etc/systemd/system/"${application_name}".service +[Unit] +Description=${application_name} Service +After=network.target + +[Service] +Type=simple +User=root +WorkingDirectory=${app_path} +ExecStart=${python_path} ${app_path}/main.py ${comfyui_python_net_args} ${comfyui_python_port_args} ${comfyui_python_args} +Restart=on-failure + +[Install] +WantedBy=multi-user.target +EOF +systemctl enable -q --now "${application_name}" +msg_ok "Created Service" + + + +motd_ssh +customize + + + +# Cleanup +msg_info "Cleaning up" +rm -f "${application_name}".zip +$STD apt-get -y autoremove +$STD apt-get -y autoclean +msg_ok "Cleaned" + + diff --git a/misc/build.func b/misc/build.func index c40a57bd1..c95722057 100644 --- a/misc/build.func +++ b/misc/build.func @@ -16,14 +16,14 @@ variables() { CT_TYPE=${var_unprivileged:-$CT_TYPE} } -source <(curl -fsSL https://git.community-scripts.org/community-scripts/ProxmoxVED/raw/branch/main/misc/api.func) +source <(curl -fsSL https://raw.githubusercontent.com/jdacode/ProxmoxVED/refs/heads/comfyui/misc/api.func) if command -v curl >/dev/null 2>&1; then - source <(curl -fsSL https://git.community-scripts.org/community-scripts/ProxmoxVED/raw/branch/main/misc/core.func) + source <(curl -fsSL https://raw.githubusercontent.com/jdacode/ProxmoxVED/refs/heads/comfyui/misc/core.func) load_functions #echo "(build.func) Loaded core.func via curl" elif command -v wget >/dev/null 2>&1; then - source <(wget -qO- https://git.community-scripts.org/community-scripts/ProxmoxVED/raw/branch/main/misc/core.func) + source <(wget -qO- https://raw.githubusercontent.com/jdacode/ProxmoxVED/refs/heads/comfyui/misc/core.func) load_functions #echo "(build.func) Loaded core.func via wget" fi @@ -988,7 +988,7 @@ install_script() { header_info echo -e "${INFO}${HOLD} ${GN}Using Config File on node $PVEHOST_NAME${CL}" METHOD="advanced" - source <(curl -fsSL https://git.community-scripts.org/community-scripts/ProxmoxVED/raw/branch/main/misc/config-file.func) + source <(curl -fsSL https://raw.githubusercontent.com/jdacode/ProxmoxVED/refs/heads/comfyui/misc/config-file.func) config_file ;; 5) @@ -1061,7 +1061,7 @@ check_container_storage() { } start() { - source <(curl -fsSL https://git.community-scripts.org/community-scripts/ProxmoxVED/raw/branch/main/misc/tools.func) + source <(curl -fsSL https://raw.githubusercontent.com/jdacode/ProxmoxVED/refs/heads/comfyui/misc/tools.func) if command -v pveversion >/dev/null 2>&1; then install_script elif [ ! -z ${PHS_SILENT+x} ] && [[ "${PHS_SILENT}" == "1" ]]; then @@ -1127,9 +1127,9 @@ build_container() { TEMP_DIR=$(mktemp -d) pushd "$TEMP_DIR" >/dev/null if [ "$var_os" == "alpine" ]; then - export FUNCTIONS_FILE_PATH="$(curl -fsSL https://git.community-scripts.org/community-scripts/ProxmoxVED/raw/branch/main/misc/alpine-install.func)" + export FUNCTIONS_FILE_PATH="$(curl -fsSL https://raw.githubusercontent.com/jdacode/ProxmoxVED/refs/heads/comfyui/misc/alpine-install.func)" else - export FUNCTIONS_FILE_PATH="$(curl -fsSL https://git.community-scripts.org/community-scripts/ProxmoxVED/raw/branch/main/misc/install.func)" + export FUNCTIONS_FILE_PATH="$(curl -fsSL https://raw.githubusercontent.com/jdacode/ProxmoxVED/refs/heads/comfyui/misc/install.func)" fi export DIAGNOSTICS="$DIAGNOSTICS" export RANDOM_UUID="$RANDOM_UUID" @@ -1163,7 +1163,7 @@ build_container() { -unprivileged $CT_TYPE $PW " - bash -c "$(curl -fsSL https://git.community-scripts.org/community-scripts/ProxmoxVED/raw/branch/main/misc/create_lxc.sh)" || exit + bash -c "$(curl -fsSL https://raw.githubusercontent.com/jdacode/ProxmoxVED/refs/heads/comfyui/misc/create_lxc.sh)" || exit if [ $? -ne 0 ]; then exit 200 fi @@ -1465,7 +1465,7 @@ description() { cat < - Logo + Logo

${APP} LXC

diff --git a/misc/install.func b/misc/install.func index e3751c295..8b835d0a7 100644 --- a/misc/install.func +++ b/misc/install.func @@ -10,7 +10,7 @@ if ! command -v curl >/dev/null 2>&1; then apt-get update >/dev/null 2>&1 apt-get install -y curl >/dev/null 2>&1 fi -source <(curl -fsSL https://git.community-scripts.org/community-scripts/ProxmoxVED/raw/branch/main/misc/core.func) +source <(curl -fsSL https://raw.githubusercontent.com/jdacode/ProxmoxVED/refs/heads/comfyui/misc/core.func) load_functions # This function enables IPv6 if it's not disabled and sets verbose mode @@ -148,7 +148,7 @@ EOF $STD apt-get -o Dpkg::Options::="--force-confold" -y dist-upgrade rm -rf /usr/lib/python3.*/EXTERNALLY-MANAGED msg_ok "Updated Container OS" - source <(curl -fsSL https://git.community-scripts.org/community-scripts/ProxmoxVED/raw/branch/main/misc/tools.func) + source <(curl -fsSL https://raw.githubusercontent.com/jdacode/ProxmoxVED/refs/heads/comfyui/misc/tools.func) } # This function modifies the message of the day (motd) and SSH settings From ea7298b7df31691626ae8a37f1115a2ea474d25c Mon Sep 17 00:00:00 2001 From: jdacode <49216638+jdacode@users.noreply.github.com> Date: Tue, 19 Aug 2025 14:31:45 +0930 Subject: [PATCH 02/12] Fixed url build.func testing --- misc/build.func | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/misc/build.func b/misc/build.func index c95722057..ec1d8dbb3 100644 --- a/misc/build.func +++ b/misc/build.func @@ -1438,7 +1438,7 @@ EOF' fi msg_ok "Customized LXC Container" - lxc-attach -n "$CTID" -- bash -c "$(curl -fsSL https://raw.githubusercontent.com/community-scripts/ProxmoxVED/main/install/${var_install}.sh)" + lxc-attach -n "$CTID" -- bash -c "$(curl -fsSL https://raw.githubusercontent.com/jdacode/ProxmoxVED/refs/heads/comfyui/install/${var_install}.sh)" } destroy_lxc() { From dc955995413b25614fd3c37a97141d41b1a1b20c Mon Sep 17 00:00:00 2001 From: jdacode <49216638+jdacode@users.noreply.github.com> Date: Tue, 19 Aug 2025 14:53:58 +0930 Subject: [PATCH 03/12] Revert urls --- ct/comfyui.sh | 2 +- misc/build.func | 20 ++++++++++---------- misc/install.func | 4 ++-- 3 files changed, 13 insertions(+), 13 deletions(-) diff --git a/ct/comfyui.sh b/ct/comfyui.sh index 5206e0741..f8ed4e182 100644 --- a/ct/comfyui.sh +++ b/ct/comfyui.sh @@ -1,5 +1,5 @@ #!/usr/bin/env bash -source <(curl -fsSL https://raw.githubusercontent.com/jdacode/ProxmoxVED/refs/heads/comfyui/misc/build.func) +source <(curl -fsSL https://git.community-scripts.org/community-scripts/ProxmoxVED/raw/branch/main/misc/build.func) # Copyright (c) 2021-2025 community-scripts ORG # Author: jdacode # License: MIT | https://github.com/community-scripts/ProxmoxVE/raw/main/LICENSE diff --git a/misc/build.func b/misc/build.func index ec1d8dbb3..c40a57bd1 100644 --- a/misc/build.func +++ b/misc/build.func @@ -16,14 +16,14 @@ variables() { CT_TYPE=${var_unprivileged:-$CT_TYPE} } -source <(curl -fsSL https://raw.githubusercontent.com/jdacode/ProxmoxVED/refs/heads/comfyui/misc/api.func) +source <(curl -fsSL https://git.community-scripts.org/community-scripts/ProxmoxVED/raw/branch/main/misc/api.func) if command -v curl >/dev/null 2>&1; then - source <(curl -fsSL https://raw.githubusercontent.com/jdacode/ProxmoxVED/refs/heads/comfyui/misc/core.func) + source <(curl -fsSL https://git.community-scripts.org/community-scripts/ProxmoxVED/raw/branch/main/misc/core.func) load_functions #echo "(build.func) Loaded core.func via curl" elif command -v wget >/dev/null 2>&1; then - source <(wget -qO- https://raw.githubusercontent.com/jdacode/ProxmoxVED/refs/heads/comfyui/misc/core.func) + source <(wget -qO- https://git.community-scripts.org/community-scripts/ProxmoxVED/raw/branch/main/misc/core.func) load_functions #echo "(build.func) Loaded core.func via wget" fi @@ -988,7 +988,7 @@ install_script() { header_info echo -e "${INFO}${HOLD} ${GN}Using Config File on node $PVEHOST_NAME${CL}" METHOD="advanced" - source <(curl -fsSL https://raw.githubusercontent.com/jdacode/ProxmoxVED/refs/heads/comfyui/misc/config-file.func) + source <(curl -fsSL https://git.community-scripts.org/community-scripts/ProxmoxVED/raw/branch/main/misc/config-file.func) config_file ;; 5) @@ -1061,7 +1061,7 @@ check_container_storage() { } start() { - source <(curl -fsSL https://raw.githubusercontent.com/jdacode/ProxmoxVED/refs/heads/comfyui/misc/tools.func) + source <(curl -fsSL https://git.community-scripts.org/community-scripts/ProxmoxVED/raw/branch/main/misc/tools.func) if command -v pveversion >/dev/null 2>&1; then install_script elif [ ! -z ${PHS_SILENT+x} ] && [[ "${PHS_SILENT}" == "1" ]]; then @@ -1127,9 +1127,9 @@ build_container() { TEMP_DIR=$(mktemp -d) pushd "$TEMP_DIR" >/dev/null if [ "$var_os" == "alpine" ]; then - export FUNCTIONS_FILE_PATH="$(curl -fsSL https://raw.githubusercontent.com/jdacode/ProxmoxVED/refs/heads/comfyui/misc/alpine-install.func)" + export FUNCTIONS_FILE_PATH="$(curl -fsSL https://git.community-scripts.org/community-scripts/ProxmoxVED/raw/branch/main/misc/alpine-install.func)" else - export FUNCTIONS_FILE_PATH="$(curl -fsSL https://raw.githubusercontent.com/jdacode/ProxmoxVED/refs/heads/comfyui/misc/install.func)" + export FUNCTIONS_FILE_PATH="$(curl -fsSL https://git.community-scripts.org/community-scripts/ProxmoxVED/raw/branch/main/misc/install.func)" fi export DIAGNOSTICS="$DIAGNOSTICS" export RANDOM_UUID="$RANDOM_UUID" @@ -1163,7 +1163,7 @@ build_container() { -unprivileged $CT_TYPE $PW " - bash -c "$(curl -fsSL https://raw.githubusercontent.com/jdacode/ProxmoxVED/refs/heads/comfyui/misc/create_lxc.sh)" || exit + bash -c "$(curl -fsSL https://git.community-scripts.org/community-scripts/ProxmoxVED/raw/branch/main/misc/create_lxc.sh)" || exit if [ $? -ne 0 ]; then exit 200 fi @@ -1438,7 +1438,7 @@ EOF' fi msg_ok "Customized LXC Container" - lxc-attach -n "$CTID" -- bash -c "$(curl -fsSL https://raw.githubusercontent.com/jdacode/ProxmoxVED/refs/heads/comfyui/install/${var_install}.sh)" + lxc-attach -n "$CTID" -- bash -c "$(curl -fsSL https://raw.githubusercontent.com/community-scripts/ProxmoxVED/main/install/${var_install}.sh)" } destroy_lxc() { @@ -1465,7 +1465,7 @@ description() { cat < - Logo + Logo

${APP} LXC

diff --git a/misc/install.func b/misc/install.func index 8b835d0a7..e3751c295 100644 --- a/misc/install.func +++ b/misc/install.func @@ -10,7 +10,7 @@ if ! command -v curl >/dev/null 2>&1; then apt-get update >/dev/null 2>&1 apt-get install -y curl >/dev/null 2>&1 fi -source <(curl -fsSL https://raw.githubusercontent.com/jdacode/ProxmoxVED/refs/heads/comfyui/misc/core.func) +source <(curl -fsSL https://git.community-scripts.org/community-scripts/ProxmoxVED/raw/branch/main/misc/core.func) load_functions # This function enables IPv6 if it's not disabled and sets verbose mode @@ -148,7 +148,7 @@ EOF $STD apt-get -o Dpkg::Options::="--force-confold" -y dist-upgrade rm -rf /usr/lib/python3.*/EXTERNALLY-MANAGED msg_ok "Updated Container OS" - source <(curl -fsSL https://raw.githubusercontent.com/jdacode/ProxmoxVED/refs/heads/comfyui/misc/tools.func) + source <(curl -fsSL https://git.community-scripts.org/community-scripts/ProxmoxVED/raw/branch/main/misc/tools.func) } # This function modifies the message of the day (motd) and SSH settings From ffd1b12322df5201eb7b2c9ba62fc5e029a585f6 Mon Sep 17 00:00:00 2001 From: jdacode <49216638+jdacode@users.noreply.github.com> Date: Tue, 19 Aug 2025 16:29:42 +0930 Subject: [PATCH 04/12] Removed subfunctions --- install/comfyui-install.sh | 318 ------------------------------------- misc/build.func | 20 +-- misc/install.func | 4 +- 3 files changed, 12 insertions(+), 330 deletions(-) diff --git a/install/comfyui-install.sh b/install/comfyui-install.sh index eef442481..58f51cb1a 100644 --- a/install/comfyui-install.sh +++ b/install/comfyui-install.sh @@ -52,324 +52,6 @@ comfyui_manager_version="${comfyui_manager_version:-latest}" - -# Current configuration variables -current_settings_info() { - echo - echo "${TAB3}${TAB3}Current configuration summary:" - echo "${TAB3}${TAB3}-------------------------------" - echo "${TAB3}${TAB3}${TAB3}ComfyUI version : ${comfyui_version}" - echo "${TAB3}${TAB3}${TAB3}GPU : ${gpu_type}" - echo "${TAB3}${TAB3}${TAB3}Python version (uv) : ${python_version_uv}" - echo "${TAB3}${TAB3}${TAB3}Port : ${port_arg}" - echo "${TAB3}${TAB3}${TAB3}ComfyUI python args : ${comfyui_python_args}" - echo "${TAB3}${TAB3}${TAB3}ComfyUI Manager : ${comfyui_manager_enabled}" - echo "${TAB3}${TAB3}${TAB3}ComfyUI Manager Version : ${comfyui_manager_version}" - echo "${TAB3}${TAB3}${TAB3}Preview ExecStart command : main.py ${comfyui_python_net_args} ${comfyui_python_port_args} ${comfyui_python_args}" - echo -} - - - -# GPU selection -select_gpu_type() { - # Determine default based on current gpu_type - case "${gpu_type}" in - "None") default_choice=1 ;; - "NVIDIA") default_choice=2 ;; - "AMD") default_choice=3 ;; - "Intel") default_choice=4 ;; - *) default_choice=1 ;; # fallback default - esac - - while true; do - echo - echo "${TAB3}${TAB3}Choose the GPU type for ComfyUI:" - echo "${TAB3}${TAB3}-------------------------------" - echo "${TAB3}${TAB3}${TAB3} 1. None" - echo "${TAB3}${TAB3}${TAB3} 2. NVIDIA" - echo "${TAB3}${TAB3}${TAB3} 3. AMD" - echo "${TAB3}${TAB3}${TAB3} 4. Intel" - echo - read -rp "${TAB3}${TAB3}${TAB3}Enter your choice [1-4] (Current: ${default_choice}. ${gpu_type}): " gpu_choice - gpu_choice=${gpu_choice:-$default_choice} - case "$gpu_choice" in - 1) gpu_type="None"; break ;; - 2) gpu_type="NVIDIA"; break ;; - 3) gpu_type="AMD"; break ;; - 4) gpu_type="Intel"; break ;; - *) echo "${TAB3}${TAB3}${TAB3}${TAB3}Invalid choice. Please enter a number between 1 and 4." ;; - esac - done -} - - - -# ComfyUI version -set_comfyui_version() { - while true; do - echo - read -re -i "${comfyui_version}" -p "${TAB3}${TAB3}Enter ComfyUI version (e.g. v0.3.49 or 'latest') [Current: ${comfyui_version}]: " input_version - input_version=${input_version:-$comfyui_version} - if [[ "$input_version" == "latest" || "$input_version" =~ ^v[0-9]+\.[0-9]+\.[0-9]+$ ]]; then - comfyui_version="$input_version" - break - else - echo "${TAB3}${TAB3}${TAB3}${TAB3}Invalid input. Use 'latest' or a version like v0.3.49." - fi - done -} - - - -# Python version -set_python_version() { - read -re -i "${python_version_uv}" -p "${TAB3}${TAB3}Enter Python version (uv) [Current: ${python_version_uv}]: " input_python - python_version_uv=${input_python:-$python_version_uv} -} - - - -# Port number -set_port_number() { - while true; do - echo - read -re -i "${port_arg}" -p "${TAB3}${TAB3}Enter port number [Current: ${port_arg}]: " input_port - input_port=${input_port:-$port_arg} - if [[ "$input_port" =~ ^[0-9]+$ ]]; then - port_arg="$input_port" - comfyui_python_port_args="--port ${port_arg}" - break - else - echo "${TAB3}${TAB3}${TAB3}${TAB3}Invalid port. Must be a number." - fi - done -} - - - -# ComfyUI arguments -set_comfyui_args() { - read -re -i "${comfyui_python_args}" -p "${TAB3}${TAB3}Enter ComfyUI python args. (e.g. --gpu-only) [Current: ${comfyui_python_args}]: " input_args - comfyui_python_args=${input_args} -} - - - -# Set ComfyUI manager -set_comfyui_manager() { - while true; do - echo - read -re -i "${comfyui_manager_enabled}" -p "${TAB3}${TAB3}Enable ComfyUI-Manager? [Y/n] (Current: ${comfyui_manager_enabled}): " input_manager - input_manager=${input_manager:-$comfyui_manager_enabled} - case "${input_manager,,}" in - [Yy]) - comfyui_manager_enabled="Y" - break - ;; - [Nn]) - comfyui_manager_enabled="N" - break - ;; - *) - echo "${TAB3}${TAB3}${TAB3}Please enter Y/y or N/n." - ;; - esac - done -} - - - -# ComfyUI Manager version -set_comfyui_manager_version() { - if [[ "${comfyui_manager_enabled}" == "Y" ]]; then - while true; do - echo - read -re -i "${comfyui_manager_version}" -p "${TAB3}${TAB3}Enter ComfyUI Manager version (e.g. 3.35 or 'latest' ) [Current: ${comfyui_manager_version}]: " input_version - input_version=${input_version:-$comfyui_manager_version} - if [[ "$input_version" == "latest" || "$input_version" =~ ^[0-9]+\.[0-9]+(\.[0-9]+)?$ ]]; then - comfyui_manager_version="$input_version" - break - else - echo "${TAB3}${TAB3}${TAB3}${TAB3}Invalid input. Use 'latest' or a version like 3.35." - fi - done - fi -} - - - -# Installation ComfyUI Manager -install_comfyui_manager() { - # Define the target directory - local custom_nodes_dir="${app_path}/custom_nodes" - local comfyui_manager_dir="${custom_nodes_dir}/comfyui-manager" - - # Check if the directory exists - if [[ ! -d "${custom_nodes_dir}" ]]; then - echo "${TAB3}${TAB3}${TAB3}Error: Directory not found: ${custom_nodes_dir}" - return 1 - fi - - if [[ -d "${comfyui_manager_dir}" ]]; then - echo "${TAB3}${TAB3}${TAB3}ComfyUI-Manager already exists. Skipping installation." - else - if [[ "${comfyui_manager_version}" == "latest" ]]; then - # Clone the manager - git clone https://github.com/ltdrdata/ComfyUI-Manager "${comfyui_manager_dir}" - else - # Download Release - curl -fsSL -o "${comfyui_manager_version}.zip" "https://github.com/Comfy-Org/ComfyUI-Manager/archive/refs/tags/${comfyui_manager_version}.zip" - # Unzip Release - unzip -q "${comfyui_manager_version}.zip" - # Move and rename - mv "ComfyUI-Manager-${comfyui_manager_version}" "${comfyui_manager_dir}" - # Clean up the zip file - rm -f "${comfyui_manager_version}.zip" - fi - # Install Manager dependencies with uv - $STD uv pip install -r "${comfyui_manager_dir}/requirements.txt" --python="${python_path}" - fi -} - - - -# Confirm configuration -confirm_configuration() { - while true; do - echo - echo - read -rp "${TAB3}${TAB3}${TAB3}Do you want to keep this configuration? [Y/n]: " CONFIG_CONFIRM - CONFIG_CONFIRM=${CONFIG_CONFIRM:-y} - - case "$CONFIG_CONFIRM" in - [Yy]) - echo "${TAB3}${TAB3}${TAB3}${TAB3}Current configuration accepted." - break - ;; - [Nn]) - echo "${TAB3}${TAB3}${TAB3}${TAB3}Switching to advanced configuration..." - break - ;; - *) - echo "${TAB3}${TAB3}${TAB3}${TAB3}Please enter Y/y or N/n." - ;; - esac - done -} - - - -# Division line -division_line() { - echo - echo - echo "${TAB3}==============================================================" - echo -} - - - -# Advanced configuration wrapper -advanced_config() { - select_gpu_type - division_line - set_comfyui_version - division_line - set_python_version - division_line - set_port_number - division_line - set_comfyui_args - division_line - set_comfyui_manager - division_line - set_comfyui_manager_version -} - - -# Notification -notification() { - echo - echo "You can always skip manual configuration by using dynamic variables. For example:" - echo - echo "skip_user_config=\"Y|y|N|n\" \\" - echo "comfyui_version=\"latest|v0.3.49\" \\" - echo "python_version_uv=\"${python_version_uv}\" \\" - echo "port_arg=\"${port_arg}\" \\" - echo "comfyui_python_args=\"${comfyui_python_args}\" \\" - echo "gpu_type=\"None|NVIDIA|AMD|Intel\" \\" - echo "comfyui_python_index_url_nvidia=\"${comfyui_python_index_url_nvidia}\" \\" - echo "comfyui_python_index_url_amd=\"${comfyui_python_index_url_amd}\" \\" - echo "comfyui_python_index_url_intel=\"${comfyui_python_index_url_intel}\" \\" - echo "comfyui_manager_enabled=\"Y|y|N|n\" \\" - echo "comfyui_manager_version=\"latest|3.35\" \\" - echo "bash -c \"\$(curl -fsSL https://raw.githubusercontent.com/community-scripts/ProxmoxVE/main/ct/comfyui.sh)\"" - echo -} - - -# Notification2 -notification2() { - echo - echo "You can reuse the same configuration by defining dynamic variables, using the following command:" - echo - echo "skip_user_config=\"Y\" \\" - echo "comfyui_version=\"${comfyui_version}\" \\" - echo "python_version_uv=\"${python_version_uv}\" \\" - echo "port_arg=\"${port_arg}\" \\" - echo "comfyui_python_args=\"${comfyui_python_args}\" \\" - echo "gpu_type=\"${gpu_type}\" \\" - gpu_type_noti="${gpu_type,,}" - if [[ "$gpu_type_noti" == "nvidia" ]]; then - echo "comfyui_python_index_url_nvidia=\"${comfyui_python_index_url_nvidia}\" \\" - elif [[ "$gpu_type_noti" == "amd" ]]; then - echo "comfyui_python_index_url_amd=\"${comfyui_python_index_url_amd}\" \\" - elif [[ "$gpu_type_noti" == "intel" ]]; then - echo "comfyui_python_index_url_intel=\"${comfyui_python_index_url_intel}\" \\" - fi - echo "comfyui_manager_enabled=\"${comfyui_manager_enabled}\" \\" - echo "comfyui_manager_version=\"${comfyui_manager_version}\" \\" - echo "bash -c \"\$(curl -fsSL https://raw.githubusercontent.com/community-scripts/ProxmoxVE/main/ct/comfyui.sh)\"" - echo -} - - - -# User configuration menu -division_line -notification -division_line -if ! [[ "$skip_user_config" =~ ^[Yy]$ ]]; then - # Basic config - msg_info "${application_name} configuration" - division_line - select_gpu_type - # Advanced config loop until config_confirm_clean is "n" - while true; do - division_line - current_settings_info - confirm_configuration - division_line - config_confirm_clean=${CONFIG_CONFIRM,,} - if [[ "$config_confirm_clean" == "n" ]]; then - # Advanced config - advanced_config - else - break - fi - done - msg_ok "${application_name} configuration" - division_line - notification2 - division_line - else - echo "Skipping user config" - division_line -fi - - - # Display current configuration variables echo -e "${CM}${BOLD}${DGN}Skip User Config : ${BGN}${skip_user_config}${CL}" echo -e "${CM}${BOLD}${DGN}Application name : ${BGN}${application_name}${CL}" diff --git a/misc/build.func b/misc/build.func index c40a57bd1..081cec517 100644 --- a/misc/build.func +++ b/misc/build.func @@ -16,14 +16,14 @@ variables() { CT_TYPE=${var_unprivileged:-$CT_TYPE} } -source <(curl -fsSL https://git.community-scripts.org/community-scripts/ProxmoxVED/raw/branch/main/misc/api.func) +source <(curl -fsSL https://raw.githubusercontent.com/jdacode/ProxmoxVED/refs/heads/comfyui/misc/api.func) if command -v curl >/dev/null 2>&1; then - source <(curl -fsSL https://git.community-scripts.org/community-scripts/ProxmoxVED/raw/branch/main/misc/core.func) + source <(curl -fsSL https://raw.githubusercontent.com/jdacode/ProxmoxVED/refs/heads/comfyui/misc/core.func) load_functions #echo "(build.func) Loaded core.func via curl" elif command -v wget >/dev/null 2>&1; then - source <(wget -qO- https://git.community-scripts.org/community-scripts/ProxmoxVED/raw/branch/main/misc/core.func) + source <(wget -qO- https://raw.githubusercontent.com/jdacode/ProxmoxVED/refs/heads/comfyui/misc/core.func) load_functions #echo "(build.func) Loaded core.func via wget" fi @@ -988,7 +988,7 @@ install_script() { header_info echo -e "${INFO}${HOLD} ${GN}Using Config File on node $PVEHOST_NAME${CL}" METHOD="advanced" - source <(curl -fsSL https://git.community-scripts.org/community-scripts/ProxmoxVED/raw/branch/main/misc/config-file.func) + source <(curl -fsSL https://raw.githubusercontent.com/jdacode/ProxmoxVED/refs/heads/comfyui/misc/config-file.func) config_file ;; 5) @@ -1061,7 +1061,7 @@ check_container_storage() { } start() { - source <(curl -fsSL https://git.community-scripts.org/community-scripts/ProxmoxVED/raw/branch/main/misc/tools.func) + source <(curl -fsSL https://raw.githubusercontent.com/jdacode/ProxmoxVED/refs/heads/comfyui/misc/tools.func) if command -v pveversion >/dev/null 2>&1; then install_script elif [ ! -z ${PHS_SILENT+x} ] && [[ "${PHS_SILENT}" == "1" ]]; then @@ -1127,9 +1127,9 @@ build_container() { TEMP_DIR=$(mktemp -d) pushd "$TEMP_DIR" >/dev/null if [ "$var_os" == "alpine" ]; then - export FUNCTIONS_FILE_PATH="$(curl -fsSL https://git.community-scripts.org/community-scripts/ProxmoxVED/raw/branch/main/misc/alpine-install.func)" + export FUNCTIONS_FILE_PATH="$(curl -fsSL https://raw.githubusercontent.com/jdacode/ProxmoxVED/refs/heads/comfyui/misc/alpine-install.func)" else - export FUNCTIONS_FILE_PATH="$(curl -fsSL https://git.community-scripts.org/community-scripts/ProxmoxVED/raw/branch/main/misc/install.func)" + export FUNCTIONS_FILE_PATH="$(curl -fsSL https://raw.githubusercontent.com/jdacode/ProxmoxVED/refs/heads/comfyui/misc/install.func)" fi export DIAGNOSTICS="$DIAGNOSTICS" export RANDOM_UUID="$RANDOM_UUID" @@ -1163,7 +1163,7 @@ build_container() { -unprivileged $CT_TYPE $PW " - bash -c "$(curl -fsSL https://git.community-scripts.org/community-scripts/ProxmoxVED/raw/branch/main/misc/create_lxc.sh)" || exit + bash -c "$(curl -fsSL https://raw.githubusercontent.com/jdacode/ProxmoxVED/refs/heads/comfyui/misc/create_lxc.sh)" || exit if [ $? -ne 0 ]; then exit 200 fi @@ -1438,7 +1438,7 @@ EOF' fi msg_ok "Customized LXC Container" - lxc-attach -n "$CTID" -- bash -c "$(curl -fsSL https://raw.githubusercontent.com/community-scripts/ProxmoxVED/main/install/${var_install}.sh)" + lxc-attach -n "$CTID" -- bash -c "$(curl -fsSL https://raw.githubusercontent.com/jdacode/ProxmoxVED/refs/heads/comfyui${var_install}.sh)" } destroy_lxc() { @@ -1465,7 +1465,7 @@ description() { cat < - Logo + Logo

${APP} LXC

diff --git a/misc/install.func b/misc/install.func index e3751c295..8b835d0a7 100644 --- a/misc/install.func +++ b/misc/install.func @@ -10,7 +10,7 @@ if ! command -v curl >/dev/null 2>&1; then apt-get update >/dev/null 2>&1 apt-get install -y curl >/dev/null 2>&1 fi -source <(curl -fsSL https://git.community-scripts.org/community-scripts/ProxmoxVED/raw/branch/main/misc/core.func) +source <(curl -fsSL https://raw.githubusercontent.com/jdacode/ProxmoxVED/refs/heads/comfyui/misc/core.func) load_functions # This function enables IPv6 if it's not disabled and sets verbose mode @@ -148,7 +148,7 @@ EOF $STD apt-get -o Dpkg::Options::="--force-confold" -y dist-upgrade rm -rf /usr/lib/python3.*/EXTERNALLY-MANAGED msg_ok "Updated Container OS" - source <(curl -fsSL https://git.community-scripts.org/community-scripts/ProxmoxVED/raw/branch/main/misc/tools.func) + source <(curl -fsSL https://raw.githubusercontent.com/jdacode/ProxmoxVED/refs/heads/comfyui/misc/tools.func) } # This function modifies the message of the day (motd) and SSH settings From 7c4e618f8ff14891bc780f2fb9094b764164852b Mon Sep 17 00:00:00 2001 From: jdacode <49216638+jdacode@users.noreply.github.com> Date: Tue, 19 Aug 2025 16:35:38 +0930 Subject: [PATCH 05/12] Updated .sh correct url for testing --- ct/comfyui.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ct/comfyui.sh b/ct/comfyui.sh index f8ed4e182..5206e0741 100644 --- a/ct/comfyui.sh +++ b/ct/comfyui.sh @@ -1,5 +1,5 @@ #!/usr/bin/env bash -source <(curl -fsSL https://git.community-scripts.org/community-scripts/ProxmoxVED/raw/branch/main/misc/build.func) +source <(curl -fsSL https://raw.githubusercontent.com/jdacode/ProxmoxVED/refs/heads/comfyui/misc/build.func) # Copyright (c) 2021-2025 community-scripts ORG # Author: jdacode # License: MIT | https://github.com/community-scripts/ProxmoxVE/raw/main/LICENSE From 4c79d203214f7297b4d4357d0173d0c27fbe3654 Mon Sep 17 00:00:00 2001 From: jdacode <49216638+jdacode@users.noreply.github.com> Date: Tue, 19 Aug 2025 16:40:54 +0930 Subject: [PATCH 06/12] Fixed install.func for testing --- misc/install.func | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/misc/install.func b/misc/install.func index 8b835d0a7..49e26781d 100644 --- a/misc/install.func +++ b/misc/install.func @@ -31,7 +31,7 @@ catch_errors() { # This function handles errors error_handler() { - source <(curl -fsSL https://raw.githubusercontent.com/community-scripts/ProxmoxVED/main/misc/api.func) + source <(curl -fsSL https://raw.githubusercontent.com/jdacode/ProxmoxVED/refs/heads/comfyui/misc/api.func) printf "\e[?25h" local exit_code="$?" local line_number="$1" From fd252fc463f87a75d773811bfb2b854fcf255c55 Mon Sep 17 00:00:00 2001 From: jdacode <49216638+jdacode@users.noreply.github.com> Date: Tue, 19 Aug 2025 16:47:04 +0930 Subject: [PATCH 07/12] Fixed urls for testing --- misc/build.func | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/misc/build.func b/misc/build.func index 081cec517..ec1d8dbb3 100644 --- a/misc/build.func +++ b/misc/build.func @@ -1438,7 +1438,7 @@ EOF' fi msg_ok "Customized LXC Container" - lxc-attach -n "$CTID" -- bash -c "$(curl -fsSL https://raw.githubusercontent.com/jdacode/ProxmoxVED/refs/heads/comfyui${var_install}.sh)" + lxc-attach -n "$CTID" -- bash -c "$(curl -fsSL https://raw.githubusercontent.com/jdacode/ProxmoxVED/refs/heads/comfyui/install/${var_install}.sh)" } destroy_lxc() { From 2e467183592d70c44a4d46d74aedce1b8db126b3 Mon Sep 17 00:00:00 2001 From: jdacode <49216638+jdacode@users.noreply.github.com> Date: Tue, 19 Aug 2025 17:06:12 +0930 Subject: [PATCH 08/12] Added manager installation --- install/comfyui-install.sh | 30 +++++++++++++++++++++++++++++- 1 file changed, 29 insertions(+), 1 deletion(-) diff --git a/install/comfyui-install.sh b/install/comfyui-install.sh index 58f51cb1a..4e3bff52e 100644 --- a/install/comfyui-install.sh +++ b/install/comfyui-install.sh @@ -143,7 +143,35 @@ msg_ok "Python dependencies" # Comfyui manager installation if [[ "${comfyui_manager_enabled}" =~ ^[Yy]$ ]]; then msg_info "Install ${application_name} Manager" - install_comfyui_manager + # Define the target directory + custom_nodes_dir="${app_path}/custom_nodes" + comfyui_manager_dir="${custom_nodes_dir}/comfyui-manager" + + # Check if the directory exists + if [[ ! -d "${custom_nodes_dir}" ]]; then + echo "${TAB3}${TAB3}${TAB3}Error: Directory not found: ${custom_nodes_dir}" + return 1 + fi + + if [[ -d "${comfyui_manager_dir}" ]]; then + echo "${TAB3}${TAB3}${TAB3}ComfyUI-Manager already exists. Skipping installation." + else + if [[ "${comfyui_manager_version}" == "latest" ]]; then + # Clone the manager + git clone https://github.com/ltdrdata/ComfyUI-Manager "${comfyui_manager_dir}" + else + # Download Release + curl -fsSL -o "${comfyui_manager_version}.zip" "https://github.com/Comfy-Org/ComfyUI-Manager/archive/refs/tags/${comfyui_manager_version}.zip" + # Unzip Release + unzip -q "${comfyui_manager_version}.zip" + # Move and rename + mv "ComfyUI-Manager-${comfyui_manager_version}" "${comfyui_manager_dir}" + # Clean up the zip file + rm -f "${comfyui_manager_version}.zip" + fi + # Install Manager dependencies with uv + $STD uv pip install -r "${comfyui_manager_dir}/requirements.txt" --python="${python_path}" + fi msg_ok "Installed ${application_name} Manager" else msg_error "No installed ${application_name} Manager" From 11f3471f724a5bd7d53f050582efbe1ab9fcb5b6 Mon Sep 17 00:00:00 2001 From: jdacode <49216638+jdacode@users.noreply.github.com> Date: Tue, 19 Aug 2025 17:49:14 +0930 Subject: [PATCH 09/12] Revert urls --- ct/comfyui.sh | 2 +- frontend/public/json/comfyui.json | 2 +- install/comfyui-install.sh | 2 -- misc/build.func | 20 ++++++++++---------- misc/install.func | 6 +++--- 5 files changed, 15 insertions(+), 17 deletions(-) diff --git a/ct/comfyui.sh b/ct/comfyui.sh index 5206e0741..25985b44c 100644 --- a/ct/comfyui.sh +++ b/ct/comfyui.sh @@ -1,5 +1,5 @@ #!/usr/bin/env bash -source <(curl -fsSL https://raw.githubusercontent.com/jdacode/ProxmoxVED/refs/heads/comfyui/misc/build.func) +source <(curl -fsSL https://git.community-scripts.org/community-scripts/ProxmoxVED/raw/branch/main/misc/build.func) # Copyright (c) 2021-2025 community-scripts ORG # Author: jdacode # License: MIT | https://github.com/community-scripts/ProxmoxVE/raw/main/LICENSE diff --git a/frontend/public/json/comfyui.json b/frontend/public/json/comfyui.json index 7dde60335..de41e6b73 100644 --- a/frontend/public/json/comfyui.json +++ b/frontend/public/json/comfyui.json @@ -40,7 +40,7 @@ "type": "info" }, { - "text": "You can always skip manual configuration by using dynamic variables. For example: `skip_user_config=\"Y|y|N|n\" comfyui_version=\"latest|v0.3.49\" python_version_uv=\"3.12\" port_arg=\"8188\" comfyui_python_args=\"--cpu\" gpu_type=\"None|NVIDIA|AMD|Intel\" comfyui_python_index_url_nvidia=\"https://download.pytorch.org/whl/cu128\" comfyui_python_index_url_amd=\"https://download.pytorch.org/whl/rocm6.3\" comfyui_python_index_url_intel=\"https://download.pytorch.org/whl/xpu\" comfyui_manager_enabled=\"Y|y|N|n\" comfyui_manager_version=\"latest|3.35\" bash -c \"$(curl -fsSL https://raw.githubusercontent.com/community-scripts/ProxmoxVE/main/ct/comfyui.sh)\"`", + "text": "You can always skip manual configuration by using dynamic variables. For example: `comfyui_version=\"latest|v0.3.49\" python_version_uv=\"3.12\" port_arg=\"8188\" comfyui_python_args=\"--cpu\" gpu_type=\"None|NVIDIA|AMD|Intel\" comfyui_python_index_url_nvidia=\"https://download.pytorch.org/whl/cu128\" comfyui_python_index_url_amd=\"https://download.pytorch.org/whl/rocm6.3\" comfyui_python_index_url_intel=\"https://download.pytorch.org/whl/xpu\" comfyui_manager_enabled=\"Y|y|N|n\" comfyui_manager_version=\"latest|3.35\" bash -c \"$(curl -fsSL https://raw.githubusercontent.com/community-scripts/ProxmoxVE/main/ct/comfyui.sh)\"`", "type": "info" } ] diff --git a/install/comfyui-install.sh b/install/comfyui-install.sh index 4e3bff52e..60a0e202a 100644 --- a/install/comfyui-install.sh +++ b/install/comfyui-install.sh @@ -32,7 +32,6 @@ app_path="/opt/${application_name}" python_path="${app_path}/venv/bin/python" # Configurable variables -skip_user_config="${skip_user_config:-N}" # Versions comfyui_version="${comfyui_version:-latest}" python_version_uv="${python_version_uv:-3.12}" @@ -53,7 +52,6 @@ comfyui_manager_version="${comfyui_manager_version:-latest}" # Display current configuration variables -echo -e "${CM}${BOLD}${DGN}Skip User Config : ${BGN}${skip_user_config}${CL}" echo -e "${CM}${BOLD}${DGN}Application name : ${BGN}${application_name}${CL}" echo -e "${CM}${BOLD}${DGN}Application path : ${BGN}${app_path}${CL}" echo -e "${CM}${BOLD}${DGN}ComfyUI version : ${BGN}${comfyui_version}${CL}" diff --git a/misc/build.func b/misc/build.func index ec1d8dbb3..c40a57bd1 100644 --- a/misc/build.func +++ b/misc/build.func @@ -16,14 +16,14 @@ variables() { CT_TYPE=${var_unprivileged:-$CT_TYPE} } -source <(curl -fsSL https://raw.githubusercontent.com/jdacode/ProxmoxVED/refs/heads/comfyui/misc/api.func) +source <(curl -fsSL https://git.community-scripts.org/community-scripts/ProxmoxVED/raw/branch/main/misc/api.func) if command -v curl >/dev/null 2>&1; then - source <(curl -fsSL https://raw.githubusercontent.com/jdacode/ProxmoxVED/refs/heads/comfyui/misc/core.func) + source <(curl -fsSL https://git.community-scripts.org/community-scripts/ProxmoxVED/raw/branch/main/misc/core.func) load_functions #echo "(build.func) Loaded core.func via curl" elif command -v wget >/dev/null 2>&1; then - source <(wget -qO- https://raw.githubusercontent.com/jdacode/ProxmoxVED/refs/heads/comfyui/misc/core.func) + source <(wget -qO- https://git.community-scripts.org/community-scripts/ProxmoxVED/raw/branch/main/misc/core.func) load_functions #echo "(build.func) Loaded core.func via wget" fi @@ -988,7 +988,7 @@ install_script() { header_info echo -e "${INFO}${HOLD} ${GN}Using Config File on node $PVEHOST_NAME${CL}" METHOD="advanced" - source <(curl -fsSL https://raw.githubusercontent.com/jdacode/ProxmoxVED/refs/heads/comfyui/misc/config-file.func) + source <(curl -fsSL https://git.community-scripts.org/community-scripts/ProxmoxVED/raw/branch/main/misc/config-file.func) config_file ;; 5) @@ -1061,7 +1061,7 @@ check_container_storage() { } start() { - source <(curl -fsSL https://raw.githubusercontent.com/jdacode/ProxmoxVED/refs/heads/comfyui/misc/tools.func) + source <(curl -fsSL https://git.community-scripts.org/community-scripts/ProxmoxVED/raw/branch/main/misc/tools.func) if command -v pveversion >/dev/null 2>&1; then install_script elif [ ! -z ${PHS_SILENT+x} ] && [[ "${PHS_SILENT}" == "1" ]]; then @@ -1127,9 +1127,9 @@ build_container() { TEMP_DIR=$(mktemp -d) pushd "$TEMP_DIR" >/dev/null if [ "$var_os" == "alpine" ]; then - export FUNCTIONS_FILE_PATH="$(curl -fsSL https://raw.githubusercontent.com/jdacode/ProxmoxVED/refs/heads/comfyui/misc/alpine-install.func)" + export FUNCTIONS_FILE_PATH="$(curl -fsSL https://git.community-scripts.org/community-scripts/ProxmoxVED/raw/branch/main/misc/alpine-install.func)" else - export FUNCTIONS_FILE_PATH="$(curl -fsSL https://raw.githubusercontent.com/jdacode/ProxmoxVED/refs/heads/comfyui/misc/install.func)" + export FUNCTIONS_FILE_PATH="$(curl -fsSL https://git.community-scripts.org/community-scripts/ProxmoxVED/raw/branch/main/misc/install.func)" fi export DIAGNOSTICS="$DIAGNOSTICS" export RANDOM_UUID="$RANDOM_UUID" @@ -1163,7 +1163,7 @@ build_container() { -unprivileged $CT_TYPE $PW " - bash -c "$(curl -fsSL https://raw.githubusercontent.com/jdacode/ProxmoxVED/refs/heads/comfyui/misc/create_lxc.sh)" || exit + bash -c "$(curl -fsSL https://git.community-scripts.org/community-scripts/ProxmoxVED/raw/branch/main/misc/create_lxc.sh)" || exit if [ $? -ne 0 ]; then exit 200 fi @@ -1438,7 +1438,7 @@ EOF' fi msg_ok "Customized LXC Container" - lxc-attach -n "$CTID" -- bash -c "$(curl -fsSL https://raw.githubusercontent.com/jdacode/ProxmoxVED/refs/heads/comfyui/install/${var_install}.sh)" + lxc-attach -n "$CTID" -- bash -c "$(curl -fsSL https://raw.githubusercontent.com/community-scripts/ProxmoxVED/main/install/${var_install}.sh)" } destroy_lxc() { @@ -1465,7 +1465,7 @@ description() { cat < - Logo + Logo

${APP} LXC

diff --git a/misc/install.func b/misc/install.func index 49e26781d..e3751c295 100644 --- a/misc/install.func +++ b/misc/install.func @@ -10,7 +10,7 @@ if ! command -v curl >/dev/null 2>&1; then apt-get update >/dev/null 2>&1 apt-get install -y curl >/dev/null 2>&1 fi -source <(curl -fsSL https://raw.githubusercontent.com/jdacode/ProxmoxVED/refs/heads/comfyui/misc/core.func) +source <(curl -fsSL https://git.community-scripts.org/community-scripts/ProxmoxVED/raw/branch/main/misc/core.func) load_functions # This function enables IPv6 if it's not disabled and sets verbose mode @@ -31,7 +31,7 @@ catch_errors() { # This function handles errors error_handler() { - source <(curl -fsSL https://raw.githubusercontent.com/jdacode/ProxmoxVED/refs/heads/comfyui/misc/api.func) + source <(curl -fsSL https://raw.githubusercontent.com/community-scripts/ProxmoxVED/main/misc/api.func) printf "\e[?25h" local exit_code="$?" local line_number="$1" @@ -148,7 +148,7 @@ EOF $STD apt-get -o Dpkg::Options::="--force-confold" -y dist-upgrade rm -rf /usr/lib/python3.*/EXTERNALLY-MANAGED msg_ok "Updated Container OS" - source <(curl -fsSL https://raw.githubusercontent.com/jdacode/ProxmoxVED/refs/heads/comfyui/misc/tools.func) + source <(curl -fsSL https://git.community-scripts.org/community-scripts/ProxmoxVED/raw/branch/main/misc/tools.func) } # This function modifies the message of the day (motd) and SSH settings From a6f04e26b4cad97f0513cada386f0cff5c232a97 Mon Sep 17 00:00:00 2001 From: jdacode <49216638+jdacode@users.noreply.github.com> Date: Thu, 21 Aug 2025 14:31:36 +0930 Subject: [PATCH 10/12] Updated script --- frontend/public/json/comfyui.json | 4 +- install/comfyui-install.sh | 186 +++++++++--------------------- 2 files changed, 59 insertions(+), 131 deletions(-) diff --git a/frontend/public/json/comfyui.json b/frontend/public/json/comfyui.json index de41e6b73..fe6574f25 100644 --- a/frontend/public/json/comfyui.json +++ b/frontend/public/json/comfyui.json @@ -40,8 +40,8 @@ "type": "info" }, { - "text": "You can always skip manual configuration by using dynamic variables. For example: `comfyui_version=\"latest|v0.3.49\" python_version_uv=\"3.12\" port_arg=\"8188\" comfyui_python_args=\"--cpu\" gpu_type=\"None|NVIDIA|AMD|Intel\" comfyui_python_index_url_nvidia=\"https://download.pytorch.org/whl/cu128\" comfyui_python_index_url_amd=\"https://download.pytorch.org/whl/rocm6.3\" comfyui_python_index_url_intel=\"https://download.pytorch.org/whl/xpu\" comfyui_manager_enabled=\"Y|y|N|n\" comfyui_manager_version=\"latest|3.35\" bash -c \"$(curl -fsSL https://raw.githubusercontent.com/community-scripts/ProxmoxVE/main/ct/comfyui.sh)\"`", + "text": "You can always skip manual configuration by using dynamic variables. For example: `comfyui_skip_user_config=\"Y|y\" comfyui_python_version_uv=\"3.12\" comfyui_python_args=\"--cpu\" comfyui_gpu_type=\"None|NVIDIA|AMD|Intel\" comfyui_index_url_nvidia=\"URL\" comfyui_index_url_amd=\"URL\" comfyui_index_url_intel=\"URL\" comfyui_manager_enabled=\"N|n\" bash -c \"$(curl -fsSL ...comfyui.sh)\"`", "type": "info" - } + } ] } diff --git a/install/comfyui-install.sh b/install/comfyui-install.sh index 60a0e202a..165c4a00b 100644 --- a/install/comfyui-install.sh +++ b/install/comfyui-install.sh @@ -5,7 +5,6 @@ # License: MIT | https://github.com/community-scripts/ProxmoxVE/raw/main/LICENSE # Source: https://github.com/comfyanonymous/ComfyUI -# Import Functions und Setup source /dev/stdin <<<"$FUNCTIONS_FILE_PATH" color verb_ip6 @@ -14,170 +13,107 @@ setting_up_container network_check update_os - - -# Installing Dependencies msg_info "Installing Dependencies" $STD apt-get install -y \ git \ nvtop msg_ok "Installed Dependencies" - - -# Default configuration variables -# NO Configurable variables application_name="${APPLICATION}" -app_path="/opt/${application_name}" -python_path="${app_path}/venv/bin/python" - -# Configurable variables -# Versions -comfyui_version="${comfyui_version:-latest}" -python_version_uv="${python_version_uv:-3.12}" -# Python main.py arguments -port_arg="${port_arg:-8188}" -comfyui_python_net_args="--listen" -comfyui_python_port_args="--port ${port_arg}" +comfyui_path="/opt/${application_name}" +comfyui_python_path="${comfyui_path}/venv/bin/python" +comfyui_port_arg="8188" +comfyui_skip_user_config="${comfyui_skip_user_config:-N}" +comfyui_python_version_uv="${comfyui_python_version_uv:-3.12}" comfyui_python_args="${comfyui_python_args:---cpu}" -# GPU Settings -gpu_type="${gpu_type:-None}" -comfyui_python_index_url_nvidia="${comfyui_python_index_url_nvidia:-https://download.pytorch.org/whl/cu128}" -comfyui_python_index_url_amd="${comfyui_python_index_url_amd:-https://download.pytorch.org/whl/rocm6.3}" -comfyui_python_index_url_intel="${comfyui_python_index_url_intel:-https://download.pytorch.org/whl/xpu}" -# ComfyUI Manager +comfyui_gpu_type="${comfyui_gpu_type:-none}" +comfyui_index_url_nvidia="${comfyui_index_url_nvidia:-https://download.pytorch.org/whl/cu128}" +comfyui_index_url_amd="${comfyui_index_url_amd:-https://download.pytorch.org/whl/rocm6.3}" +comfyui_index_url_intel="${comfyui_index_url_intel:-https://download.pytorch.org/whl/xpu}" comfyui_manager_enabled="${comfyui_manager_enabled:-Y}" -comfyui_manager_version="${comfyui_manager_version:-latest}" - +if ! [[ "${comfyui_skip_user_config,,}" =~ ^(y|yes)$ ]]; then + echo + echo + echo "${TAB3}${TAB3}Choose the GPU type for ComfyUI:" + echo "${TAB3}${TAB3}-------------------------------" + echo "${TAB3}${TAB3}${TAB3} 1. None" + echo "${TAB3}${TAB3}${TAB3} 2. NVIDIA" + echo "${TAB3}${TAB3}${TAB3} 3. AMD" + echo "${TAB3}${TAB3}${TAB3} 4. Intel" + echo + read -rp "${TAB3}${TAB3}${TAB3}Enter your choice [1-4] (default: 1): " gpu_choice + gpu_choice=${gpu_choice:-1} + case "$gpu_choice" in + 1) comfyui_gpu_type="none";; + 2) comfyui_gpu_type="nvidia";; + 3) comfyui_gpu_type="amd";; + 4) comfyui_gpu_type="intel";; + *) comfyui_gpu_type="none"; echo "${TAB3}${TAB3}${TAB3}${TAB3}Invalid choice. Defaulting to ${comfyui_gpu_type}." ;; + esac +fi -# Display current configuration variables echo -e "${CM}${BOLD}${DGN}Application name : ${BGN}${application_name}${CL}" -echo -e "${CM}${BOLD}${DGN}Application path : ${BGN}${app_path}${CL}" -echo -e "${CM}${BOLD}${DGN}ComfyUI version : ${BGN}${comfyui_version}${CL}" -echo -e "${CM}${BOLD}${DGN}GPU : ${BGN}${gpu_type}${CL}" -echo -e "${CM}${BOLD}${DGN}Port : ${BGN}${port_arg}${CL}" +echo -e "${CM}${BOLD}${DGN}Application path : ${BGN}${comfyui_path}${CL}" +echo -e "${CM}${BOLD}${DGN}Skip User Config : ${BGN}${comfyui_skip_user_config}${CL}" +echo -e "${CM}${BOLD}${DGN}GPU : ${BGN}${comfyui_gpu_type}${CL}" echo -e "${CM}${BOLD}${DGN}ComfyUI Manager : ${BGN}${comfyui_manager_enabled}${CL}" -echo -e "${CM}${BOLD}${DGN}ComfyUI Manager Version : ${BGN}${comfyui_manager_version}${CL}" -echo -e "${CM}${BOLD}${DGN}Python version (uv) : ${BGN}${python_version_uv}${CL}" -echo -e "${CM}${BOLD}${DGN}Python path (uv) : ${BGN}${python_path}${CL}" +echo -e "${CM}${BOLD}${DGN}Python version (uv) : ${BGN}${comfyui_python_version_uv}${CL}" +echo -e "${CM}${BOLD}${DGN}Python path (uv) : ${BGN}${comfyui_python_path}${CL}" echo -e "${CM}${BOLD}${DGN}ComfyUI python args : ${BGN}${comfyui_python_args}${CL}" -echo -e "${CM}${BOLD}${DGN}Pip Nvidia index-url : ${BGN}${comfyui_python_index_url_nvidia}${CL}" -echo -e "${CM}${BOLD}${DGN}Pip AMD index-url : ${BGN}${comfyui_python_index_url_amd}${CL}" -echo -e "${CM}${BOLD}${DGN}Pip Intel index-url : ${BGN}${comfyui_python_index_url_intel}${CL}" -echo -e "${CM}${BOLD}${DGN}Preview ExecStart command : ${BGN}main.py ${comfyui_python_net_args} ${comfyui_python_port_args} ${comfyui_python_args}${CL}" - +echo -e "${CM}${BOLD}${DGN}Pip Nvidia index-url : ${BGN}${comfyui_index_url_nvidia}${CL}" +echo -e "${CM}${BOLD}${DGN}Pip AMD index-url : ${BGN}${comfyui_index_url_amd}${CL}" +echo -e "${CM}${BOLD}${DGN}Pip Intel index-url : ${BGN}${comfyui_index_url_intel}${CL}" +echo -e "${CM}${BOLD}${DGN}Preview ExecStart command : ${BGN}main.py --listen --port ${comfyui_port_arg} ${comfyui_python_args}${CL}" - -# ComfyUI installation start from here! -# Installs uv msg_info "Setup uv" -PYTHON_VERSION="${python_version_uv}" setup_uv +PYTHON_VERSION="${comfyui_python_version_uv}" setup_uv msg_ok "Setup uv" +fetch_and_deploy_gh_release "${application_name}" "comfyanonymous/ComfyUI" "tarball" "latest" "${comfyui_path}" - -# Comfy Version -msg_info "Setup ${application_name}" -if [[ "$comfyui_version" == "latest" ]]; then - echo "Version is set to 'latest'; skipping version check." - RELEASE=$(curl -fsSL https://api.github.com/repos/comfyanonymous/ComfyUI/releases/latest | grep "tag_name" | awk '{print substr($2, 2, length($2)-3) }') -else - RELEASE="$comfyui_version" -fi -msg_ok "Setup ${application_name}" - - - -# Comfy Release -msg_info "Installing ComfyUI version: ${RELEASE}" -curl -fsSL -o "${application_name}.zip" "https://github.com/comfyanonymous/ComfyUI/archive/refs/tags/${RELEASE}.zip" -unzip -q "${application_name}.zip" -# Remove v -CLEAN_RELEASE="${RELEASE//v/}" -# Move app to opt -mv "${application_name}-${CLEAN_RELEASE}/" "${app_path}" -echo "${RELEASE}" >/opt/"${application_name}"_version.txt -msg_ok "Installed ComfyUI version: ${RELEASE}" - - - -# Dependencies msg_info "Python dependencies" -$STD uv venv "${app_path}/venv" -gpu_type="${gpu_type,,}" -if [[ "$gpu_type" == "nvidia" ]]; then +$STD uv venv "${comfyui_path}/venv" +if [[ "${comfyui_gpu_type,,}" == "nvidia" ]]; then echo "NVIDIA GPU selected" $STD uv pip install \ torch \ torchvision \ torchaudio \ - --extra-index-url "${comfyui_python_index_url_nvidia}" \ - --python="${python_path}" -elif [[ "$gpu_type" == "amd" ]]; then + --extra-index-url "${comfyui_index_url_nvidia}" \ + --python="${comfyui_python_path}" +elif [[ "${comfyui_gpu_type,,}" == "amd" ]]; then echo "AMD GPU selected" $STD uv pip install \ torch \ torchvision \ torchaudio \ - --index-url "${comfyui_python_index_url_amd}" \ - --python="${python_path}" -elif [[ "$gpu_type" == "intel" ]]; then + --index-url "${comfyui_index_url_amd}" \ + --python="${comfyui_python_path}" +elif [[ "${comfyui_gpu_type,,}" == "intel" ]]; then echo "Intel GPU selected" $STD uv pip install \ torch \ torchvision \ torchaudio \ - --index-url "${comfyui_python_index_url_intel}" \ - --python="${python_path}" + --index-url "${comfyui_index_url_intel}" \ + --python="${comfyui_python_path}" else echo "No GPU selected" fi -$STD uv pip install -r "${app_path}/requirements.txt" --python="${python_path}" +$STD uv pip install -r "${comfyui_path}/requirements.txt" --python="${comfyui_python_path}" msg_ok "Python dependencies" - - -# Comfyui manager installation -if [[ "${comfyui_manager_enabled}" =~ ^[Yy]$ ]]; then +if [[ "${comfyui_manager_enabled,,}" =~ ^(y|yes)$ ]]; then msg_info "Install ${application_name} Manager" - # Define the target directory - custom_nodes_dir="${app_path}/custom_nodes" - comfyui_manager_dir="${custom_nodes_dir}/comfyui-manager" - - # Check if the directory exists - if [[ ! -d "${custom_nodes_dir}" ]]; then - echo "${TAB3}${TAB3}${TAB3}Error: Directory not found: ${custom_nodes_dir}" - return 1 - fi - - if [[ -d "${comfyui_manager_dir}" ]]; then - echo "${TAB3}${TAB3}${TAB3}ComfyUI-Manager already exists. Skipping installation." - else - if [[ "${comfyui_manager_version}" == "latest" ]]; then - # Clone the manager - git clone https://github.com/ltdrdata/ComfyUI-Manager "${comfyui_manager_dir}" - else - # Download Release - curl -fsSL -o "${comfyui_manager_version}.zip" "https://github.com/Comfy-Org/ComfyUI-Manager/archive/refs/tags/${comfyui_manager_version}.zip" - # Unzip Release - unzip -q "${comfyui_manager_version}.zip" - # Move and rename - mv "ComfyUI-Manager-${comfyui_manager_version}" "${comfyui_manager_dir}" - # Clean up the zip file - rm -f "${comfyui_manager_version}.zip" - fi - # Install Manager dependencies with uv - $STD uv pip install -r "${comfyui_manager_dir}/requirements.txt" --python="${python_path}" - fi + comfyui_manager_dir="${comfyui_path}/custom_nodes/comfyui-manager" + git clone https://github.com/ltdrdata/ComfyUI-Manager "${comfyui_manager_dir}" + $STD uv pip install -r "${comfyui_manager_dir}/requirements.txt" --python="${comfyui_python_path}" msg_ok "Installed ${application_name} Manager" else msg_error "No installed ${application_name} Manager" fi - - -# Creating Service msg_info "Creating Service" cat </etc/systemd/system/"${application_name}".service [Unit] @@ -187,8 +123,8 @@ After=network.target [Service] Type=simple User=root -WorkingDirectory=${app_path} -ExecStart=${python_path} ${app_path}/main.py ${comfyui_python_net_args} ${comfyui_python_port_args} ${comfyui_python_args} +WorkingDirectory=${comfyui_path} +ExecStart=${comfyui_python_path} ${comfyui_path}/main.py --listen --port ${comfyui_port_arg} ${comfyui_python_args} Restart=on-failure [Install] @@ -197,18 +133,10 @@ EOF systemctl enable -q --now "${application_name}" msg_ok "Created Service" - - motd_ssh customize - - -# Cleanup msg_info "Cleaning up" -rm -f "${application_name}".zip $STD apt-get -y autoremove $STD apt-get -y autoclean msg_ok "Cleaned" - - From a19aed3843406a4b804d5b8e956eec57176ec77b Mon Sep 17 00:00:00 2001 From: jdacode <49216638+jdacode@users.noreply.github.com> Date: Thu, 21 Aug 2025 15:09:44 +0930 Subject: [PATCH 11/12] Removed comments from comfyui.sh --- ct/comfyui.sh | 10 ---------- 1 file changed, 10 deletions(-) diff --git a/ct/comfyui.sh b/ct/comfyui.sh index 25985b44c..c21e010bb 100644 --- a/ct/comfyui.sh +++ b/ct/comfyui.sh @@ -5,22 +5,13 @@ source <(curl -fsSL https://git.community-scripts.org/community-scripts/Proxmox # License: MIT | https://github.com/community-scripts/ProxmoxVE/raw/main/LICENSE # Source: https://github.com/comfyanonymous/ComfyUI -# App Default Values -# Name of the app (e.g. Google, Adventurelog, Apache-Guacamole" APP="ComfyUI" -# Tags for Proxmox VE, maximum 2 pcs., no spaces allowed, separated by a semicolon ; (e.g. database | adblock;dhcp) var_tags="${var_tags:-ai}" -# Number of cores (1-X) (e.g. 4) - default are 2 var_cpu="${var_cpu:-4}" -# Amount of used RAM in MB (e.g. 2048 or 4096) var_ram="${var_ram:-8192}" -# Amount of used disk space in GB (e.g. 4 or 10) var_disk="${var_disk:-25}" -# Default OS (e.g. debian, ubuntu, alpine) var_os="${var_os:-debian}" -# Default OS version (e.g. 12 for debian, 24.04 for ubuntu, 3.20 for alpine) var_version="${var_version:-12}" -# 1 = unprivileged container, 0 = privileged container var_unprivileged="${var_unprivileged:-1}" header_info "$APP" @@ -33,7 +24,6 @@ function update_script() { check_container_storage check_container_resources - # Check if installation is present | -f for file, -d for folder if [[ ! -f /opt/${APP} ]]; then msg_error "No ${APP} Installation Found!" exit From 255be7e9e3ab3502920ad6ff107bc0f99849c850 Mon Sep 17 00:00:00 2001 From: jdacode <49216638+jdacode@users.noreply.github.com> Date: Thu, 21 Aug 2025 15:38:43 +0930 Subject: [PATCH 12/12] Updated script --- install/comfyui-install.sh | 2 ++ 1 file changed, 2 insertions(+) diff --git a/install/comfyui-install.sh b/install/comfyui-install.sh index 165c4a00b..9e33fa7c3 100644 --- a/install/comfyui-install.sh +++ b/install/comfyui-install.sh @@ -51,6 +51,8 @@ if ! [[ "${comfyui_skip_user_config,,}" =~ ^(y|yes)$ ]]; then 4) comfyui_gpu_type="intel";; *) comfyui_gpu_type="none"; echo "${TAB3}${TAB3}${TAB3}${TAB3}Invalid choice. Defaulting to ${comfyui_gpu_type}." ;; esac + echo + echo fi echo -e "${CM}${BOLD}${DGN}Application name : ${BGN}${application_name}${CL}"