Remove auto-install of all deps except cupy

Dependencies are now handled by pyproject.toml / requirements.txt
via ComfyUI Manager or pip. Only cupy is auto-installed at load time
since it requires matching the PyTorch CUDA version; failures produce
a warning instead of crashing. Also added timm to requirements.txt.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
2026-02-27 13:13:01 +01:00
parent 8311fd0261
commit 8fe382e5ec
3 changed files with 32 additions and 44 deletions

View File

@@ -149,36 +149,33 @@ Same as GIMM-VFI Interpolate but processes a single segment. Same pattern as BIM
## Installation ## Installation
Clone into your ComfyUI `custom_nodes/` directory: Install from the [ComfyUI Registry](https://registry.comfy.org/) or clone into your ComfyUI `custom_nodes/` directory:
```bash ```bash
cd ComfyUI/custom_nodes cd ComfyUI/custom_nodes
git clone https://github.com/Ethanfel/ComfyUI-Tween.git git clone https://github.com/Ethanfel/ComfyUI-Tween.git
pip install -r requirements.txt
``` ```
Dependencies (`gdown`, `cupy`, `timm`, `omegaconf`, `easydict`, `yacs`, `einops`, `huggingface_hub`) are auto-installed on first load. The correct `cupy` variant is detected from your PyTorch CUDA version. ### cupy
> **Warning:** `cupy` is a large package (~800MB) and compilation/installation can take several minutes. The first ComfyUI startup after installing this node may appear to hang while `cupy` installs in the background. Check the console log for progress. If auto-install fails (e.g. missing build tools in Docker), install manually with: `cupy` is required for BIM-VFI, SGM-VFI, and GIMM-VFI (optical flow warping). It will be auto-installed on first load based on your PyTorch CUDA version. If auto-install fails, install manually:
> ```bash
> pip install cupy-cuda12x # replace 12 with your CUDA major version
> ```
To install manually:
```bash ```bash
cd ComfyUI-Tween pip install cupy-cuda12x # replace 12 with your CUDA major version (11 or 12)
python install.py
``` ```
### Requirements ### Requirements
- PyTorch with CUDA - PyTorch with CUDA
- `cupy` (matching your CUDA version, for BIM-VFI, SGM-VFI, and GIMM-VFI) - `cupy` (matching your CUDA version for BIM-VFI, SGM-VFI, and GIMM-VFI)
- `timm` (for EMA-VFI and SGM-VFI) - `timm` (for EMA-VFI and SGM-VFI)
- `gdown` (for BIM-VFI/EMA-VFI/SGM-VFI model auto-download) - `gdown` (for BIM-VFI/EMA-VFI/SGM-VFI model auto-download)
- `omegaconf`, `easydict`, `yacs`, `einops` (for GIMM-VFI) - `omegaconf`, `easydict`, `yacs`, `einops` (for GIMM-VFI)
- `huggingface_hub` (for GIMM-VFI model auto-download) - `huggingface_hub` (for GIMM-VFI model auto-download)
All dependencies except `cupy` are listed in `pyproject.toml` and installed automatically by ComfyUI Manager or pip.
## VRAM Guide ## VRAM Guide
| VRAM | Recommended settings | | VRAM | Recommended settings |

View File

@@ -5,45 +5,35 @@ import logging
logger = logging.getLogger("Tween") logger = logging.getLogger("Tween")
def _auto_install_deps(): def _ensure_cupy():
"""Auto-install missing dependencies on first load.""" """Try to auto-install cupy if missing, matching the PyTorch CUDA version."""
# gdown
try:
import gdown # noqa: F401
except ImportError:
logger.info("[Tween] Installing gdown...")
subprocess.check_call([sys.executable, "-m", "pip", "install", "gdown"])
# timm (required for EMA-VFI's MotionFormer backbone)
try:
import timm # noqa: F401
except ImportError:
logger.info("[Tween] Installing timm...")
subprocess.check_call([sys.executable, "-m", "pip", "install", "timm"])
# cupy
try: try:
import cupy # noqa: F401 import cupy # noqa: F401
return
except ImportError: except ImportError:
pass
try: try:
import torch import torch
if not torch.cuda.is_available() or not hasattr(torch.version, "cuda") or torch.version.cuda is None:
logger.warning(
"[Tween] CUDA not available — cupy cannot be installed. "
"SGM-VFI and GIMM-VFI require CUDA."
)
return
major = int(torch.version.cuda.split(".")[0]) major = int(torch.version.cuda.split(".")[0])
cupy_pkg = f"cupy-cuda{major}x" cupy_pkg = f"cupy-cuda{major}x"
logger.info(f"[Tween] Installing {cupy_pkg} (CUDA {torch.version.cuda})...") logger.info(f"[Tween] Installing {cupy_pkg} (CUDA {torch.version.cuda})...")
subprocess.check_call([sys.executable, "-m", "pip", "install", cupy_pkg]) subprocess.check_call([sys.executable, "-m", "pip", "install", cupy_pkg])
except Exception as e: except Exception as e:
logger.warning(f"[Tween] Could not auto-install cupy: {e}") logger.warning(
f"[Tween] Could not auto-install cupy: {e}\n"
# GIMM-VFI dependencies f"[Tween] SGM-VFI and GIMM-VFI will not work without cupy. Install manually:\n"
for pkg in ("omegaconf", "yacs", "easydict", "einops", "huggingface_hub"): f"[Tween] pip install cupy-cuda12x # replace 12 with your CUDA major version"
try: )
__import__(pkg)
except ImportError:
logger.info(f"[Tween] Installing {pkg}...")
subprocess.check_call([sys.executable, "-m", "pip", "install", pkg])
_auto_install_deps() _ensure_cupy()
from .nodes import ( from .nodes import (
LoadBIMVFIModel, BIMVFIInterpolate, BIMVFISegmentInterpolate, TweenConcatVideos, LoadBIMVFIModel, BIMVFIInterpolate, BIMVFISegmentInterpolate, TweenConcatVideos,

View File

@@ -1,4 +1,5 @@
gdown gdown
timm
omegaconf omegaconf
yacs yacs
easydict easydict