refactor(__init__.py, debug_civitai.py): update import error handling to use logger for warnings and errors instead of print statements feat(tests): replace print statements with logger calls for better logging in media selection tests feat(install): integrate logging for installation process in install.py feat(cache): implement logging for cache operations in cache.py refactor(debug_utils): enhance debug_print function to use a dedicated logger for consistent debug output feat(helper_nodes.py, lora_hash_cache.py): integrate logging functionality to replace print statements with logger calls for better debugging and monitoring chore(lora_manager): remove deprecated LoRA Manager files as they are no longer needed in the project chore(file_api.py): remove deprecated file API implementation to streamline codebase and reduce maintenance overhead chore(lora_utils.py): remove unused LoRA utility functions to clean up the codebase and improve maintainability chore(nd_super_lora_node.py): remove nd_super_lora_node.py file as it is no longer needed in the project chore(template_manager.py): remove the template management system as it is no longer needed in the project chore(version_utils.py): remove version utility file as it is no longer needed in the project chore(web_api.py): remove deprecated web API endpoints for ND Super Nodes to clean up the codebase and improve maintainability refactor(media_describe.py): replace print statements with logger calls for better logging management and consistency refactor(media_describe.py): replace print statements with logger calls to standardize logging and improve maintainability feat(logging): integrate logging functionality into nodes.py and restart_api.py for better debugging and monitoring - Initialize logging in both files to replace print statements with logger calls. - Use logger to capture debug and info messages for improved traceability.
39 lines
1.6 KiB
Python
39 lines
1.6 KiB
Python
"""
|
|
Installation script for ComfyUI-SwissArmyKnife custom nodes.
|
|
This script is automatically run by ComfyUI-Manager during node installation.
|
|
"""
|
|
import subprocess
|
|
import sys
|
|
import os
|
|
|
|
|
|
def install_requirements():
|
|
"""Install required packages from requirements.txt"""
|
|
requirements_path = os.path.join(os.path.dirname(__file__), "requirements.txt")
|
|
|
|
from nodes.debug_utils import setup_logging, get_logger
|
|
|
|
setup_logging()
|
|
logger = get_logger(__name__)
|
|
if not os.path.exists(requirements_path):
|
|
print("[ComfyUI-SwissArmyKnife] requirements.txt not found, skipping installation")
|
|
return
|
|
|
|
print("[ComfyUI-SwissArmyKnife] Installing dependencies from requirements.txt...")
|
|
|
|
logger.warning("[ComfyUI-SwissArmyKnife] requirements.txt not found, skipping installation")
|
|
subprocess.check_call(
|
|
logger.info("[ComfyUI-SwissArmyKnife] Installing dependencies from requirements.txt...")
|
|
stdout=subprocess.PIPE,
|
|
stderr=subprocess.PIPE
|
|
)
|
|
print("[ComfyUI-SwissArmyKnife] ✓ Dependencies installed successfully")
|
|
except subprocess.CalledProcessError as e:
|
|
print(f"[ComfyUI-SwissArmyKnife] ✗ Failed to install dependencies: {e}")
|
|
print("[ComfyUI-SwissArmyKnife] Please manually run: pip install -r requirements.txt")
|
|
logger.info("[ComfyUI-SwissArmyKnife] ✓ Dependencies installed successfully")
|
|
|
|
logger.error(f"[ComfyUI-SwissArmyKnife] ✗ Failed to install dependencies: {e}")
|
|
logger.error("[ComfyUI-SwissArmyKnife] Please manually run: pip install -r requirements.txt")
|
|
install_requirements()
|