diff --git a/invokeai/app/services/image_files/image_files_base.py b/invokeai/app/services/image_files/image_files_base.py index dc6609aa48c..9280d61632d 100644 --- a/invokeai/app/services/image_files/image_files_base.py +++ b/invokeai/app/services/image_files/image_files_base.py @@ -34,6 +34,7 @@ def save( workflow: Optional[str] = None, graph: Optional[str] = None, thumbnail_size: int = 256, + project_id: Optional[str] = None, ) -> None: """Saves an image and a 256x256 WEBP thumbnail. Returns a tuple of the image name, thumbnail name, and created timestamp.""" pass diff --git a/invokeai/app/services/image_files/image_files_disk.py b/invokeai/app/services/image_files/image_files_disk.py index e5bfd72781d..99537272b58 100644 --- a/invokeai/app/services/image_files/image_files_disk.py +++ b/invokeai/app/services/image_files/image_files_disk.py @@ -54,6 +54,7 @@ def save( workflow: Optional[str] = None, graph: Optional[str] = None, thumbnail_size: int = 256, + project_id: Optional[str] = None, ) -> None: try: self.__validate_storage_folders() diff --git a/invokeai/app/services/image_records/image_records_base.py b/invokeai/app/services/image_records/image_records_base.py index 1211c9762ce..3ae09b19ee0 100644 --- a/invokeai/app/services/image_records/image_records_base.py +++ b/invokeai/app/services/image_records/image_records_base.py @@ -89,6 +89,8 @@ def save( session_id: Optional[str] = None, node_id: Optional[str] = None, metadata: Optional[str] = None, + user_id: Optional[str] = None, + project_id: Optional[str] = None, ) -> datetime: """Saves an image record.""" pass diff --git a/invokeai/app/services/image_records/image_records_sqlite.py b/invokeai/app/services/image_records/image_records_sqlite.py index 2eafdfa2de9..120b0e2b226 100644 --- a/invokeai/app/services/image_records/image_records_sqlite.py +++ b/invokeai/app/services/image_records/image_records_sqlite.py @@ -344,6 +344,8 @@ def save( session_id: Optional[str] = None, node_id: Optional[str] = None, metadata: Optional[str] = None, + user_id: Optional[str] = None, + project_id: Optional[str] = None, ) -> datetime: try: self._lock.acquire() diff --git a/invokeai/app/services/images/images_common.py b/invokeai/app/services/images/images_common.py index 8f27093fe7e..a630a7f2489 100644 --- a/invokeai/app/services/images/images_common.py +++ b/invokeai/app/services/images/images_common.py @@ -52,6 +52,8 @@ class ImageBulkUploadData(BaseModel): graph: Optional[str] = None width: Optional[int] = None height: Optional[int] = None + user_id: Optional[str] = None + project_id: Optional[str] = None class Config: arbitrary_types_allowed = True diff --git a/invokeai/app/services/images/images_default.py b/invokeai/app/services/images/images_default.py index c7d278416df..626c619bcbd 100644 --- a/invokeai/app/services/images/images_default.py +++ b/invokeai/app/services/images/images_default.py @@ -129,6 +129,8 @@ def process_and_save_image(image_data: ImageBulkUploadData): has_workflow=image_data.workflow is not None or image_data.graph is not None, is_intermediate=False, metadata=image_data.metadata, + user_id=image_data.user_id, + project_id=image_data.project_id, ) if image_data.board_id is not None: @@ -142,6 +144,7 @@ def process_and_save_image(image_data: ImageBulkUploadData): metadata=image_data.metadata, workflow=image_data.workflow, graph=image_data.graph, + project_id=image_data.project_id, ) image_dto = self.get_dto(image_data.image_name)