mirror of
https://github.com/invoke-ai/InvokeAI
synced 2024-08-30 20:32:17 +00:00
Model manager fixes (#3541)
Fix lora import Fix sd2 config - `variant` field not added Fix list models api - `base_model` arg not provided, redundant assert check
This commit is contained in:
commit
4cbc802e36
@ -80,7 +80,7 @@ async def list_models(
|
||||
),
|
||||
) -> ModelsList:
|
||||
"""Gets a list of models"""
|
||||
models_raw = ApiDependencies.invoker.services.model_manager.list_models(model_type)
|
||||
models_raw = ApiDependencies.invoker.services.model_manager.list_models(base_model, model_type)
|
||||
models = parse_obj_as(ModelsList, { "models": models_raw })
|
||||
return models
|
||||
|
||||
|
@ -512,7 +512,6 @@ class ModelManager(object):
|
||||
named 'model-name', and model_manager.config to get the full OmegaConf
|
||||
object derived from models.yaml
|
||||
"""
|
||||
assert not(model_type is not None and base_model is None), "model_type must be provided with base_model"
|
||||
|
||||
models = dict()
|
||||
for model_key in sorted(self.models, key=str.casefold):
|
||||
|
@ -1,3 +1,4 @@
|
||||
import os
|
||||
import torch
|
||||
from typing import Optional, Union, Literal
|
||||
from .base import (
|
||||
|
@ -123,6 +123,7 @@ class StableDiffusion2Model(DiffusersModel):
|
||||
class DiffusersConfig(ModelConfigBase):
|
||||
format: Literal["diffusers"]
|
||||
vae: Optional[str] = Field(None)
|
||||
variant: ModelVariantType
|
||||
prediction_type: SchedulerPredictionType
|
||||
upcast_attention: bool
|
||||
|
||||
@ -130,6 +131,7 @@ class StableDiffusion2Model(DiffusersModel):
|
||||
format: Literal["checkpoint"]
|
||||
vae: Optional[str] = Field(None)
|
||||
config: Optional[str] = Field(None)
|
||||
variant: ModelVariantType
|
||||
prediction_type: SchedulerPredictionType
|
||||
upcast_attention: bool
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user