From 748f94e0e37d5a18ec095b2b5dffa27645ce67b6 Mon Sep 17 00:00:00 2001 From: psychedelicious <4822129+psychedelicious@users.noreply.github.com> Date: Tue, 5 Dec 2023 22:54:48 +1100 Subject: [PATCH] fix(workflow_records): default `category` to `WorkflowCategory.User` This allows old workflows to validate when reading them from the db or image files. --- .../app/services/workflow_records/workflow_records_common.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/invokeai/app/services/workflow_records/workflow_records_common.py b/invokeai/app/services/workflow_records/workflow_records_common.py index 9d9bb8a074..599d2750c2 100644 --- a/invokeai/app/services/workflow_records/workflow_records_common.py +++ b/invokeai/app/services/workflow_records/workflow_records_common.py @@ -36,7 +36,9 @@ class WorkflowCategory(str, Enum, metaclass=MetaEnum): class WorkflowMeta(BaseModel): version: str = Field(description="The version of the workflow schema.") - category: WorkflowCategory = Field(description="The category of the workflow (user or default).") + category: WorkflowCategory = Field( + default=WorkflowCategory.User, description="The category of the workflow (user or default)." + ) @field_validator("version") def validate_version(cls, version: str):