This commit is contained in:
Varun Raj 2026-05-18 12:00:08 +08:00 committed by GitHub
commit a9db4ccb62
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -952,7 +952,20 @@ class UNETLoader:
elif weight_dtype == "fp8_e5m2":
model_options["dtype"] = torch.float8_e5m2
unet_path = folder_paths.get_full_path_or_raise("diffusion_models", unet_name)
try:
unet_path = folder_paths.get_full_path_or_raise("diffusion_models", unet_name)
except FileNotFoundError:
available = folder_paths.get_filename_list("diffusion_models")
available_models = "\n".join(f"- {name}" for name in available[:10])
raise FileNotFoundError(
f"UNet model '{unet_name}' was not found.\n\n"
f"Expected location:\n"
f"ComfyUI/models/unet/\n\n"
f"Available UNet models:\n"
f"{available_models if available_models else '(none found)'}"
)
model = comfy.sd.load_diffusion_model(unet_path, model_options=model_options)
return (model,)