Skip to content

Commit

Permalink
add user_id and project_id as nullable args for image saves
Browse files Browse the repository at this point in the history
  • Loading branch information
Mary Hipp authored and Mary Hipp committed Oct 22, 2024
1 parent e6f80ca commit c2931f0
Show file tree
Hide file tree
Showing 6 changed files with 11 additions and 0 deletions.
1 change: 1 addition & 0 deletions invokeai/app/services/image_files/image_files_base.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
1 change: 1 addition & 0 deletions invokeai/app/services/image_files/image_files_disk.py
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down
2 changes: 2 additions & 0 deletions invokeai/app/services/image_records/image_records_base.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 2 additions & 0 deletions invokeai/app/services/image_records/image_records_sqlite.py
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down
2 changes: 2 additions & 0 deletions invokeai/app/services/images/images_common.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
3 changes: 3 additions & 0 deletions invokeai/app/services/images/images_default.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand All @@ -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)
Expand Down

0 comments on commit c2931f0

Please sign in to comment.