From 78578b1faf052618c2e03cc975ce8f1abea7144b Mon Sep 17 00:00:00 2001 From: Kent Keirsey <31807370+hipsterusername@users.noreply.github.com> Date: Tue, 28 Mar 2023 23:55:02 -0400 Subject: [PATCH] Updated Fields --- invokeai/app/api/routers/models.py | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/invokeai/app/api/routers/models.py b/invokeai/app/api/routers/models.py index d7cc6a0111..3a2678138b 100644 --- a/invokeai/app/api/routers/models.py +++ b/invokeai/app/api/routers/models.py @@ -34,16 +34,13 @@ class DiffusersModelInfo(ModelInfo): repo_id: Optional[str] = Field(description="The repo ID to use for this model") path: Optional[str] = Field(description="The path to the model") -class modelInfo(ModelInfo): - info: Annotated[Union[CkptModelInfo,DiffusersModelInfo], Field(discriminator="format")] - class CreateModelRequest (BaseModel): name: str = Field(description="The name of the model") - info: Annotated[Union[(CkptModelInfo,DiffusersModelInfo)], Field(discriminator="format")] = Field(description="The model info") + info: Union[CkptModelInfo, DiffusersModelInfo] = Field(..., discriminator="format", description="The model details and configuration") class CreateModelResponse (BaseModel): name: str = Field(description="The name of the new model") - info: modelInfo = Field(description="The model details and configuration") + info: Union[CkptModelInfo, DiffusersModelInfo] = Field(..., discriminator="format", description="The model details and configuration") status: str = Field(description="The status of the API response") class ModelsList(BaseModel):