From 0b11f309cae6780d321ede8dab67270166655fae Mon Sep 17 00:00:00 2001 From: Lincoln Stein Date: Fri, 11 Aug 2023 13:58:41 -0400 Subject: [PATCH] instead of crashing when a corrupted model is detected, warn and move on --- invokeai/backend/model_management/models/sdxl.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/invokeai/backend/model_management/models/sdxl.py b/invokeai/backend/model_management/models/sdxl.py index 1b5d252cb9..5bbe05be98 100644 --- a/invokeai/backend/model_management/models/sdxl.py +++ b/invokeai/backend/model_management/models/sdxl.py @@ -1,6 +1,5 @@ import os import json -import invokeai.backend.util.logging as logger from enum import Enum from pydantic import Field from typing import Literal, Optional @@ -12,6 +11,7 @@ from .base import ( DiffusersModel, read_checkpoint_meta, classproperty, + InvalidModelException, ) from omegaconf import OmegaConf @@ -65,7 +65,7 @@ class StableDiffusionXLModel(DiffusersModel): in_channels = unet_config["in_channels"] else: - raise Exception("Not supported stable diffusion diffusers format(possibly onnx?)") + raise InvalidModelException(f"{path} is not a recognized Stable Diffusion diffusers model") else: raise NotImplementedError(f"Unknown stable diffusion 2.* format: {model_format}")