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
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
cd ComfyUI/custom_nodes
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:
> ```bash
> pip install cupy-cuda12x # replace 12 with your CUDA major version
> ```
To install manually:
`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
cd ComfyUI-Tween
python install.py
pip install cupy-cuda12x # replace 12 with your CUDA major version (11 or 12)
```
### Requirements
- 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)
- `gdown` (for BIM-VFI/EMA-VFI/SGM-VFI model auto-download)
- `omegaconf`, `easydict`, `yacs`, `einops` (for GIMM-VFI)
- `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 | Recommended settings |

View File

@@ -5,45 +5,35 @@ import logging
logger = logging.getLogger("Tween")
def _auto_install_deps():
"""Auto-install missing dependencies on first load."""
# 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
def _ensure_cupy():
"""Try to auto-install cupy if missing, matching the PyTorch CUDA version."""
try:
import cupy # noqa: F401
return
except ImportError:
pass
try:
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])
cupy_pkg = f"cupy-cuda{major}x"
logger.info(f"[Tween] Installing {cupy_pkg} (CUDA {torch.version.cuda})...")
subprocess.check_call([sys.executable, "-m", "pip", "install", cupy_pkg])
except Exception as e:
logger.warning(f"[Tween] Could not auto-install cupy: {e}")
# GIMM-VFI dependencies
for pkg in ("omegaconf", "yacs", "easydict", "einops", "huggingface_hub"):
try:
__import__(pkg)
except ImportError:
logger.info(f"[Tween] Installing {pkg}...")
subprocess.check_call([sys.executable, "-m", "pip", "install", pkg])
logger.warning(
f"[Tween] Could not auto-install cupy: {e}\n"
f"[Tween] SGM-VFI and GIMM-VFI will not work without cupy. Install manually:\n"
f"[Tween] pip install cupy-cuda12x # replace 12 with your CUDA major version"
)
_auto_install_deps()
_ensure_cupy()
from .nodes import (
LoadBIMVFIModel, BIMVFIInterpolate, BIMVFISegmentInterpolate, TweenConcatVideos,

View File

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