mirror of
https://github.com/invoke-ai/InvokeAI
synced 2024-08-30 20:32:17 +00:00
fix(mm): fix incorrect calls to update_model
This commit is contained in:
parent
0082ecb22b
commit
e8797787cf
@ -20,6 +20,7 @@ from invokeai.app.services.download import DownloadJob, DownloadQueueServiceBase
|
|||||||
from invokeai.app.services.events.events_base import EventServiceBase
|
from invokeai.app.services.events.events_base import EventServiceBase
|
||||||
from invokeai.app.services.invoker import Invoker
|
from invokeai.app.services.invoker import Invoker
|
||||||
from invokeai.app.services.model_records import DuplicateModelException, ModelRecordServiceBase
|
from invokeai.app.services.model_records import DuplicateModelException, ModelRecordServiceBase
|
||||||
|
from invokeai.app.services.model_records.model_records_base import ModelRecordChanges
|
||||||
from invokeai.app.util.misc import uuid_string
|
from invokeai.app.util.misc import uuid_string
|
||||||
from invokeai.backend.model_manager.config import (
|
from invokeai.backend.model_manager.config import (
|
||||||
AnyModelConfig,
|
AnyModelConfig,
|
||||||
@ -472,7 +473,7 @@ class ModelInstallService(ModelInstallServiceBase):
|
|||||||
self._logger.info(f"Moving {model.name} to {new_path}.")
|
self._logger.info(f"Moving {model.name} to {new_path}.")
|
||||||
new_path = self._move_model(old_path, new_path)
|
new_path = self._move_model(old_path, new_path)
|
||||||
model.path = new_path.relative_to(models_dir).as_posix()
|
model.path = new_path.relative_to(models_dir).as_posix()
|
||||||
self.record_store.update_model(key, model)
|
self.record_store.update_model(key, ModelRecordChanges(path=model.path))
|
||||||
return model
|
return model
|
||||||
|
|
||||||
def _scan_register(self, model: Path) -> bool:
|
def _scan_register(self, model: Path) -> bool:
|
||||||
@ -524,13 +525,6 @@ class ModelInstallService(ModelInstallServiceBase):
|
|||||||
move(old_path, new_path)
|
move(old_path, new_path)
|
||||||
return new_path
|
return new_path
|
||||||
|
|
||||||
# def _probe_model(self, model_path: Path, config: Optional[Dict[str, Any]] = None) -> AnyModelConfig:
|
|
||||||
# info: AnyModelConfig = ModelProbe.probe(Path(model_path))
|
|
||||||
# if config: # used to override probe fields
|
|
||||||
# for key, value in config.items():
|
|
||||||
# setattr(info, key, value)
|
|
||||||
# return info
|
|
||||||
|
|
||||||
def _register(
|
def _register(
|
||||||
self, model_path: Path, config: Optional[Dict[str, Any]] = None, info: Optional[AnyModelConfig] = None
|
self, model_path: Path, config: Optional[Dict[str, Any]] = None, info: Optional[AnyModelConfig] = None
|
||||||
) -> str:
|
) -> str:
|
||||||
|
@ -16,6 +16,7 @@ from diffusers import AutoPipelineForText2Image
|
|||||||
from diffusers.utils import logging as dlogging
|
from diffusers.utils import logging as dlogging
|
||||||
|
|
||||||
from invokeai.app.services.model_install import ModelInstallServiceBase
|
from invokeai.app.services.model_install import ModelInstallServiceBase
|
||||||
|
from invokeai.app.services.model_records.model_records_base import ModelRecordChanges
|
||||||
from invokeai.backend.util.devices import choose_torch_device, torch_dtype
|
from invokeai.backend.util.devices import choose_torch_device, torch_dtype
|
||||||
|
|
||||||
from . import (
|
from . import (
|
||||||
@ -161,5 +162,7 @@ class ModelMerger(object):
|
|||||||
model_config.name = merged_model_name
|
model_config.name = merged_model_name
|
||||||
model_config.description = f"Merge of models {', '.join(model_names)}"
|
model_config.description = f"Merge of models {', '.join(model_names)}"
|
||||||
|
|
||||||
self._installer.record_store.update_model(key, model_config)
|
self._installer.record_store.update_model(
|
||||||
|
key, ModelRecordChanges(name=model_config.name, description=model_config.description)
|
||||||
|
)
|
||||||
return model_config
|
return model_config
|
||||||
|
Loading…
Reference in New Issue
Block a user