Better error for incompatible VAE

This commit is contained in:
kijai
2025-02-23 14:25:36 +02:00
parent 5cbc584b68
commit 28ba2dc638
2 changed files with 7 additions and 1 deletions
+2 -1
View File
@@ -8,4 +8,5 @@ logs/
*.DS_Store
.idea
tools/
.vscode/
.vscode/
convert_*
+5
View File
@@ -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)