Update configuration and environment probing for improved flexibility and compatibility

- Modified the `load_config` function to allow launch preferences in `gpu-rent.vars` to override `.env` settings for non-secret variables, enhancing user control.
- Updated the list of Python candidates in `stack_env_probe.py` to include additional paths for ComfyUI, improving the detection of Python environments.
- Added new pip candidates in `tune_swarm_perf.py` to support various ComfyUI installations, ensuring better compatibility with different setups.
This commit is contained in:
Leonid Pershin
2026-08-21 09:06:27 +03:00
parent 69daf81a43
commit 97abc7985e
3 changed files with 21 additions and 4 deletions
+16 -2
View File
@@ -9,7 +9,14 @@ import subprocess
import sys
from pathlib import Path
COMFY_PIPS = [
DATA = Path("/mnt/swarm_data")
# SwarmUI Linux: dlbackend/ComfyUI/venv (see comfy-install-linux.sh).
# Older/alternate layouts kept as fallbacks; dlbackend lives on the data volume.
COMFY_PYTHON_CANDIDATES = [
DATA / "dlbackend" / "ComfyUI" / "venv" / "bin" / "python",
DATA / "dlbackend" / "comfy" / "venv" / "bin" / "python",
DATA / "dlbackend" / "comfy" / "ComfyUI" / "venv" / "bin" / "python",
Path("/opt/swarmui/dlbackend/ComfyUI/venv/bin/python"),
Path("/opt/swarmui/dlbackend/comfy/venv/bin/python"),
Path("/opt/swarmui/dlbackend/comfy/ComfyUI/venv/bin/python"),
]
@@ -60,7 +67,14 @@ def check_cuda_runtime() -> dict:
def find_comfy_python() -> Path | None:
for p in COMFY_PIPS:
for p in COMFY_PYTHON_CANDIDATES:
if p.is_file() and os.access(p, os.X_OK):
return p
# SwarmUI may nest differently under dlbackend/
for p in sorted(DATA.glob("dlbackend/**/venv/bin/python")):
if p.is_file() and os.access(p, os.X_OK):
return p
for p in sorted(Path("/opt/swarmui").glob("dlbackend/**/venv/bin/python")):
if p.is_file() and os.access(p, os.X_OK):
return p
return None
+2
View File
@@ -19,8 +19,10 @@ GPU_JSON = DATA / ".gpu-rent-gpu.json"
MARKER = DATA / ".gpu-rent-perf-tuned"
BACKENDS = DATA / "Data" / "Backends.fds"
COMFY_VENV_CANDIDATES = [
DATA / "dlbackend" / "ComfyUI" / "venv" / "bin" / "pip",
DATA / "dlbackend" / "comfy" / "venv" / "bin" / "pip",
DATA / "dlbackend" / "comfy" / "ComfyUI" / "venv" / "bin" / "pip",
Path("/opt/swarmui/dlbackend/ComfyUI/venv/bin/pip"),
Path("/opt/swarmui/dlbackend/comfy/venv/bin/pip"),
Path("/opt/swarmui/dlbackend/comfy/ComfyUI/venv/bin/pip"),
]