mirror of
https://github.com/invoke-ai/InvokeAI
synced 2024-08-30 20:32:17 +00:00
add board_id association to image
This commit is contained in:
parent
207602f425
commit
a121e6b3a0
@ -260,6 +260,18 @@ class SqliteImageRecordStorage(ImageRecordStorageBase):
|
||||
""",
|
||||
(changes.is_intermediate, image_name),
|
||||
)
|
||||
|
||||
# Change the image's `is_intermediate`` flag
|
||||
if changes.board_id is not None:
|
||||
self._cursor.execute(
|
||||
f"""--sql
|
||||
UPDATE images
|
||||
SET board_id = ?
|
||||
WHERE image_name = ?;
|
||||
""",
|
||||
(changes.board_id, image_name),
|
||||
)
|
||||
|
||||
self._conn.commit()
|
||||
except sqlite3.Error as e:
|
||||
self._conn.rollback()
|
||||
|
@ -72,6 +72,10 @@ class ImageRecordChanges(BaseModel, extra=Extra.forbid):
|
||||
default=None, description="The image's new `is_intermediate` flag."
|
||||
)
|
||||
"""The image's new `is_intermediate` flag."""
|
||||
board_id: Optional[StrictStr] = Field(
|
||||
default=None, description="The image's new board ID."
|
||||
)
|
||||
"""The image's new board ID."""
|
||||
|
||||
|
||||
class ImageUrlsDTO(BaseModel):
|
||||
|
Loading…
Reference in New Issue
Block a user