From 9316534d979986d60b021e78101fa676712522fb Mon Sep 17 00:00:00 2001 From: Lincoln Stein Date: Fri, 10 Nov 2023 17:58:15 -0500 Subject: [PATCH 1/4] Update invokeai/app/services/model_records/model_records_sql.py Co-authored-by: psychedelicious <4822129+psychedelicious@users.noreply.github.com> --- invokeai/app/services/model_records/model_records_sql.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/invokeai/app/services/model_records/model_records_sql.py b/invokeai/app/services/model_records/model_records_sql.py index da911994bb..0bf29570b8 100644 --- a/invokeai/app/services/model_records/model_records_sql.py +++ b/invokeai/app/services/model_records/model_records_sql.py @@ -261,7 +261,7 @@ class ModelRecordServiceSQL(ModelRecordServiceBase): required fields, or a ModelConfigBase instance. """ record = ModelConfigFactory.make_config(config, key=key) # ensure it is a valid config obect - json_serialized = json.dumps(record.model_dump()) # and turn it into a json string. + json_serialized = record.model_dump_json() # and turn it into a json string. with self._db.lock: try: self._cursor.execute( From 33a412a24fa9ef465a5c0ea24e43275cb6971208 Mon Sep 17 00:00:00 2001 From: Lincoln Stein Date: Fri, 10 Nov 2023 18:21:38 -0500 Subject: [PATCH 2/4] Update invokeai/backend/model_manager/config.py Co-authored-by: psychedelicious <4822129+psychedelicious@users.noreply.github.com> --- invokeai/backend/model_manager/config.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/invokeai/backend/model_manager/config.py b/invokeai/backend/model_manager/config.py index 2937eb3a27..e95f851a62 100644 --- a/invokeai/backend/model_manager/config.py +++ b/invokeai/backend/model_manager/config.py @@ -179,7 +179,12 @@ class TextualInversionConfig(ModelConfigBase): class MainConfig(ModelConfigBase): """Model config for main models.""" - vae: Optional[str] = Field(None) +class MainConfig(ModelConfigBase): + """Model config for main models.""" + + vae: Optional[str] = Field(default=None) + variant: ModelVariantType = ModelVariantType.Normal + ztsnr_training: bool = False variant: ModelVariantType = ModelVariantType.Normal ztsnr_training: bool = False From 433f347d7ef376cfc567db9eb14f73f7fdc451bf Mon Sep 17 00:00:00 2001 From: Lincoln Stein Date: Fri, 10 Nov 2023 18:22:54 -0500 Subject: [PATCH 3/4] Update invokeai/app/api/routers/model_records.py Co-authored-by: Ryan Dick --- invokeai/app/api/routers/model_records.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/invokeai/app/api/routers/model_records.py b/invokeai/app/api/routers/model_records.py index d6eb11d671..99ed190e6b 100644 --- a/invokeai/app/api/routers/model_records.py +++ b/invokeai/app/api/routers/model_records.py @@ -34,7 +34,7 @@ ModelsListValidator = TypeAdapter(ModelsList) @model_records_router.get( "/", - operation_id="list_model_recordss", + operation_id="list_model_records", responses={200: {"model": ModelsList}}, ) async def list_model_records( From 1161dfe055e476104c5bb14fb65e10adf0df774b Mon Sep 17 00:00:00 2001 From: Lincoln Stein Date: Fri, 10 Nov 2023 18:24:55 -0500 Subject: [PATCH 4/4] Update invokeai/app/api/routers/model_records.py Co-authored-by: Ryan Dick --- invokeai/app/api/routers/model_records.py | 1 - 1 file changed, 1 deletion(-) diff --git a/invokeai/app/api/routers/model_records.py b/invokeai/app/api/routers/model_records.py index 99ed190e6b..0fcfe5bb18 100644 --- a/invokeai/app/api/routers/model_records.py +++ b/invokeai/app/api/routers/model_records.py @@ -35,7 +35,6 @@ ModelsListValidator = TypeAdapter(ModelsList) @model_records_router.get( "/", operation_id="list_model_records", - responses={200: {"model": ModelsList}}, ) async def list_model_records( base_models: Optional[List[BaseModelType]] = Query(default=None, description="Base models to include"),