Simplified handling of any input

This commit is contained in:
LaVie024 2025-05-19 19:21:20 +00:00 committed by GitHub
parent 630ded22a9
commit 918d803de4
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -2,14 +2,7 @@ import re
from comfy.comfy_types.node_typing import IO from comfy.comfy_types.node_typing import IO
# Portions of this code is derived from Itdrdata/ComfyUI-Impact-Pack, # Portions of this code is derived from Itdrdata/ComfyUI-Impact-Pack,
# specifically the handling of anytype and parts of the ConvertDataType # specifically the implementation of ConvertDataType.
# node.
class AnyType(str):
def __ne__(self, __value: object) -> bool:
return False
any_typ = AnyType("*")
class ConvertDataType: class ConvertDataType:
def __init__(self): def __init__(self):
@ -17,7 +10,7 @@ class ConvertDataType:
@classmethod @classmethod
def INPUT_TYPES(cls): def INPUT_TYPES(cls):
return {"required": {"value": (any_typ,), return {"required": {"value": ("*"),
"int_mode": (["truncate","round","bankers_rounding"],), "int_mode": (["truncate","round","bankers_rounding"],),
"string_round_value": ("BOOLEAN", {"default": True}), "string_round_value": ("BOOLEAN", {"default": True}),
"string_round_to": ("INT", {"default": 2, "min": 0}) "string_round_to": ("INT", {"default": 2, "min": 0})