From 6ebecfd8cf1dc3779384e565a65baa9dceb43660 Mon Sep 17 00:00:00 2001 From: Mel Massadian Date: Thu, 18 Apr 2024 13:52:42 +0200 Subject: [PATCH] =?UTF-8?q?feat:=20=E2=9C=A8=20add=20FloatsToFloat?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit I just discovered how most commonly used extensions where dealing with list of values... they mistype it. Not sure the reason this was "standardized", probably to mimic image batches? This node makes mtb FLOATS work with these. --- nodes/graph_utils.py | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/nodes/graph_utils.py b/nodes/graph_utils.py index 2035251..178c304 100644 --- a/nodes/graph_utils.py +++ b/nodes/graph_utils.py @@ -168,6 +168,29 @@ class MTB_MatchDimensions: return (resized_source, new_width, new_height) +class MTB_FloatsToFloat: + """AD, IPA, Fitz etc have commonly choose to mistype float lists as FLOAT. + + This is just a hack to be compatible with these + """ + + @classmethod + def INPUT_TYPES(cls): + return { + "required": { + "floats": ("FLOATS",), + } + } + + RETURN_TYPES = ("FLOAT",) + RETURN_NAMES = ("float",) + CATEGORY = "mtb/utils" + FUNCTION = "convert" + + def convert(self, floats): + return (floats,) + + class MTB_AutoPanEquilateral: """Generate a 360 panning video from an equilateral image.""" @@ -572,4 +595,5 @@ __nodes__ = [ MTB_ApplyTextTemplate, MTB_MatchDimensions, MTB_AutoPanEquilateral, + MTB_FloatsToFloat, ]