Features: - 8 ComfyUI nodes for TRELLIS2 video-to-3D processing - Onion skinning with configurable frame interval - Multiple rendering modes (PBR, wireframe, cel, normal, depth) - 4 lighting presets (studio, outdoor, dramatic, flat) - Post-processing effects (bloom, DoF, motion blur, outlines) - Progress bars and auto model download - 5 example workflows 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
106 lines
3.3 KiB
Python
106 lines
3.3 KiB
Python
"""
|
|
Installation script for ComfyUI-TRELLIS2_Motion dependencies.
|
|
|
|
Run with: python install.py
|
|
"""
|
|
|
|
import subprocess
|
|
import sys
|
|
import os
|
|
|
|
|
|
def run_pip(*args):
|
|
"""Run pip with the given arguments."""
|
|
subprocess.check_call([sys.executable, "-m", "pip", *args])
|
|
|
|
|
|
def install_dependencies():
|
|
"""Install all required dependencies."""
|
|
print("Installing ComfyUI-TRELLIS2_Motion dependencies...")
|
|
|
|
# Core dependencies
|
|
print("\n[1/5] Installing core dependencies...")
|
|
run_pip("install", "torch>=2.0.0", "numpy>=1.21.0", "pillow>=9.0.0")
|
|
|
|
# HuggingFace and transformers
|
|
print("\n[2/5] Installing HuggingFace dependencies...")
|
|
run_pip("install", "huggingface_hub>=0.20.0", "transformers>=4.30.0")
|
|
|
|
# Mesh processing
|
|
print("\n[3/5] Installing mesh processing libraries...")
|
|
run_pip("install", "trimesh>=3.0.0", "xatlas")
|
|
|
|
# Background removal
|
|
print("\n[4/5] Installing background removal...")
|
|
run_pip("install", "rembg")
|
|
|
|
# Image processing
|
|
print("\n[5/5] Installing image processing libraries...")
|
|
run_pip("install", "kornia>=0.7.0", "opencv-python-headless>=4.8.0")
|
|
run_pip("install", "scipy>=1.10.0", "einops>=0.6.0")
|
|
|
|
# CUDA-specific packages (may need manual installation)
|
|
print("\n[Note] The following packages may need manual installation:")
|
|
print(" - nvdiffrast: pip install git+https://github.com/NVlabs/nvdiffrast.git")
|
|
print(" - spconv: pip install spconv-cu118 (or cu121 for CUDA 12.1)")
|
|
print(" - flash-attn: pip install flash-attn --no-build-isolation")
|
|
|
|
try:
|
|
run_pip("install", "nvdiffrast")
|
|
except Exception as e:
|
|
print(f" Warning: nvdiffrast installation failed: {e}")
|
|
print(" Try: pip install git+https://github.com/NVlabs/nvdiffrast.git")
|
|
|
|
print("\n" + "="*50)
|
|
print("Installation complete!")
|
|
print("="*50)
|
|
print("\nTo use TRELLIS2, you also need to install the TRELLIS package:")
|
|
print(" pip install git+https://github.com/microsoft/TRELLIS.git")
|
|
print("\nOr follow the instructions at:")
|
|
print(" https://github.com/microsoft/TRELLIS")
|
|
|
|
|
|
def check_dependencies():
|
|
"""Check which dependencies are installed."""
|
|
deps = {
|
|
"torch": "torch",
|
|
"numpy": "numpy",
|
|
"PIL": "pillow",
|
|
"huggingface_hub": "huggingface_hub",
|
|
"transformers": "transformers",
|
|
"trimesh": "trimesh",
|
|
"kornia": "kornia",
|
|
"cv2": "opencv-python",
|
|
"nvdiffrast": "nvdiffrast",
|
|
"rembg": "rembg",
|
|
}
|
|
|
|
print("Checking dependencies...")
|
|
print("-" * 40)
|
|
|
|
for import_name, package_name in deps.items():
|
|
try:
|
|
__import__(import_name)
|
|
print(f" [OK] {package_name}")
|
|
except ImportError:
|
|
print(f" [MISSING] {package_name}")
|
|
|
|
# Check CUDA
|
|
try:
|
|
import torch
|
|
if torch.cuda.is_available():
|
|
print(f"\n CUDA: Available ({torch.cuda.get_device_name(0)})")
|
|
print(f" CUDA Version: {torch.version.cuda}")
|
|
else:
|
|
print("\n CUDA: Not available (CPU only)")
|
|
except Exception as e:
|
|
print(f"\n CUDA check failed: {e}")
|
|
|
|
|
|
if __name__ == "__main__":
|
|
if len(sys.argv) > 1 and sys.argv[1] == "check":
|
|
check_dependencies()
|
|
else:
|
|
install_dependencies()
|
|
print("\nRun 'python install.py check' to verify installation.")
|