From dff5b2201d73c1a91d4b5864e3b974e68846a011 Mon Sep 17 00:00:00 2001 From: Mel Massadian Date: Thu, 25 Apr 2024 20:56:16 +0200 Subject: [PATCH] =?UTF-8?q?feat:=20=E2=9C=A8=20add=20the=20backend=20node?= =?UTF-8?q?=20for=20Constant?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This requires this PR to be merged: https://github.com/comfyanonymous/ComfyUI/pull/3329 There is a trick to make it work without that PR but it feels very hacky, the code for it is kept for reference but unused --- nodes/constant.py | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) create mode 100644 nodes/constant.py diff --git a/nodes/constant.py b/nodes/constant.py new file mode 100644 index 0000000..c83b0f0 --- /dev/null +++ b/nodes/constant.py @@ -0,0 +1,27 @@ +import json + +from ..log import log + + +class MTB_Constant: + @classmethod + def INPUT_TYPES(cls): + return { + "required": {"Value": ("*",)}, + } + + RETURN_TYPES = ("*",) + RETURN_NAMES = ("output",) + CATEGORY = "mtb/utils" + FUNCTION = "execute" + + def execute( + self, + **kwargs, + ): + log.debug("Received kwargs") + log.debug(json.dumps(kwargs, check_circular=True)) + return (kwargs.get("Value"),) + + +__nodes__ = [MTB_Constant]