-
-
Notifications
You must be signed in to change notification settings - Fork 23
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- use binary instead of base64 for images
- use singletons for settingsmixin for improved database access - stop using Logger class - improved logger messages with filenames and line numbers
- Loading branch information
Showing
37 changed files
with
199 additions
and
203 deletions.
There are no files selected for viewing
65 changes: 65 additions & 0 deletions
65
src/airunner/alembic/versions/26a0d29a3af3_change_image_and_mask_columns_to_blob.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,65 @@ | ||
"""Change image and mask columns to BLOB | ||
Revision ID: 26a0d29a3af3 | ||
Revises: f403ff7468e8 | ||
Create Date: 2024-10-24 12:31:37.706170 | ||
""" | ||
from typing import Sequence, Union | ||
|
||
from alembic import op | ||
import sqlalchemy as sa | ||
|
||
# revision identifiers, used by Alembic. | ||
revision: str = '26a0d29a3af3' | ||
down_revision: Union[str, None] = 'f403ff7468e8' | ||
branch_labels: Union[str, Sequence[str], None] = None | ||
depends_on: Union[str, Sequence[str], None] = None | ||
|
||
|
||
def upgrade(): | ||
try: | ||
op.alter_column('controlnet_settings', 'image', type_=sa.LargeBinary, existing_type=sa.String, nullable=True) | ||
op.alter_column('controlnet_settings', 'generated_image', type_=sa.LargeBinary, existing_type=sa.String, nullable=True) | ||
except sa.exc.OperationalError: | ||
pass | ||
|
||
try: | ||
op.alter_column('image_to_image_settings', 'image', type_=sa.LargeBinary, existing_type=sa.String, nullable=True) | ||
except sa.exc.OperationalError: | ||
pass | ||
|
||
try: | ||
op.alter_column('outpaint_settings', 'image', type_=sa.LargeBinary, existing_type=sa.String, nullable=True) | ||
except sa.exc.OperationalError: | ||
pass | ||
|
||
try: | ||
op.alter_column('drawing_pad_settings', 'image', type_=sa.LargeBinary, existing_type=sa.String, nullable=True) | ||
op.alter_column('drawing_pad_settings', 'mask', type_=sa.LargeBinary, existing_type=sa.String, nullable=True) | ||
except sa.exc.OperationalError: | ||
pass | ||
|
||
|
||
def downgrade(): | ||
try: | ||
op.alter_column('controlnet_settings', 'image', type_=sa.String, existing_type=sa.LargeBinary, nullable=True) | ||
op.alter_column('controlnet_settings', 'generated_image', type_=sa.String, existing_type=sa.LargeBinary, nullable=True) | ||
except sa.exc.OperationalError: | ||
pass | ||
|
||
try: | ||
op.alter_column('image_to_image_settings', 'image', type_=sa.String, existing_type=sa.LargeBinary, nullable=True) | ||
except sa.exc.OperationalError: | ||
pass | ||
|
||
try: | ||
op.alter_column('outpaint_settings', 'image', type_=sa.String, existing_type=sa.LargeBinary, nullable=True) | ||
except sa.exc.OperationalError: | ||
pass | ||
|
||
try: | ||
op.alter_column('drawing_pad_settings', 'image', type_=sa.String, existing_type=sa.LargeBinary, nullable=True) | ||
op.alter_column('drawing_pad_settings', 'mask', type_=sa.String, existing_type=sa.LargeBinary, nullable=True) | ||
except sa.exc.OperationalError: | ||
pass |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.