From ca507d8b651ee51376b46206a26c25fa4ceb34fb Mon Sep 17 00:00:00 2001 From: GACLove Date: Tue, 10 Jun 2025 17:18:00 +0800 Subject: [PATCH] refactor: streamline model and tokenizer path handling in LightX2V classes --- nodes.py | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/nodes.py b/nodes.py index 7567f80..8e3d8b7 100644 --- a/nodes.py +++ b/nodes.py @@ -715,6 +715,14 @@ class Lightx2vWanVideoModelLoader: use_ret_steps = teacache_args["use_ret_steps"] if teacache_args else False coefficients = teacache_args["coefficients"] if teacache_args else [] + mm_config = {} + try: + if mm_type: + mm_config = json.loads(mm_type) + except Exception as e: + logging.error(f"Invalid mm_type config {mm_type}, error:{e}") + mm_config = {} + # 创建配置字典 config = { "do_mm_calib": False, @@ -729,7 +737,7 @@ class Lightx2vWanVideoModelLoader: "use_ret_steps": use_ret_steps, "coefficients": coefficients, "use_bfloat16": dtype == torch.bfloat16, - "mm_config": {} if mm_type is None else {"mm_type": json.loads(mm_type)}, + "mm_config": mm_config, "model_path": str(model_path), "task": model_type, "model_cls": "wan2.1",