Files
ComfyUI-Tween/__init__.py
Ethanfel 7cf7162143 Add BIM-VFI Segment Interpolate node for bounded peak RAM
Processes numbered segments of the input batch so users can chain
multiple instances with Save nodes between them, freeing each segment's
output before the next starts. Model pass-through output forces
sequential execution via ComfyUI's dependency graph.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-12 20:13:02 +01:00

46 lines
1.3 KiB
Python

import subprocess
import sys
import logging
logger = logging.getLogger("BIM-VFI")
def _auto_install_deps():
"""Auto-install missing dependencies on first load."""
# gdown
try:
import gdown # noqa: F401
except ImportError:
logger.info("[BIM-VFI] Installing gdown...")
subprocess.check_call([sys.executable, "-m", "pip", "install", "gdown"])
# cupy
try:
import cupy # noqa: F401
except ImportError:
try:
import torch
major = int(torch.version.cuda.split(".")[0])
cupy_pkg = f"cupy-cuda{major}x"
logger.info(f"[BIM-VFI] Installing {cupy_pkg} (CUDA {torch.version.cuda})...")
subprocess.check_call([sys.executable, "-m", "pip", "install", cupy_pkg])
except Exception as e:
logger.warning(f"[BIM-VFI] Could not auto-install cupy: {e}")
_auto_install_deps()
from .nodes import LoadBIMVFIModel, BIMVFIInterpolate, BIMVFISegmentInterpolate
NODE_CLASS_MAPPINGS = {
"LoadBIMVFIModel": LoadBIMVFIModel,
"BIMVFIInterpolate": BIMVFIInterpolate,
"BIMVFISegmentInterpolate": BIMVFISegmentInterpolate,
}
NODE_DISPLAY_NAME_MAPPINGS = {
"LoadBIMVFIModel": "Load BIM-VFI Model",
"BIMVFIInterpolate": "BIM-VFI Interpolate",
"BIMVFISegmentInterpolate": "BIM-VFI Segment Interpolate",
}