mirror of
https://github.com/invoke-ai/InvokeAI.git
synced 2026-04-23 03:00:31 -04:00
refactor(mm): add model config parsing utils
This commit is contained in:
@@ -7,7 +7,8 @@ from pathlib import Path
|
||||
from typing import get_args
|
||||
|
||||
from invokeai.backend.model_hash.model_hash import HASHING_ALGORITHMS
|
||||
from invokeai.backend.model_manager import InvalidModelConfigException, ModelConfigBase, ModelProbe
|
||||
from invokeai.backend.model_manager import InvalidModelConfigException, ModelProbe
|
||||
from invokeai.backend.model_manager.config import ModelConfigFactory
|
||||
|
||||
algos = ", ".join(set(get_args(HASHING_ALGORITHMS)))
|
||||
|
||||
@@ -30,7 +31,7 @@ def classify_with_fallback(path: Path, hash_algo: HASHING_ALGORITHMS):
|
||||
try:
|
||||
return ModelProbe.probe(path, hash_algo=hash_algo)
|
||||
except InvalidModelConfigException:
|
||||
return ModelConfigBase.classify(path, hash_algo)
|
||||
return ModelConfigFactory.from_model_on_disk(mod=path, hash_algo=hash_algo,)
|
||||
|
||||
|
||||
for path in args.model_path:
|
||||
|
||||
Reference in New Issue
Block a user