Skip to content

Commit f45157e

Browse files
Fix error message never being shown.
1 parent 5e1fced commit f45157e

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

comfy/sd.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -489,13 +489,13 @@ def load_checkpoint_guess_config(ckpt_path, output_vae=True, output_clip=True, o
489489
load_device = model_management.get_torch_device()
490490

491491
model_config = model_detection.model_config_from_unet(sd, diffusion_model_prefix)
492+
if model_config is None:
493+
raise RuntimeError("ERROR: Could not detect model type of: {}".format(ckpt_path))
494+
492495
unet_dtype = model_management.unet_dtype(model_params=parameters, supported_dtypes=model_config.supported_inference_dtypes)
493496
manual_cast_dtype = model_management.unet_manual_cast(unet_dtype, load_device, model_config.supported_inference_dtypes)
494497
model_config.set_inference_dtype(unet_dtype, manual_cast_dtype)
495498

496-
if model_config is None:
497-
raise RuntimeError("ERROR: Could not detect model type of: {}".format(ckpt_path))
498-
499499
if model_config.clip_vision_prefix is not None:
500500
if output_clipvision:
501501
clipvision = clip_vision.load_clipvision_from_sd(sd, model_config.clip_vision_prefix, True)

0 commit comments

Comments
 (0)