add fetch node

This commit is contained in:
Terry Jia 2025-05-24 09:00:39 -04:00
parent 5a87757ef9
commit ab6d317910
2 changed files with 34 additions and 0 deletions

33
comfy_extras/nodes_api.py Normal file
View File

@ -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"
}

View File

@ -2257,6 +2257,7 @@ def init_builtin_extra_nodes():
"nodes_ace.py",
"nodes_string.py",
"nodes_camera_trajectory.py",
"nodes_api.py",
]
import_failed = []