chore(api-nodes): auto-discover all nodes_*.py files to avoid merge conflicts when adding new API nodes (#11943)

This commit is contained in:
Alexander Piskun
2026-01-18 08:40:39 +02:00
committed by GitHub
parent a498556d0d
commit 034fac7054

View File

@ -5,6 +5,7 @@ import torch
import os import os
import sys import sys
import json import json
import glob
import hashlib import hashlib
import inspect import inspect
import traceback import traceback
@ -2384,35 +2385,12 @@ async def init_builtin_extra_nodes():
async def init_builtin_api_nodes(): async def init_builtin_api_nodes():
api_nodes_dir = os.path.join(os.path.dirname(os.path.realpath(__file__)), "comfy_api_nodes") api_nodes_dir = os.path.join(os.path.dirname(os.path.realpath(__file__)), "comfy_api_nodes")
api_nodes_files = [ api_nodes_files = sorted(glob.glob(os.path.join(api_nodes_dir, "nodes_*.py")))
"nodes_ideogram.py",
"nodes_openai.py",
"nodes_minimax.py",
"nodes_veo2.py",
"nodes_kling.py",
"nodes_bfl.py",
"nodes_bytedance.py",
"nodes_ltxv.py",
"nodes_luma.py",
"nodes_recraft.py",
"nodes_pixverse.py",
"nodes_stability.py",
"nodes_runway.py",
"nodes_sora.py",
"nodes_topaz.py",
"nodes_tripo.py",
"nodes_meshy.py",
"nodes_moonvalley.py",
"nodes_rodin.py",
"nodes_gemini.py",
"nodes_vidu.py",
"nodes_wan.py",
]
import_failed = [] import_failed = []
for node_file in api_nodes_files: for node_file in api_nodes_files:
if not await load_custom_node(os.path.join(api_nodes_dir, node_file), module_parent="comfy_api_nodes"): if not await load_custom_node(node_file, module_parent="comfy_api_nodes"):
import_failed.append(node_file) import_failed.append(os.path.basename(node_file))
return import_failed return import_failed