mirror of
https://github.com/comfyanonymous/ComfyUI.git
synced 2025-06-03 10:02:09 +08:00
Fix typo in last PR. (#8144)
More robust model detection for future proofing.
This commit is contained in:
parent
c820ef950d
commit
1c2d45d2b5
@ -361,6 +361,8 @@ def detect_unet_config(state_dict, key_prefix, metadata=None):
|
|||||||
dit_config["model_type"] = "vace"
|
dit_config["model_type"] = "vace"
|
||||||
dit_config["vace_in_dim"] = state_dict['{}vace_patch_embedding.weight'.format(key_prefix)].shape[1]
|
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) + '{}.')
|
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:
|
else:
|
||||||
if '{}img_emb.proj.0.bias'.format(key_prefix) in state_dict_keys:
|
if '{}img_emb.proj.0.bias'.format(key_prefix) in state_dict_keys:
|
||||||
dit_config["model_type"] = "i2v"
|
dit_config["model_type"] = "i2v"
|
||||||
|
@ -995,7 +995,7 @@ class WAN21_FunControl2V(WAN21_T2V):
|
|||||||
class WAN21_Camera(WAN21_T2V):
|
class WAN21_Camera(WAN21_T2V):
|
||||||
unet_config = {
|
unet_config = {
|
||||||
"image_model": "wan2.1",
|
"image_model": "wan2.1",
|
||||||
"model_type": "i2v",
|
"model_type": "camera",
|
||||||
"in_dim": 32,
|
"in_dim": 32,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -148,7 +148,7 @@ def get_camera_motion(angle, T, speed, n=81):
|
|||||||
RT = np.stack(RT)
|
RT = np.stack(RT)
|
||||||
return RT
|
return RT
|
||||||
|
|
||||||
class WanCameraEmbeding:
|
class WanCameraEmbedding:
|
||||||
@classmethod
|
@classmethod
|
||||||
def INPUT_TYPES(cls):
|
def INPUT_TYPES(cls):
|
||||||
return {
|
return {
|
||||||
@ -214,5 +214,5 @@ class WanCameraEmbeding:
|
|||||||
|
|
||||||
|
|
||||||
NODE_CLASS_MAPPINGS = {
|
NODE_CLASS_MAPPINGS = {
|
||||||
"WanCameraEmbeding": WanCameraEmbeding,
|
"WanCameraEmbedding": WanCameraEmbedding,
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user