1. Fix Make Image Grid `from torchvision import transforms as TF` -> `import torchvision.transforms.functional as TF` issue. 2. Upgrade Split Image Grid node: ① Reasonable default values: Ensure at least 1 row/column to avoid division by zero errors. ② Better error messages: Provide specific resolution suggestions. ③ Boundary checks: Ensure cropping does not exceed the image area. ④ Empty list protection: Ensure a valid image tensor is always returned. ⑤ Exception handling: Gracefully handle errors in crop mode. 3. Separated the `install.py` file for ComfyUI and the `install_manual.py` file for the `install.bat` file. It should work fine now. 4. Zip IPAdapterPlus.py to IPAdapterPlus.zip to avoid node-conflict attention in ComfyUI Manager. 5. Random Prompter supports both string dictionaries, lists or txt format for YAML files. 6. Add more choices to Random Prompter.
61 lines
1.6 KiB
Python
61 lines
1.6 KiB
Python
#!/usr/bin/env python3
|
|
"""
|
|
JakeUpgrade Nodes Auto-Install Script for ComfyUI
|
|
ComfyUI 自动安装脚本 - 简化版,无用户交互
|
|
"""
|
|
|
|
import sys
|
|
import subprocess
|
|
import os
|
|
from pathlib import Path
|
|
|
|
def run_installation():
|
|
"""执行安装流程"""
|
|
try:
|
|
# 使用当前 Python 解释器
|
|
python_exec = sys.executable
|
|
|
|
# requirements.txt 路径
|
|
current_dir = Path(__file__).parent
|
|
requirements_file = current_dir / "requirements.txt"
|
|
|
|
if not requirements_file.exists():
|
|
print(f"Requirements file not found: {requirements_file}")
|
|
return False
|
|
|
|
# 直接安装依赖
|
|
print("Installing dependencies...")
|
|
result = subprocess.run(
|
|
[python_exec, "-s", "-m", "pip", "install", "-r", str(requirements_file)],
|
|
capture_output=True,
|
|
text=True,
|
|
timeout=300
|
|
)
|
|
|
|
if result.returncode == 0:
|
|
print("Dependencies installed successfully")
|
|
return True
|
|
else:
|
|
print(f"Installation failed: {result.stderr}")
|
|
return False
|
|
|
|
except Exception as e:
|
|
print(f"Installation error: {e}")
|
|
return False
|
|
|
|
def main():
|
|
"""主函数 - 简化版,无用户交互"""
|
|
print("JakeUpgrade Nodes Installer - ComfyUI Mode")
|
|
|
|
success = run_installation()
|
|
|
|
if success:
|
|
print("Installation completed successfully")
|
|
else:
|
|
print("Installation failed")
|
|
|
|
# 不等待用户输入,直接退出
|
|
sys.exit(0 if success else 1)
|
|
|
|
if __name__ == "__main__":
|
|
main() |