Catch missing taew2_1.safetensors better
This commit is contained in:
+11
-7
@@ -6,7 +6,7 @@ import comfy.model_management
|
||||
import folder_paths
|
||||
import comfy.utils
|
||||
from comfy.latent_formats import Wan21, Wan22
|
||||
import os
|
||||
from .utils import log
|
||||
import struct
|
||||
|
||||
from .taehv import TAEHV
|
||||
@@ -80,12 +80,16 @@ def get_previewer(device, latent_format):
|
||||
if latent_format == Wan22: # No TAEW currently available for Wan2.2 VAE
|
||||
method = LatentPreviewMethod.Latent2RGB
|
||||
else:
|
||||
taehv_path = folder_paths.get_full_path("vae_approx", "taew2_1.safetensors")
|
||||
if not os.path.exists(taehv_path):
|
||||
raise RuntimeError(f"Could not find {taehv_path}, you can download it from https://huggingface.co/Kijai/WanVideo_comfy/blob/main/taew2_1.safetensors")
|
||||
taesd = TAEHV(comfy.utils.load_torch_file(taehv_path)).to(device)
|
||||
previewer = TAESDPreviewerImpl(taesd)
|
||||
previewer = WrappedPreviewer(previewer, rate=16)
|
||||
try:
|
||||
taehv_path = folder_paths.get_full_path("vae_approx", "taew2_1.safetensors")
|
||||
taesd = TAEHV(comfy.utils.load_torch_file(taehv_path)).to(device)
|
||||
previewer = TAESDPreviewerImpl(taesd)
|
||||
previewer = WrappedPreviewer(previewer, rate=16)
|
||||
except:
|
||||
log.info("Could not find TAEW model file 'taew2_1.safetensors' from models/vae_approx. You can download it from https://huggingface.co/Kijai/WanVideo_comfy/blob/main/taew2_1.safetensors")
|
||||
log.info("Using Latent2RGB previewer instead.")
|
||||
method = LatentPreviewMethod.Latent2RGB
|
||||
|
||||
if previewer is None:
|
||||
if latent_format.latent_rgb_factors is not None:
|
||||
previewer = Latent2RGBPreviewer(latent_format.latent_rgb_factors, latent_format.latent_rgb_factors_bias)
|
||||
|
||||
Reference in New Issue
Block a user