mirror of
https://github.com/comfyanonymous/ComfyUI.git
synced 2026-04-19 06:52:31 +08:00
fix(entrypoint): remove ONNX install and resolve heredoc EOF by eliminating brace-group usage
- Drop runtime ONNX Runtime installer/check block that used a heredoc followed by a brace group, causing “unexpected end of file”. - Keep Manager pip preflight and toml preinstall; retain unified torch-based GPU probe and SageAttention flow.
This commit is contained in:
parent
dea2903ce2
commit
f4d9284f63
@ -22,8 +22,10 @@ umask 0002
|
|||||||
# --- build parallelism (single knob) ---
|
# --- build parallelism (single knob) ---
|
||||||
decide_build_jobs() {
|
decide_build_jobs() {
|
||||||
if [ -n "${SAGE_MAX_JOBS:-}" ]; then echo "$SAGE_MAX_JOBS"; return; fi
|
if [ -n "${SAGE_MAX_JOBS:-}" ]; then echo "$SAGE_MAX_JOBS"; return; fi
|
||||||
local mem_kb=$(awk '/MemTotal:/ {print $2}' /proc/meminfo 2>/dev/null || echo 0)
|
local mem_kb
|
||||||
local cpu=$(nproc) cap=24 jobs
|
mem_kb=$(awk '/MemTotal:/ {print $2}' /proc/meminfo 2>/dev/null || echo 0)
|
||||||
|
local cpu cap jobs
|
||||||
|
cpu=$(nproc) cap=24
|
||||||
if [ "$mem_kb" -le $((8*1024*1024)) ]; then jobs=2
|
if [ "$mem_kb" -le $((8*1024*1024)) ]; then jobs=2
|
||||||
elif [ "$mem_kb" -le $((12*1024*1024)) ]; then jobs=3
|
elif [ "$mem_kb" -le $((12*1024*1024)) ]; then jobs=3
|
||||||
elif [ "$mem_kb" -le $((24*1024*1024)) ]; then jobs=4
|
elif [ "$mem_kb" -le $((24*1024*1024)) ]; then jobs=4
|
||||||
@ -158,7 +160,7 @@ test_sage_attention() {
|
|||||||
python -c "
|
python -c "
|
||||||
import sys
|
import sys
|
||||||
try:
|
try:
|
||||||
import sageattention; print('[TEST] SageAttention import: SUCCESS')
|
import sageattention; print('[TEST] SageAttention import: SUCCESS]')
|
||||||
v=getattr(sageattention,'__version__',None)
|
v=getattr(sageattention,'__version__',None)
|
||||||
if v: print(f'[TEST] Version: {v}'); sys.exit(0)
|
if v: print(f'[TEST] Version: {v}'); sys.exit(0)
|
||||||
except ImportError as e:
|
except ImportError as e:
|
||||||
@ -262,7 +264,7 @@ python -m pip --version >/dev/null 2>&1 || python -m ensurepip --upgrade >/dev/n
|
|||||||
python -m pip --version >/dev/null 2>&1 || log "WARNING: pip still not available after ensurepip"
|
python -m pip --version >/dev/null 2>&1 || log "WARNING: pip still not available after ensurepip"
|
||||||
|
|
||||||
# Ensure ComfyUI-Manager minimal Python deps
|
# Ensure ComfyUI-Manager minimal Python deps
|
||||||
python - <<'PY' || python -m pip install --no-cache-dir --user toml || true
|
python - <<'PY'
|
||||||
import sys
|
import sys
|
||||||
try:
|
try:
|
||||||
import toml # noqa
|
import toml # noqa
|
||||||
@ -270,6 +272,9 @@ try:
|
|||||||
except Exception:
|
except Exception:
|
||||||
sys.exit(1)
|
sys.exit(1)
|
||||||
PY
|
PY
|
||||||
|
if [ $? -ne 0 ]; then
|
||||||
|
python -m pip install --no-cache-dir --user toml || true
|
||||||
|
fi
|
||||||
|
|
||||||
# --- SageAttention setup using probed data ---
|
# --- SageAttention setup using probed data ---
|
||||||
setup_sage_attention
|
setup_sage_attention
|
||||||
@ -313,25 +318,6 @@ else
|
|||||||
log "Not first run; skipping custom_nodes dependency install"
|
log "Not first run; skipping custom_nodes dependency install"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# --- Ensure ONNX Runtime has CUDA provider (GPU) ---
|
|
||||||
python - <<'PY' || {
|
|
||||||
import sys
|
|
||||||
try:
|
|
||||||
import onnxruntime as ort
|
|
||||||
ok = "CUDAExecutionProvider" in ort.get_available_providers()
|
|
||||||
sys.exit(0 if ok else 1)
|
|
||||||
except Exception:
|
|
||||||
sys.exit(1)
|
|
||||||
PY
|
|
||||||
log "Installing onnxruntime-gpu for CUDAExecutionProvider..."
|
|
||||||
python -m pip uninstall -y onnxruntime || true
|
|
||||||
python -m pip install --no-cache-dir --user "onnxruntime-gpu>=1.19" || true
|
|
||||||
python - <<'P2' || log "WARNING: ONNX Runtime CUDA provider not available after installation"
|
|
||||||
import onnxruntime as ort, sys
|
|
||||||
print("ORT providers:", ort.get_available_providers())
|
|
||||||
sys.exit(0 if "CUDAExecutionProvider" in ort.get_available_providers() else 1)
|
|
||||||
P2
|
|
||||||
|
|
||||||
# --- launch ComfyUI ---
|
# --- launch ComfyUI ---
|
||||||
COMFYUI_ARGS=""
|
COMFYUI_ARGS=""
|
||||||
if [ "${FORCE_SAGE_ATTENTION:-0}" = "1" ] && test_sage_attention; then
|
if [ "${FORCE_SAGE_ATTENTION:-0}" = "1" ] && test_sage_attention; then
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user