From a3fb88e5596014f545f0b22fee2c09befba776d7 Mon Sep 17 00:00:00 2001 From: Ethanfel Date: Sun, 5 Apr 2026 17:45:24 +0200 Subject: [PATCH] Restore install.py for omnivoice --no-deps only requirements.txt cannot install omnivoice (it would pull in torch==2.8.* and break ComfyUI). install.py now does exactly one thing: install omnivoice --no-deps, skipped if already present. All other deps remain in requirements.txt for ComfyUI Manager to handle normally. Co-Authored-By: Claude Sonnet 4.6 --- README.md | 9 ++++++--- install.py | 21 +++++++++++++++++++++ 2 files changed, 27 insertions(+), 3 deletions(-) create mode 100644 install.py diff --git a/README.md b/README.md index 1c144fa..968716e 100644 --- a/README.md +++ b/README.md @@ -18,13 +18,16 @@ A ComfyUI custom node for [OmniVoice](https://github.com/k2-fsa/OmniVoice) — a git clone https://github.com/ethanfel/ComfyUI-Omnivoice.git ``` -2. Install `omnivoice` **without its pinned torch** (one-time manual step): +2. Install via **ComfyUI Manager** (recommended) — it runs `install.py` and `requirements.txt` automatically. + + Or manually: ```bash pip install omnivoice --no-deps + pip install -r requirements.txt ``` - > **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. + > **Why `--no-deps` for omnivoice?** It pins `torch==2.8.*` from a CUDA 12.8 index. Installing it normally would overwrite ComfyUI's torch build. `install.py` handles this automatically; `requirements.txt` covers the remaining deps safely. -3. Restart ComfyUI. ComfyUI Manager will install the remaining dependencies from `requirements.txt` automatically. The nodes will appear under the **OmniVoice** category. +3. Restart ComfyUI. The nodes will appear under the **OmniVoice** category. ## Nodes diff --git a/install.py b/install.py new file mode 100644 index 0000000..cc710d9 --- /dev/null +++ b/install.py @@ -0,0 +1,21 @@ +""" +ComfyUI Manager calls this file before installing requirements.txt. + +omnivoice cannot be listed in requirements.txt because its default install +pins torch==2.8.* from a CUDA 12.8 index, which would overwrite ComfyUI's +torch build. We install it here with --no-deps to skip that pin. +All other dependencies are declared normally in requirements.txt. +""" +import subprocess +import sys + + +def _installed(package): + import importlib.util + return importlib.util.find_spec(package) is not None + + +if not _installed("omnivoice"): + subprocess.check_call([ + sys.executable, "-m", "pip", "install", "omnivoice", "--no-deps" + ])