From dbb3207df1a9178f5c8c77c7b4f0f41066d387c3 Mon Sep 17 00:00:00 2001 From: Ethanfel Date: Sun, 5 Apr 2026 17:44:52 +0200 Subject: [PATCH] Replace install.py with standard requirements.txt install.py was running arbitrary pip installs as part of node loading, which is dangerous in a shared venv. Standard approach: requirements.txt lists the safe deps (transformers, accelerate, soundfile, etc.); omnivoice itself must be installed once manually with --no-deps to avoid overwriting ComfyUI's torch. README documents this clearly. Co-Authored-By: Claude Sonnet 4.6 --- README.md | 8 ++++---- install.py | 33 --------------------------------- requirements.txt | 10 ++++++---- 3 files changed, 10 insertions(+), 41 deletions(-) delete mode 100644 install.py diff --git a/README.md b/README.md index 276091a..1c144fa 100644 --- a/README.md +++ b/README.md @@ -18,13 +18,13 @@ A ComfyUI custom node for [OmniVoice](https://github.com/k2-fsa/OmniVoice) — a git clone https://github.com/ethanfel/ComfyUI-Omnivoice.git ``` -2. Install dependencies **without overwriting ComfyUI's torch**: +2. Install `omnivoice` **without its pinned torch** (one-time manual step): ```bash - python install.py + pip install omnivoice --no-deps ``` - > **Warning:** Do NOT run `pip install omnivoice` directly — it pins `torch==2.8.*` from a CUDA 12.8 index and will overwrite ComfyUI's torch installation. + > **Why `--no-deps`?** omnivoice pins `torch==2.8.*` from a CUDA 12.8 index. Installing it normally would overwrite ComfyUI's torch build. The `--no-deps` flag skips that pin; ComfyUI's existing torch works fine at runtime. -3. Restart ComfyUI. The nodes will appear under the **OmniVoice** category. +3. Restart ComfyUI. ComfyUI Manager will install the remaining dependencies from `requirements.txt` automatically. The nodes will appear under the **OmniVoice** category. ## Nodes diff --git a/install.py b/install.py deleted file mode 100644 index 51f10b3..0000000 --- a/install.py +++ /dev/null @@ -1,33 +0,0 @@ -""" -Installation script for ComfyUI-Omnivoice. - -ComfyUI Manager runs this file instead of pip-installing requirements.txt directly. -We install omnivoice with --no-deps to avoid overwriting ComfyUI's torch installation. -omnivoice pins torch==2.8.* from a CUDA 12.8 custom index which would break ComfyUI. -""" -import subprocess -import sys - - -def pip(*args): - subprocess.check_call([sys.executable, "-m", "pip", "install", *args]) - - -# Install omnivoice itself without pulling in its torch/torchaudio pins. -# ComfyUI ships its own torch build — let it manage torch. -pip("omnivoice", "--no-deps") - -# Install omnivoice's runtime inference dependencies (excludes torch, torchaudio, -# gradio, tensorboardX, webdataset which are training/demo-only tools). -pip( - "transformers>=4.40.0", - "accelerate", - "pydub", - "soundfile", - "numpy", - "beautifulsoup4", -) - -print("\n[ComfyUI-Omnivoice] Installation complete.") -print("[ComfyUI-Omnivoice] NOTE: omnivoice was installed without its pinned torch.") -print("[ComfyUI-Omnivoice] If you encounter errors, ensure torch>=2.0 is installed.") diff --git a/requirements.txt b/requirements.txt index b505f76..7228f5a 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,4 +1,6 @@ -# Dependencies are managed by install.py to avoid overwriting ComfyUI's torch. -# omnivoice pins torch==2.8.* (CUDA 12.8) which would break ComfyUI's torch build. -# Do not add omnivoice here — install.py handles it with --no-deps. -# EPUB parsing (OmniVoiceEpubLoader) requires beautifulsoup4 (installed by install.py). +transformers>=4.40.0 +accelerate +pydub +soundfile +numpy +beautifulsoup4