MCPcopy Create free account
hub / github.com/MotrixLab/ViMoGen / WanModelStateDictConverter

Class WanModelStateDictConverter

models/transformer/wan/modules/tm2m_model.py:789–853  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

787
788
789class WanModelStateDictConverter:
790 def __init__(self):
791 pass
792
793 def from_diffusers(self, state_dict):
794 return state_dict
795
796 def from_civitai(self, state_dict):
797 if hash_state_dict_keys(state_dict) == "9269f8db9040a9d860eaca435be61814":
798 config = {
799 "model_type": "t2v",
800 "patch_size": (1, 2, 2),
801 "text_len": 512,
802 "in_dim": 16,
803 "dim": 1536,
804 "ffn_dim": 8960,
805 "freq_dim": 256,
806 "text_dim": 4096,
807 "out_dim": 16,
808 "num_heads": 12,
809 "num_layers": 30,
810 "window_size": (-1, -1),
811 "qk_norm": True,
812 "cross_attn_norm": True,
813 "eps": 1e-6,
814 }
815 elif hash_state_dict_keys(state_dict) == "aafcfd9672c3a2456dc46e1cb6e52c70":
816 config = {
817 "model_type": "t2v",
818 "patch_size": (1, 2, 2),
819 "text_len": 512,
820 "in_dim": 16,
821 "dim": 5120,
822 "ffn_dim": 13824,
823 "freq_dim": 256,
824 "text_dim": 4096,
825 "out_dim": 16,
826 "num_heads": 40,
827 "num_layers": 40,
828 "window_size": (-1, -1),
829 "qk_norm": True,
830 "cross_attn_norm": True,
831 "eps": 1e-6,
832 }
833 elif hash_state_dict_keys(state_dict) == "6bfcfb3b342cb286ce886889d519a77e":
834 config = {
835 "model_type": "i2v",
836 "patch_size": (1, 2, 2),
837 "text_len": 512,
838 "in_dim": 36,
839 "dim": 5120,
840 "ffn_dim": 13824,
841 "freq_dim": 256,
842 "text_dim": 4096,
843 "out_dim": 16,
844 "num_heads": 40,
845 "num_layers": 40,
846 "window_size": (-1, -1),

Callers 1

state_dict_converterMethod · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected