From b9980592c4c629be4d46b707c65c14dc2a3da842 Mon Sep 17 00:00:00 2001 From: comfyanonymous <121283862+comfyanonymous@users.noreply.github.com> Date: Wed, 7 May 2025 14:27:16 -0700 Subject: [PATCH] Refuse to load api nodes on old pyav version. (#7981) --- comfy_api_nodes/canary.py | 10 ++++++++++ nodes.py | 3 +++ 2 files changed, 13 insertions(+) create mode 100644 comfy_api_nodes/canary.py diff --git a/comfy_api_nodes/canary.py b/comfy_api_nodes/canary.py new file mode 100644 index 00000000..4df7590b --- /dev/null +++ b/comfy_api_nodes/canary.py @@ -0,0 +1,10 @@ +import av + +ver = av.__version__.split(".") +if int(ver[0]) < 14: + raise Exception("INSTALL NEW VERSION OF PYAV TO USE API NODES.") + +if int(ver[0]) == 14 and int(ver[1]) < 2: + raise Exception("INSTALL NEW VERSION OF PYAV TO USE API NODES.") + +NODE_CLASS_MAPPINGS = {} diff --git a/nodes.py b/nodes.py index d2ffd525..a1ddf2dd 100644 --- a/nodes.py +++ b/nodes.py @@ -2289,6 +2289,9 @@ def init_builtin_api_nodes(): "nodes_pika.py", ] + if not load_custom_node(os.path.join(api_nodes_dir, "canary.py"), module_parent="comfy_api_nodes"): + return api_nodes_files + import_failed = [] for node_file in api_nodes_files: if not load_custom_node(os.path.join(api_nodes_dir, node_file), module_parent="comfy_api_nodes"):