Support models without previews.

This commit is contained in:
comfyanonymous 2023-09-16 12:59:54 -04:00
parent 43d4935a1d
commit 61b1f67734
2 changed files with 9 additions and 2 deletions

View File

@ -1,5 +1,9 @@
class LatentFormat: class LatentFormat:
scale_factor = 1.0
latent_rgb_factors = None
taesd_decoder_name = None
def process_in(self, latent): def process_in(self, latent):
return latent * self.scale_factor return latent * self.scale_factor

View File

@ -53,6 +53,8 @@ def get_previewer(device, latent_format):
method = args.preview_method method = args.preview_method
if method != LatentPreviewMethod.NoPreviews: if method != LatentPreviewMethod.NoPreviews:
# TODO previewer methods # TODO previewer methods
taesd_decoder_path = None
if latent_format.taesd_decoder_name is not None:
taesd_decoder_path = folder_paths.get_full_path("vae_approx", latent_format.taesd_decoder_name) taesd_decoder_path = folder_paths.get_full_path("vae_approx", latent_format.taesd_decoder_name)
if method == LatentPreviewMethod.Auto: if method == LatentPreviewMethod.Auto:
@ -68,6 +70,7 @@ def get_previewer(device, latent_format):
print("Warning: TAESD previews enabled, but could not find models/vae_approx/{}".format(latent_format.taesd_decoder_name)) print("Warning: TAESD previews enabled, but could not find models/vae_approx/{}".format(latent_format.taesd_decoder_name))
if previewer is None: if previewer is None:
if latent_format.latent_rgb_factors is not None:
previewer = Latent2RGBPreviewer(latent_format.latent_rgb_factors) previewer = Latent2RGBPreviewer(latent_format.latent_rgb_factors)
return previewer return previewer