From ae6fe0853e2d1ba0f1f47e086befdb089dc07490 Mon Sep 17 00:00:00 2001 From: kijai <40791699+kijai@users.noreply.github.com> Date: Tue, 16 Dec 2025 00:06:21 +0200 Subject: [PATCH] Update nodes.py --- MTV/nodes.py | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/MTV/nodes.py b/MTV/nodes.py index da8d146..2e2cca0 100644 --- a/MTV/nodes.py +++ b/MTV/nodes.py @@ -36,16 +36,17 @@ def check_jit_script_function(): f"this has been modified by another custom node. This may cause issues with the NLF model.") log.warning("--------------------------------") +model_list = [ + "https://github.com/isarandi/nlf/releases/download/v0.3.2/nlf_l_multi_0.3.2.torchscript", + "https://github.com/isarandi/nlf/releases/download/v0.2.2/nlf_l_multi_0.2.2.torchscript", +] + class DownloadAndLoadNLFModel: @classmethod def INPUT_TYPES(s): return { "required": { - "url": ( - [ - "https://github.com/isarandi/nlf/releases/download/v0.3.2/nlf_l_multi_0.3.2.torchscript" - ], - ) + "url": (model_list, {"default": "https://github.com/isarandi/nlf/releases/download/v0.3.2/nlf_l_multi_0.3.2.torchscript"}), }, "optional": { "warmup": ("BOOLEAN", {"default": True, "tooltip": "Whether to warmup the model after loading"}), @@ -58,7 +59,8 @@ class DownloadAndLoadNLFModel: CATEGORY = "WanVideoWrapper" def loadmodel(self, url, warmup=True): - + if url not in model_list: + raise ValueError(f"URL {url} is not in the list of allowed models.") check_jit_script_function() if not os.path.exists(local_model_path):