city96 / ComfyUI_ExtraModels

Support for miscellaneous image models. Currently supports: DiT, PixArt, HunYuanDiT, MiaoBi, and a few VAEs.
Apache License 2.0
393 stars 34 forks source link

Support Hunyuan DIT 1.2? #71

Closed LankyPoet closed 4 months ago

LankyPoet commented 5 months ago

Hi, Can support for Hunyuan DIT 1.2 be added please? I attempted to load files from https://huggingface.co/Tencent-Hunyuan/HunyuanDiT-v1.2 and get the following error: Error occurred when executing HYDiTCheckpointLoader: Error(s) in loading state_dict for HunYuanDiT: Missing key(s) in state_dict: "style_embedder.weight". size mismatch for extra_embedder.0.weight: copying a param with shape torch.Size([5632, 1024]) from checkpoint, the shape in current model is torch.Size([5632, 3968]). File "D:\ComfyUI\[execution.py](http://execution.py/)", line 151, in recursive_execute output_data, output_ui = get_output_data(obj, input_data_all) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "D:\ComfyUI\[execution.py](http://execution.py/)", line 81, in get_output_data return_values = map_node_over_list(obj, input_data_all, obj.FUNCTION, allow_interrupt=True) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "D:\ComfyUI\[execution.py](http://execution.py/)", line 74, in map_node_over_list results.append(getattr(obj, func)(**slice_dict(input_data_all, i))) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "D:\ComfyUI\custom_nodes\ComfyUI_ExtraModels\HunYuanDiT\[nodes.py](http://nodes.py/)", line 26, in load_checkpoint model = load_hydit( ^^^^^^^^^^^ File "D:\ComfyUI\custom_nodes\ComfyUI_ExtraModels\HunYuanDiT\[loader.py](http://loader.py/)", line 70, in load_hydit model.diffusion_model.load_state_dict(state_dict) File "D:\ComfyUI\venv\Lib\site-packages\torch\nn\modules\[module.py](http://module.py/)", line 2228, in load_state_dict raise RuntimeError('Error(s) in loading state_dict for {}:\n\t{}'.format(

city96 commented 4 months ago

Done! Select G/2-1.2 in the checkpoint loader.

image

LankyPoet commented 4 months ago

You’re awesome