From 9ae90af703fd10c0278064c8eef6e601419ba0aa Mon Sep 17 00:00:00 2001 From: Cyber Dick Lang <286878701@qq.com> Date: Fri, 25 Jul 2025 15:53:36 +0800 Subject: [PATCH] =?UTF-8?q?refactor:=20=E5=88=A0=E9=99=A4Show=5FUTK?= =?UTF-8?q?=E8=8A=82=E7=82=B9=20-=20=E7=A7=BB=E9=99=A4show=5Fnodes.py?= =?UTF-8?q?=E6=96=87=E4=BB=B6=20-=20=E6=B8=85=E7=90=86=5F=5Finit=5F=5F.py?= =?UTF-8?q?=E4=B8=AD=E7=9A=84show=E8=8A=82=E7=82=B9=E5=BC=95=E7=94=A8=20-?= =?UTF-8?q?=20=E6=9B=B4=E6=96=B0README.md=E6=96=87=E6=A1=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- README.md | 3 --- __init__.py | 9 ------- nodes/tools/show_nodes.py | 56 --------------------------------------- 3 files changed, 68 deletions(-) delete mode 100644 nodes/tools/show_nodes.py diff --git a/README.md b/README.md index f771f5e..8d3af59 100644 --- a/README.md +++ b/README.md @@ -84,9 +84,6 @@ tqdm ### 🛠️ 工具节点 -#### 显示与预览 -- **Show_UTK**:通用显示节点,支持所有数据类型预览 - #### 文本处理 - **TextboxNode_UTK**:多行文本输入框 - **TextConcatenate_UTK**:文本拼接,支持自定义分隔符 diff --git a/__init__.py b/__init__.py index 213f334..e2068e7 100644 --- a/__init__.py +++ b/__init__.py @@ -325,10 +325,6 @@ try: NODE_CLASS_MAPPINGS as MATH_EXPRESSION_MAPPINGS from .nodes.tools.math_expression_node import \ NODE_DISPLAY_NAME_MAPPINGS as MATH_EXPRESSION_DISPLAY_MAPPINGS - from .nodes.tools.show_nodes import \ - NODE_CLASS_MAPPINGS as SHOW_NODES_MAPPINGS - from .nodes.tools.show_nodes import \ - NODE_DISPLAY_NAME_MAPPINGS as SHOW_NODES_DISPLAY_MAPPINGS from .nodes.tools.text_concatenate_node import \ NODE_CLASS_MAPPINGS as TEXT_CONCATENATE_MAPPINGS from .nodes.tools.text_concatenate_node import \ @@ -342,8 +338,6 @@ try: except ImportError as e: print(f"导入错误: {e}") # 如果模块化导入失败,使用空字典 - SHOW_NODES_MAPPINGS = {} - SHOW_NODES_DISPLAY_MAPPINGS = {} AUDIO_CROP_MAPPINGS = {} AUDIO_CROP_DISPLAY_MAPPINGS = {} MASK_OPERATIONS_MAPPINGS = {} @@ -549,7 +543,6 @@ NODE_CLASS_MAPPINGS.update(CHECK_MASK_MAPPINGS) NODE_CLASS_MAPPINGS.update(PURGE_VRAM_MAPPINGS) NODE_CLASS_MAPPINGS.update(CROP_MASK_MAPPINGS) NODE_CLASS_MAPPINGS.update(RESTORE_CROP_MAPPINGS) -NODE_CLASS_MAPPINGS.update(SHOW_NODES_MAPPINGS) NODE_CLASS_MAPPINGS.update(FILL_MASKED_MAPPINGS) NODE_CLASS_MAPPINGS.update(MASK_OPERATIONS_MAPPINGS) NODE_CLASS_MAPPINGS.update(LOAD_AUDIO_MAPPINGS) @@ -580,7 +573,6 @@ NODE_DISPLAY_NAME_MAPPINGS.update(CHECK_MASK_DISPLAY) NODE_DISPLAY_NAME_MAPPINGS.update(PURGE_VRAM_DISPLAY) NODE_DISPLAY_NAME_MAPPINGS.update(CROP_MASK_DISPLAY) NODE_DISPLAY_NAME_MAPPINGS.update(RESTORE_CROP_DISPLAY) -NODE_DISPLAY_NAME_MAPPINGS.update(SHOW_NODES_DISPLAY_MAPPINGS) NODE_DISPLAY_NAME_MAPPINGS.update(FILL_MASKED_DISPLAY_MAPPINGS) NODE_DISPLAY_NAME_MAPPINGS.update(LOAD_AUDIO_DISPLAY_MAPPINGS) NODE_DISPLAY_NAME_MAPPINGS.update(AUDIO_CROP_DISPLAY_MAPPINGS) @@ -617,7 +609,6 @@ NODE_CATEGORIES = { "PurgeVRAM_UTK", "CropByMask_UTK", "RestoreCropBox_UTK", - "Show_UTK", "TextboxNode_UTK", "TextConcatenate_UTK", "MathExpression_UTK", diff --git a/nodes/tools/show_nodes.py b/nodes/tools/show_nodes.py deleted file mode 100644 index a3c07f8..0000000 --- a/nodes/tools/show_nodes.py +++ /dev/null @@ -1,56 +0,0 @@ -""" -Show Nodes -~~~~~~~~~ - -Display and preview nodes for various data types. - -:copyright: (c) 2024 by May -:license: MIT, see LICENSE for more details. -""" - -import torch - - -class Show_UTK: - CATEGORY = "UniversalToolkit/Tools" - - @classmethod - def INPUT_TYPES(cls): - return { - "required": { - "input": ("STRING", "INT", "FLOAT", "LIST", "MASK", "IMAGE", "LATENT") - } - } - - RETURN_TYPES = ("STRING", "INT", "FLOAT", "LIST", "MASK", "IMAGE", "LATENT") - RETURN_NAMES = ("string", "int", "float", "list", "mask", "image", "latent") - FUNCTION = "show" - IS_PREVIEW = True - - def show(self, input): - outs = [None] * 7 - if isinstance(input, str): - outs[0] = input - elif isinstance(input, int): - outs[1] = input - elif isinstance(input, float): - outs[2] = input - elif isinstance(input, list): - outs[3] = input - elif hasattr(input, "shape") and len(input.shape) == 4 and input.shape[1] == 1: - outs[4] = input # MASK - elif hasattr(input, "shape") and len(input.shape) == 4 and input.shape[1] == 3: - outs[5] = input # IMAGE - elif isinstance(input, dict) and "samples" in input: - outs[6] = input # LATENT - return tuple(outs) - - -# Node mappings -NODE_CLASS_MAPPINGS = { - "Show_UTK": Show_UTK, -} - -NODE_DISPLAY_NAME_MAPPINGS = { - "Show_UTK": "Show (UTK)", -}