From d456fb797ad9e1f6daddbdaf284ae34cfb2a0656 Mon Sep 17 00:00:00 2001 From: catboxanon <122327233+catboxanon@users.noreply.github.com> Date: Thu, 10 Aug 2023 16:04:49 -0400 Subject: [PATCH] fix: Properly return None when VAE hash is None --- modules/sd_vae.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/modules/sd_vae.py b/modules/sd_vae.py index 1db01992..fd9a1c2a 100644 --- a/modules/sd_vae.py +++ b/modules/sd_vae.py @@ -31,7 +31,9 @@ def get_loaded_vae_hash(): if loaded_vae_file is None: return None - return hashes.sha256(loaded_vae_file, 'vae')[0:10] + sha256 = hashes.sha256(loaded_vae_file, 'vae') + + return sha256[0:10] if sha256 else None def get_base_vae(model):