diff --git a/comfy/sd.py b/comfy/sd.py index adcd67767..17f3e5395 100644 --- a/comfy/sd.py +++ b/comfy/sd.py @@ -1102,19 +1102,19 @@ class VAE: def spacial_compression_decode(self): try: return self.upscale_ratio[-1] - except: + except (IndexError, TypeError): return self.upscale_ratio def spacial_compression_encode(self): try: return self.downscale_ratio[-1] - except: + except (IndexError, TypeError): return self.downscale_ratio def temporal_compression_decode(self): try: return round(self.upscale_ratio[0](8192) / 8192) - except: + except (IndexError, TypeError, AttributeError): return None diff --git a/comfy/sd1_clip.py b/comfy/sd1_clip.py index d89550840..3ea4ed48a 100644 --- a/comfy/sd1_clip.py +++ b/comfy/sd1_clip.py @@ -358,7 +358,7 @@ def token_weights(string, current_weight): try: weight = float(x[xx+1:]) x = x[:xx] - except: + except ValueError: pass out += token_weights(x, weight) else: @@ -425,7 +425,7 @@ def load_embed(embedding_name, embedding_directory, embedding_size, embed_key=No try: if os.path.commonpath((embed_dir, embed_path)) != embed_dir: continue - except: + except (ValueError, TypeError): continue if not os.path.isfile(embed_path): extensions = ['.safetensors', '.pt', '.bin'] diff --git a/comfy/weight_adapter/lora.py b/comfy/weight_adapter/lora.py index 8e1261a12..678bfbebf 100644 --- a/comfy/weight_adapter/lora.py +++ b/comfy/weight_adapter/lora.py @@ -205,7 +205,7 @@ class LoRAAdapter(WeightAdapterBase): try: reshape = lora[reshape_name].tolist() loaded_keys.add(reshape_name) - except: + except (AttributeError, TypeError): pass weights = (lora[A_name], lora[B_name], alpha, mid, dora_scale, reshape) loaded_keys.add(A_name)