diff --git a/.gitignore b/.gitignore index 7c5fc03..49a4514 100644 --- a/.gitignore +++ b/.gitignore @@ -8,4 +8,5 @@ logs/ *.DS_Store .idea tools/ -.vscode/ \ No newline at end of file +.vscode/ +convert_* \ No newline at end of file diff --git a/nodes.py b/nodes.py index 049076f..24eb0fa 100644 --- a/nodes.py +++ b/nodes.py @@ -559,6 +559,11 @@ class HyVideoVAELoader: vae_config = json.load(f) model_path = folder_paths.get_full_path("vae", model_name) vae_sd = load_torch_file(model_path, safe_load=True) + + if not "decoder.conv_norm_out.weight" in vae_sd: + raise ValueError(""" +Incompatible VAE model selected, the HunyuanVideoWrapper's VAE nodes require using the original VAE model: 'https://huggingface.co/Kijai/HunyuanVideo_comfy/blob/main/hunyuan_video_vae_bf16.safetensors' +Alternatively you can also use the ComfyUI native VAELoader and the usual VAE nodes with the wrapper.""") vae = AutoencoderKLCausal3D.from_config(vae_config) vae.load_state_dict(vae_sd)