Skip to content

Commit a660773

Browse files
'Add new script' (#8633)
1 parent a8d5fc9 commit a660773

File tree

4 files changed

+179
-0
lines changed

4 files changed

+179
-0
lines changed

ct/comfyui.sh

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
#!/usr/bin/env bash
2+
source <(curl -fsSL https://raw.githubusercontent.com/community-scripts/ProxmoxVE/main/misc/build.func)
3+
# Copyright (c) 2021-2025 community-scripts ORG
4+
# Author: jdacode
5+
# License: MIT | https://github.com/community-scripts/ProxmoxVE/raw/main/LICENSE
6+
# Source: https://github.com/comfyanonymous/ComfyUI
7+
8+
APP="ComfyUI"
9+
var_tags="${var_tags:-ai}"
10+
var_cpu="${var_cpu:-4}"
11+
var_ram="${var_ram:-8192}"
12+
var_disk="${var_disk:-25}"
13+
var_os="${var_os:-debian}"
14+
var_version="${var_version:-13}"
15+
var_unprivileged="${var_unprivileged:-1}"
16+
17+
header_info "$APP"
18+
variables
19+
color
20+
catch_errors
21+
22+
function update_script() {
23+
header_info
24+
check_container_storage
25+
check_container_resources
26+
27+
if [[ ! -f /opt/${APP} ]]; then
28+
msg_error "No ${APP} Installation Found!"
29+
exit
30+
fi
31+
msg_error "To update use the ${APP} Manager."
32+
exit
33+
}
34+
35+
start
36+
build_container
37+
description
38+
39+
msg_ok "Completed Successfully!\n"
40+
echo -e "${CREATING}${GN}${APP} setup has been successfully initialized!${CL}"
41+
echo -e "${INFO}${YW} Access it using the following URL:${CL}"
42+
echo -e "${TAB}${GATEWAY}${BGN}http://${IP}:8188${CL}"

ct/headers/comfyui

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
______ ____ __ ______
2+
/ ____/___ ____ ___ / __/_ __/ / / / _/
3+
/ / / __ \/ __ `__ \/ /_/ / / / / / // /
4+
/ /___/ /_/ / / / / / / __/ /_/ / /_/ // /
5+
\____/\____/_/ /_/ /_/_/ \__, /\____/___/
6+
/____/

frontend/public/json/comfyui.json

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
{
2+
"name": "ComfyUI",
3+
"slug": "comfyui",
4+
"categories": [
5+
20
6+
],
7+
"date_created": "2025-08-01",
8+
"type": "ct",
9+
"updateable": true,
10+
"privileged": false,
11+
"config_path": "/opt",
12+
"interface_port": 8188,
13+
"documentation": "https://github.com/comfyanonymous/ComfyUI",
14+
"website": "https://www.comfy.org/",
15+
"logo": "https://framerusercontent.com/images/3cNQMWKzIhIrQ5KErBm7dSmbd2w.png",
16+
"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.",
17+
"install_methods": [
18+
{
19+
"type": "default",
20+
"script": "ct/comfyui.sh",
21+
"resources": {
22+
"cpu": 4,
23+
"ram": 8192,
24+
"hdd": 25,
25+
"os": "debian",
26+
"version": "13"
27+
}
28+
}
29+
],
30+
"default_credentials": {
31+
"username": null,
32+
"password": null
33+
},
34+
"notes": [
35+
{
36+
"text": "Application takes long time to install. Please be patient!",
37+
"type": "warning"
38+
},
39+
{
40+
"text": "Please check that you have installed the drivers for your GPU.",
41+
"type": "info"
42+
}
43+
]
44+
}

install/comfyui-install.sh

Lines changed: 87 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,87 @@
1+
#!/usr/bin/env bash
2+
3+
# Copyright (c) 2021-2025 community-scripts ORG
4+
# Author: jdacode
5+
# License: MIT | https://github.com/community-scripts/ProxmoxVE/raw/main/LICENSE
6+
# Source: https://github.com/comfyanonymous/ComfyUI
7+
8+
source /dev/stdin <<<"$FUNCTIONS_FILE_PATH"
9+
color
10+
verb_ip6
11+
catch_errors
12+
setting_up_container
13+
network_check
14+
update_os
15+
16+
echo
17+
echo "${TAB3}Choose the GPU type for ComfyUI:"
18+
echo "${TAB3}[1]-None [2]-NVIDIA [3]-AMD [4]-Intel"
19+
read -rp "${TAB3}Enter your choice [1-4] (default: 1): " gpu_choice
20+
gpu_choice=${gpu_choice:-1}
21+
case "$gpu_choice" in
22+
1) comfyui_gpu_type="none";;
23+
2) comfyui_gpu_type="nvidia";;
24+
3) comfyui_gpu_type="amd";;
25+
4) comfyui_gpu_type="intel";;
26+
*) comfyui_gpu_type="none"; echo "${TAB3}Invalid choice. Defaulting to ${comfyui_gpu_type}." ;;
27+
esac
28+
echo
29+
30+
PYTHON_VERSION="3.12" setup_uv
31+
32+
fetch_and_deploy_gh_release "ComfyUI" "comfyanonymous/ComfyUI" "tarball" "latest" "/opt/ComfyUI"
33+
34+
msg_info "Python dependencies"
35+
$STD uv venv "/opt/ComfyUI/venv"
36+
if [[ "${comfyui_gpu_type,,}" == "nvidia" ]]; then
37+
$STD uv pip install \
38+
torch \
39+
torchvision \
40+
torchaudio \
41+
--extra-index-url "https://download.pytorch.org/whl/cu128" \
42+
--python="/opt/ComfyUI/venv/bin/python"
43+
elif [[ "${comfyui_gpu_type,,}" == "amd" ]]; then
44+
$STD uv pip install \
45+
torch \
46+
torchvision \
47+
torchaudio \
48+
--index-url "https://download.pytorch.org/whl/rocm6.3" \
49+
--python="/opt/ComfyUI/venv/bin/python"
50+
elif [[ "${comfyui_gpu_type,,}" == "intel" ]]; then
51+
$STD uv pip install \
52+
torch \
53+
torchvision \
54+
torchaudio \
55+
--index-url "https://download.pytorch.org/whl/xpu" \
56+
--python="/opt/ComfyUI/venv/bin/python"
57+
fi
58+
$STD uv pip install -r "/opt/ComfyUI/requirements.txt" --python="/opt/ComfyUI/venv/bin/python"
59+
msg_ok "Python dependencies"
60+
61+
msg_info "Creating Service"
62+
cat <<EOF >/etc/systemd/system/comfyui.service
63+
[Unit]
64+
Description=ComfyUI Service
65+
After=network.target
66+
67+
[Service]
68+
Type=simple
69+
User=root
70+
WorkingDirectory=/opt/ComfyUI
71+
ExecStart=/opt/ComfyUI/venv/bin/python /opt/ComfyUI/main.py --listen --port 8188 --cpu
72+
Restart=on-failure
73+
74+
[Install]
75+
WantedBy=multi-user.target
76+
EOF
77+
systemctl enable -q --now comfyui
78+
msg_ok "Created Service"
79+
80+
motd_ssh
81+
customize
82+
83+
msg_info "Cleaning up"
84+
$STD apt -y autoremove
85+
$STD apt -y autoclean
86+
$STD apt -y clean
87+
msg_ok "Cleaned"

0 commit comments

Comments
 (0)