From 1c2d45d2b575c40efcb303a61318d4a415242e52 Mon Sep 17 00:00:00 2001 From: comfyanonymous <121283862+comfyanonymous@users.noreply.github.com> Date: Thu, 15 May 2025 16:02:19 -0700 Subject: [PATCH] Fix typo in last PR. (#8144) More robust model detection for future proofing. --- comfy/model_detection.py | 2 ++ comfy/supported_models.py | 2 +- comfy_extras/nodes_camera_trajectory.py | 4 ++-- 3 files changed, 5 insertions(+), 3 deletions(-) diff --git a/comfy/model_detection.py b/comfy/model_detection.py index 28c586389..20f287df9 100644 --- a/comfy/model_detection.py +++ b/comfy/model_detection.py @@ -361,6 +361,8 @@ def detect_unet_config(state_dict, key_prefix, metadata=None): dit_config["model_type"] = "vace" dit_config["vace_in_dim"] = state_dict['{}vace_patch_embedding.weight'.format(key_prefix)].shape[1] dit_config["vace_layers"] = count_blocks(state_dict_keys, '{}vace_blocks.'.format(key_prefix) + '{}.') + elif '{}control_adapter.conv.weight'.format(key_prefix) in state_dict_keys: + dit_config["model_type"] = "camera" else: if '{}img_emb.proj.0.bias'.format(key_prefix) in state_dict_keys: dit_config["model_type"] = "i2v" diff --git a/comfy/supported_models.py b/comfy/supported_models.py index 667393ac0..efe2e6b8f 100644 --- a/comfy/supported_models.py +++ b/comfy/supported_models.py @@ -995,7 +995,7 @@ class WAN21_FunControl2V(WAN21_T2V): class WAN21_Camera(WAN21_T2V): unet_config = { "image_model": "wan2.1", - "model_type": "i2v", + "model_type": "camera", "in_dim": 32, } diff --git a/comfy_extras/nodes_camera_trajectory.py b/comfy_extras/nodes_camera_trajectory.py index b84b4785c..5e0e39f91 100644 --- a/comfy_extras/nodes_camera_trajectory.py +++ b/comfy_extras/nodes_camera_trajectory.py @@ -148,7 +148,7 @@ def get_camera_motion(angle, T, speed, n=81): RT = np.stack(RT) return RT -class WanCameraEmbeding: +class WanCameraEmbedding: @classmethod def INPUT_TYPES(cls): return { @@ -214,5 +214,5 @@ class WanCameraEmbeding: NODE_CLASS_MAPPINGS = { - "WanCameraEmbeding": WanCameraEmbeding, + "WanCameraEmbedding": WanCameraEmbedding, }