From ab6d317910f4f90c8e42d9c0a50a0b3701e59217 Mon Sep 17 00:00:00 2001 From: Terry Jia Date: Sat, 24 May 2025 09:00:39 -0400 Subject: [PATCH] add fetch node --- comfy_extras/nodes_api.py | 33 +++++++++++++++++++++++++++++++++ nodes.py | 1 + 2 files changed, 34 insertions(+) create mode 100644 comfy_extras/nodes_api.py diff --git a/comfy_extras/nodes_api.py b/comfy_extras/nodes_api.py new file mode 100644 index 000000000..a61ad1d8f --- /dev/null +++ b/comfy_extras/nodes_api.py @@ -0,0 +1,33 @@ +from comfy.comfy_types import IO, ComfyNodeABC + +class FetchApi(ComfyNodeABC): + @classmethod + def INPUT_TYPES(s): + return {"required": { + "type": (IO.COMBO, {"options": ["input", "output"]}), + "subfolder": (IO.STRING, {}), + "filename": (IO.STRING, {}), + "auto_download": (IO.BOOLEAN, {}), + }} + + FUNCTION = "process" + OUTPUT_NODE = True + + RETURN_TYPES = () + + CATEGORY = "utils/api" + + def process(self, type, subfolder, filename, auto_download, **kwargs): + return { + "ui": { + "result": [type, subfolder, filename] + } + } + +NODE_CLASS_MAPPINGS = { + "FetchApi": FetchApi +} + +NODE_DISPLAY_NAME_MAPPINGS = { + "FetchApi": "Fetch" +} diff --git a/nodes.py b/nodes.py index 1e328651b..049a432b5 100644 --- a/nodes.py +++ b/nodes.py @@ -2257,6 +2257,7 @@ def init_builtin_extra_nodes(): "nodes_ace.py", "nodes_string.py", "nodes_camera_trajectory.py", + "nodes_api.py", ] import_failed = []