mirror of
https://github.com/invoke-ai/InvokeAI
synced 2024-08-30 20:32:17 +00:00
instead of crashing when a corrupted model is detected, warn and move on
This commit is contained in:
parent
6a8eb392b2
commit
0b11f309ca
@ -1,6 +1,5 @@
|
|||||||
import os
|
import os
|
||||||
import json
|
import json
|
||||||
import invokeai.backend.util.logging as logger
|
|
||||||
from enum import Enum
|
from enum import Enum
|
||||||
from pydantic import Field
|
from pydantic import Field
|
||||||
from typing import Literal, Optional
|
from typing import Literal, Optional
|
||||||
@ -12,6 +11,7 @@ from .base import (
|
|||||||
DiffusersModel,
|
DiffusersModel,
|
||||||
read_checkpoint_meta,
|
read_checkpoint_meta,
|
||||||
classproperty,
|
classproperty,
|
||||||
|
InvalidModelException,
|
||||||
)
|
)
|
||||||
from omegaconf import OmegaConf
|
from omegaconf import OmegaConf
|
||||||
|
|
||||||
@ -65,7 +65,7 @@ class StableDiffusionXLModel(DiffusersModel):
|
|||||||
in_channels = unet_config["in_channels"]
|
in_channels = unet_config["in_channels"]
|
||||||
|
|
||||||
else:
|
else:
|
||||||
raise Exception("Not supported stable diffusion diffusers format(possibly onnx?)")
|
raise InvalidModelException(f"{path} is not a recognized Stable Diffusion diffusers model")
|
||||||
|
|
||||||
else:
|
else:
|
||||||
raise NotImplementedError(f"Unknown stable diffusion 2.* format: {model_format}")
|
raise NotImplementedError(f"Unknown stable diffusion 2.* format: {model_format}")
|
||||||
|
Loading…
Reference in New Issue
Block a user