From 4c157301ffcab156f3da10b7ed8ea33a817f5d8e Mon Sep 17 00:00:00 2001 From: Patrice THIMOTHEE Date: Mon, 25 Aug 2025 13:35:24 +0100 Subject: [PATCH] fix: Fix Preview Info not showing up --- __init__.py | 6 +++--- preview_any.py => preview_info.py | 25 ++++++++++--------------- 2 files changed, 13 insertions(+), 18 deletions(-) rename preview_any.py => preview_info.py (85%) diff --git a/__init__.py b/__init__.py index 76c8e10..d0d4366 100644 --- a/__init__.py +++ b/__init__.py @@ -2,14 +2,14 @@ from .extract_images_node import ExtractImagesFromLatentSync from .extract_audio_info import ExtractAudioInfo from .resize_video_frames import ResizeVideoFrames from .calculate_and_display import CalculateAndDisplay -from .preview_any import PreviewAny +from .preview_info import PreviewInfo NODE_CLASS_MAPPINGS = { "ExtractImagesFromLatentSync": ExtractImagesFromLatentSync, "ExtractAudioInfo": ExtractAudioInfo, "ResizeVideoFrames": ResizeVideoFrames, "CalculateAndDisplay": CalculateAndDisplay, - "PreviewAny": PreviewAny + "PreviewInfo": PreviewInfo } NODE_DISPLAY_NAME_MAPPINGS = { @@ -17,5 +17,5 @@ NODE_DISPLAY_NAME_MAPPINGS = { "ExtractAudioInfo": "🎵 Extract Audio Info", "ResizeVideoFrames": "📐 Resize Video Frames", "CalculateAndDisplay": "🔍 Calculate & Display", - "PreviewAny": "👁️ Preview Any" + "PreviewInfo": "👁️ Preview Info" } \ No newline at end of file diff --git a/preview_any.py b/preview_info.py similarity index 85% rename from preview_any.py rename to preview_info.py index 7320334..2f0415d 100644 --- a/preview_any.py +++ b/preview_info.py @@ -2,16 +2,12 @@ import torch import numpy as np import collections -# Define a custom data type that can accept any data type from other nodes. -# This is a workaround for ComfyUI's strict type-checking. -ANY = "*" - -class PreviewAny: +class PreviewInfo: """ A utility node to preview information about any type of input in the console. This node is useful for debugging and checking the values of variables - at different points in a workflow. It acts as a pass-through node, - allowing the workflow to continue. + at different points in a workflow. It acts as a final node in the workflow, + stopping the execution chain. """ @classmethod @@ -22,15 +18,15 @@ class PreviewAny: """ return { "required": { - "input_data": (ANY, {"forceInput": True}), # The asterisk (*) signifies any data type + "input_data": ("*", {"forceInput": True}), # The asterisk (*) signifies any data type }, "optional": { "title": ("STRING", {"multiline": False, "default": "Preview Any"}), } } - # The node must now return its input to act as a pass-through. - RETURN_TYPES = (ANY,) + # The node now has no return types, making it a "final" or "sink" node. + RETURN_TYPES = () FUNCTION = "preview_info" CATEGORY = "🎨 ThimPatUtils" @@ -93,16 +89,15 @@ class PreviewAny: print(f"Value: {input_data}") print("--------------------") - - # The node must now return its input to act as a pass-through - return (input_data,) + + # No return statement is needed, as this is a final node. # A dictionary that provides the class name and display name for ComfyUI NODE_CLASS_MAPPINGS = { - "PreviewAny": PreviewAny + "PreviewInfo": PreviewInfo } # A dictionary that specifies the nodes' human-readable names NODE_DISPLAY_NAME_MAPPINGS = { - "PreviewAny": "👁️ Preview Any" + "PreviewInfo": "👁️ Preview Info" }