From 3bec5037d77e50c0abb0c24e480e74f716757b01 Mon Sep 17 00:00:00 2001 From: limbicnation Date: Sat, 3 May 2025 19:35:26 +0200 Subject: [PATCH] fix: update __init__.py to remove reference to non-existent file - Remove attempt to import depth_estimation_node_improved - Update version number to 1.1.0 to match improvements - Update Pillow version check to 9.2.0 - Simplify node loading logic - Add better logging for successful node loading --- __init__.py | 56 ++++++++++++++++------------------------------------- 1 file changed, 17 insertions(+), 39 deletions(-) diff --git a/__init__.py b/__init__.py index e399aad..465d939 100644 --- a/__init__.py +++ b/__init__.py @@ -12,7 +12,7 @@ logging.basicConfig(level=logging.INFO) logger = logging.getLogger("DepthEstimation") # Version info -__version__ = "1.0.0" +__version__ = "1.1.0" # Node class mappings - will be populated based on dependency checks NODE_CLASS_MAPPINGS = {} @@ -26,7 +26,7 @@ required_dependencies = { "torch": "2.0.0", "transformers": "4.20.0", "numpy": "1.23.0", - "PIL": "9.1.0", # Pillow is imported as PIL + "PIL": "9.2.0", # Pillow is imported as PIL "timm": "0.6.12", "huggingface_hub": "0.16.0" } @@ -82,45 +82,23 @@ if missing_dependencies: else: # All dependencies are available, import the actual node try: - # Try to import the improved node implementation first - from .depth_estimation_node_improved import DepthEstimationNode, NodeDiagnostics - logger.info("Using improved depth estimation node implementation") - - # Run diagnostics on startup - try: - if NodeDiagnostics: - diag_info = NodeDiagnostics.get_system_info() - logger.info(f"System info: Python {diag_info['python_version'].split()[0]}, " - f"Torch {diag_info['torch_version']}, " - f"CUDA: {diag_info['cuda_available']}") - - health = NodeDiagnostics.check_health() - issues = [check for check in health if check["status"] == "fail"] - if issues: - logger.warning(f"Found {len(issues)} potential issues: " - f"{', '.join([issue['name'] for issue in issues])}") - except Exception as e: - logger.warning(f"Error running diagnostics: {e}") - + # Import the current implementation + from .depth_estimation_node import DepthEstimationNode + logger.info("Successfully loaded depth estimation node") except ImportError as e: - logger.warning(f"Could not import improved node: {e}. Falling back to original implementation.") - # Fallback to original implementation - try: - from .depth_estimation_node import DepthEstimationNode - except ImportError as e: - logger.error(f"Failed to import main node implementation: {e}") + logger.error(f"Failed to import node implementation: {e}") + + # Create minimal placeholder if the import fails + class DepthEstimationNode: + @classmethod + def INPUT_TYPES(cls): + return {"required": {"image": ("IMAGE",)}} + RETURN_TYPES = ("IMAGE",) + FUNCTION = "estimate_depth" + CATEGORY = "depth" - # Create minimal placeholder if even the fallback fails - class DepthEstimationNode: - @classmethod - def INPUT_TYPES(cls): - return {"required": {"image": ("IMAGE",)}} - RETURN_TYPES = ("IMAGE",) - FUNCTION = "estimate_depth" - CATEGORY = "depth" - - def estimate_depth(self, image): - return (image,) # Just pass through the image + def estimate_depth(self, image): + return (image,) # Just pass through the image # Register the actual depth estimation node NODE_CLASS_MAPPINGS = {