diff --git a/invokeai/app/services/boards/boards_common.py b/invokeai/app/services/boards/boards_common.py index 0cb54102bb..6575c7d764 100644 --- a/invokeai/app/services/boards/boards_common.py +++ b/invokeai/app/services/boards/boards_common.py @@ -12,12 +12,18 @@ class BoardDTO(BoardRecord): """The URL of the thumbnail of the most recent image in the board.""" image_count: int = Field(description="The number of images in the board.") """The number of images in the board.""" + actions: Optional[dict[str, bool]] = Field( + default=None, + description="Allowed actions on board." + ) + """Allowed actions on board.""" -def board_record_to_dto(board_record: BoardRecord, cover_image_name: Optional[str], image_count: int) -> BoardDTO: +def board_record_to_dto(board_record: BoardRecord, cover_image_name: Optional[str], image_count: int, actions: Optional[dict[str, bool]]) -> BoardDTO: """Converts a board record to a board DTO.""" return BoardDTO( **board_record.model_dump(exclude={"cover_image_name"}), cover_image_name=cover_image_name, image_count=image_count, + actions=actions ) diff --git a/invokeai/app/services/images/images_common.py b/invokeai/app/services/images/images_common.py index 198c26c3a2..7265088dc0 100644 --- a/invokeai/app/services/images/images_common.py +++ b/invokeai/app/services/images/images_common.py @@ -29,6 +29,11 @@ class ImageDTO(ImageRecord, ImageUrlsDTO): description="The workflow that generated this image.", ) """The workflow that generated this image.""" + actions: Optional[dict[str, bool]] = Field( + default=None, + description="Allowed actions on image." + ) + """Allowed actions on image.""" def image_record_to_dto( @@ -37,6 +42,7 @@ def image_record_to_dto( thumbnail_url: str, board_id: Optional[str], workflow_id: Optional[str], + actions: Optional[dict[str, bool]] ) -> ImageDTO: """Converts an image record to an image DTO.""" return ImageDTO( @@ -45,4 +51,5 @@ def image_record_to_dto( thumbnail_url=thumbnail_url, board_id=board_id, workflow_id=workflow_id, + actions=actions )