From c91621b46c21d368849afd2bf00c18050e09a078 Mon Sep 17 00:00:00 2001 From: psychedelicious <4822129+psychedelicious@users.noreply.github.com> Date: Thu, 17 Aug 2023 11:58:29 +1000 Subject: [PATCH] fix(backend): `BatchProcess.batch_id` is required Providing a `default_factory` is enough for pydantic to know to create the attribute on instantiation if it's not already provided. We can then make make the typing just `str`. --- invokeai/app/services/batch_manager_storage.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/invokeai/app/services/batch_manager_storage.py b/invokeai/app/services/batch_manager_storage.py index 6942bd2587..75a8aa99b8 100644 --- a/invokeai/app/services/batch_manager_storage.py +++ b/invokeai/app/services/batch_manager_storage.py @@ -76,7 +76,7 @@ def uuid_string(): class BatchProcess(BaseModel): - batch_id: Optional[str] = Field(default_factory=uuid_string, description="Identifier for this batch") + batch_id: str = Field(default_factory=uuid_string, description="Identifier for this batch") batch: Batch = Field(description="List of batch configs to apply to this session") canceled: bool = Field(description="Flag for saying whether or not to run sessions from this batch", default=False) graph: Graph = Field(description="The graph being executed")