Skip to content

Commit

Permalink
move location of models folder to data folder
Browse files Browse the repository at this point in the history
  • Loading branch information
w4ffl35 committed Oct 9, 2024
1 parent f5da9f7 commit 58849f7
Show file tree
Hide file tree
Showing 28 changed files with 34 additions and 43 deletions.
2 changes: 1 addition & 1 deletion src/airunner/alembic/env.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
config.set_main_option("sqlalchemy.url", f"sqlite:///{db_path}")

# Import your models here
from airunner.handlers.models.settings_models import (
from airunner.data.models.settings_models import (
Conversation, Message, Summary,
ApplicationSettings, ActiveGridSettings, ControlnetSettings,
ImageToImageSettings, OutpaintSettings, DrawingPadSettings, MetadataSettings,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@
from alembic import op
import sqlalchemy as sa

from airunner.handlers.models import settings_models
from airunner.handlers.models.settings_models import Base
from airunner.data.models import settings_models
from airunner.data.models.settings_models import Base
from airunner.data.bootstrap.controlnet_bootstrap_data import controlnet_bootstrap_data
from airunner.data.bootstrap.font_settings_bootstrap_data import font_settings_bootstrap_data
from airunner.data.bootstrap.imagefilter_bootstrap_data import imagefilter_bootstrap_data
Expand Down
2 changes: 1 addition & 1 deletion src/airunner/app.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
from airunner.mediator_mixin import MediatorMixin
from airunner.plugins.plugin_manager import PluginManager
from airunner.windows.main.settings_mixin import SettingsMixin
from airunner.handlers.models.settings_models import ApplicationSettings, AIModels
from airunner.data.models.settings_models import ApplicationSettings, AIModels


class App(
Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import os
from sqlalchemy import create_engine
from sqlalchemy.orm import sessionmaker
from airunner.handlers.models.settings_models import Base
from airunner.data.models.settings_models import Base

class DatabaseHandler:
def __init__(self, db_path=os.path.expanduser(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@

from sqlalchemy.orm import joinedload

from airunner.handlers.models.database_handler import DatabaseHandler
from airunner.handlers.models.settings_models import Chatbot, AIModels, Schedulers, Lora, PathSettings, SavedPrompt, \
from airunner.data.models.database_handler import DatabaseHandler
from airunner.data.models.settings_models import Chatbot, AIModels, Schedulers, Lora, PathSettings, SavedPrompt, \
Embedding, PromptTemplate, ControlnetModel, FontSetting, PipelineModel, ShortcutKeys, \
GeneratorSettings, WindowSettings, ApplicationSettings, ActiveGridSettings, ControlnetSettings, \
ImageToImageSettings, OutpaintSettings, DrawingPadSettings, MetadataSettings, \
Expand Down
File renamed without changes.
4 changes: 2 additions & 2 deletions src/airunner/handlers/stablediffusion/sd_handler.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,10 +23,10 @@
StableDiffusionXLInpaintPipeline, StableDiffusionXLControlNetPipeline, StableDiffusionXLControlNetImg2ImgPipeline, \
StableDiffusionXLControlNetInpaintPipeline, ControlNetModel
from diffusers.pipelines.stable_diffusion import StableDiffusionSafetyChecker
from transformers import CLIPFeatureExtractor, CLIPTokenizerFast
from transformers import CLIPFeatureExtractor

from airunner.handlers.base_handler import BaseHandler
from airunner.handlers.models.settings_models import Schedulers, Lora, Embedding, ControlnetModel, AIModels, \
from airunner.data.models.settings_models import Schedulers, Lora, Embedding, ControlnetModel, AIModels, \
GeneratorSettings
from airunner.enums import (
SDMode, StableDiffusionVersion, GeneratorSection, ModelStatus, ModelType, SignalCode, HandlerState,
Expand Down
5 changes: 2 additions & 3 deletions src/airunner/utils/models/scan_path_for_items.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
import os
from typing import List, Any

from airunner.handlers.models.settings_db_handler import SettingsDBHandler
from airunner.handlers.models.settings_models import Lora, Embedding
from airunner.data.models.settings_db_handler import SettingsDBHandler
from airunner.data.models.settings_models import Lora, Embedding

def scan_path_for_lora(base_path) -> bool:
lora_added = False
Expand Down
2 changes: 1 addition & 1 deletion src/airunner/utils/os/create_airunner_directory.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import os

from airunner.handlers.models.settings_models import PathSettings
from airunner.data.models.settings_models import PathSettings


def create_airunner_paths(path_settings: PathSettings):
Expand Down
2 changes: 1 addition & 1 deletion src/airunner/utils/snap_to_grid.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import math

from airunner.handlers.models.settings_models import GridSettings
from airunner.data.models.settings_models import GridSettings


def snap_to_grid(settings: GridSettings, x: int, y: int, use_floor: bool = True):
Expand Down
4 changes: 1 addition & 3 deletions src/airunner/widgets/canvas/brush_scene.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
from typing import Optional

import PIL
from PIL import ImageQt
from PIL.Image import Image
Expand All @@ -9,7 +7,7 @@
from PySide6.QtGui import QColor
from PySide6.QtWidgets import QGraphicsPixmapItem

from airunner.handlers.models.settings_models import DrawingPadSettings
from airunner.data.models.settings_models import DrawingPadSettings
from airunner.enums import SignalCode, CanvasToolName
from airunner.utils.convert_base64_to_image import convert_base64_to_image
from airunner.utils.convert_image_to_base64 import convert_image_to_base64
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
from airunner.handlers.models.settings_models import ControlnetModel
from airunner.data.models.settings_models import ControlnetModel
from airunner.enums import SignalCode
from airunner.widgets.base_widget import BaseWidget
from airunner.widgets.controlnet.templates.controlnet_settings_widget_ui import Ui_controlnet_settings_widget
Expand Down
2 changes: 1 addition & 1 deletion src/airunner/widgets/embeddings/embedding_widget.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
from PySide6.QtCore import Slot

from airunner.handlers.models.settings_models import Embedding
from airunner.data.models.settings_models import Embedding
from airunner.enums import SignalCode
from airunner.widgets.base_widget import BaseWidget
from airunner.widgets.embeddings.embedding_trigger_word_widget import EmbeddingTriggerWordWidget
Expand Down
3 changes: 1 addition & 2 deletions src/airunner/widgets/generator_form/generator_form_widget.py
Original file line number Diff line number Diff line change
@@ -1,12 +1,11 @@
import json
import re
import time
from PIL import Image

from PySide6.QtCore import Signal, QRect, QThread, QObject, Slot
from PySide6.QtWidgets import QApplication

from airunner.handlers.models.settings_models import ShortcutKeys
from airunner.data.models.settings_models import ShortcutKeys
from airunner.enums import SignalCode, GeneratorSection, ImageCategory, ImagePreset, StableDiffusionVersion, \
ModelStatus, ModelType
from airunner.mediator_mixin import MediatorMixin
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
from PySide6 import QtCore, QtGui
from PySide6.QtWidgets import QSpacerItem, QSizePolicy, QWidget

from airunner.handlers.models.settings_models import ShortcutKeys
from airunner.data.models.settings_models import ShortcutKeys
from airunner.enums import SignalCode
from airunner.widgets.base_widget import BaseWidget
from airunner.widgets.keyboard_shortcuts.templates.keyboard_shortcut_widget_ui import Ui_keyboard_shortcut_widget
Expand Down
4 changes: 2 additions & 2 deletions src/airunner/widgets/llm/bot_preferences.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
from PySide6.QtCore import Slot
from PySide6.QtWidgets import QInputDialog, QMessageBox, QLabel, QPushButton, QHBoxLayout, QWidget
from PySide6.QtWidgets import QInputDialog, QMessageBox

from airunner.handlers.models.settings_models import TargetFiles, Chatbot
from airunner.data.models.settings_models import TargetFiles, Chatbot
from airunner.enums import SignalCode
from airunner.utils.open_file_path import open_file_path
from airunner.utils.toggle_signals import toggle_signals
Expand Down
2 changes: 1 addition & 1 deletion src/airunner/widgets/llm/llm_history_widget.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

from PySide6.QtWidgets import QVBoxLayout, QPushButton, QSpacerItem, QSizePolicy, QHBoxLayout, QWidget, QLabel

from airunner.handlers.models.settings_models import Message, LLMGeneratorSettings
from airunner.data.models.settings_models import Message, LLMGeneratorSettings
from airunner.enums import SignalCode
from airunner.widgets.base_widget import BaseWidget
from airunner.widgets.llm.templates.llm_history_widget_ui import Ui_llm_history_widget
Expand Down
2 changes: 1 addition & 1 deletion src/airunner/widgets/lora/lora_widget.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
from PySide6.QtCore import QTimer, Slot

from airunner.handlers.models.settings_models import Lora
from airunner.data.models.settings_models import Lora
from airunner.enums import SignalCode
from airunner.widgets.base_widget import BaseWidget
from airunner.widgets.lora.lora_trigger_word_widget import LoraTriggerWordWidget
Expand Down
2 changes: 1 addition & 1 deletion src/airunner/widgets/model_manager/import_widget.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import os
from urllib.parse import urlparse

from airunner.handlers.models.settings_models import Lora, AIModels
from airunner.data.models.settings_models import Lora, AIModels
from airunner.enums import SignalCode
from airunner.widgets.base_widget import BaseWidget
from airunner.widgets.model_manager.templates.import_ui import Ui_import_model_widget
Expand Down
2 changes: 1 addition & 1 deletion src/airunner/widgets/model_manager/model_manager_widget.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
from PySide6.QtCore import Slot
from PySide6.QtWidgets import QFileDialog

from airunner.handlers.models.settings_models import AIModels
from airunner.data.models.settings_models import AIModels
from airunner.enums import SignalCode
from airunner.widgets.model_manager.templates.model_manager_ui import Ui_model_manager
from airunner.windows.base_window import BaseWindow
Expand Down
4 changes: 2 additions & 2 deletions src/airunner/widgets/slider/slider_widget.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
from typing import Any, List
from typing import Any
from PySide6.QtCore import Slot
from PySide6.QtWidgets import QDoubleSpinBox

from airunner.handlers.models.settings_models import Lora
from airunner.data.models.settings_models import Lora
from airunner.widgets.base_widget import BaseWidget
from airunner.widgets.slider.templates.slider_ui import Ui_slider_widget

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
from sqlalchemy import false

from airunner.handlers.models.settings_models import AIModels, GeneratorSettings
from airunner.data.models.settings_models import AIModels, GeneratorSettings
from airunner.enums import SignalCode, GeneratorSection, ImageGenerator
from airunner.widgets.base_widget import BaseWidget
from airunner.widgets.stablediffusion.templates.stable_diffusion_settings_ui import Ui_stable_diffusion_settings_widget
Expand Down
3 changes: 1 addition & 2 deletions src/airunner/windows/filter_window.py
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
import importlib
from functools import partial

from sqlalchemy.orm import joinedload

from airunner.handlers.models.settings_models import ImageFilter
from airunner.data.models.settings_models import ImageFilter
from airunner.enums import SignalCode
from airunner.widgets.slider.filter_slider_widget import FilterSliderWidget
from airunner.windows.base_window import BaseWindow
Expand Down
2 changes: 1 addition & 1 deletion src/airunner/windows/main/main_window.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
from airunner.handlers.llm.agent.actions.bash_execute import bash_execute
from airunner.handlers.llm.agent.actions.show_path import show_path
from airunner.handlers.logger import Logger
from airunner.handlers.models.settings_models import ShortcutKeys, ImageFilter, DrawingPadSettings
from airunner.data.models.settings_models import ShortcutKeys, ImageFilter, DrawingPadSettings
from airunner.app_installer import AppInstaller
from airunner.settings import (
STATUS_ERROR_COLOR,
Expand Down
4 changes: 2 additions & 2 deletions src/airunner/windows/main/settings_mixin.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@

from sqlalchemy.orm import joinedload

from airunner.handlers.models.settings_db_handler import SettingsDBHandler
from airunner.handlers.models.settings_models import ApplicationSettings, LLMGeneratorSettings, GeneratorSettings, \
from airunner.data.models.settings_db_handler import SettingsDBHandler
from airunner.data.models.settings_models import ApplicationSettings, LLMGeneratorSettings, GeneratorSettings, \
ControlnetSettings, BrushSettings, DrawingPadSettings, GridSettings, ActiveGridSettings, \
ImageToImageSettings, OutpaintSettings, PathSettings, MemorySettings, Chatbot, \
AIModels, Schedulers, Lora, ShortcutKeys, SavedPrompt, SpeechT5Settings, TTSSettings, EspeakSettings, \
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,16 +4,15 @@
from PySide6.QtCore import QObject, QThread, Slot, Signal
from sqlalchemy import func

from airunner.handlers.models.settings_models import AIModels, ControlnetModel
from airunner.data.models.settings_models import AIModels, ControlnetModel
from airunner.data.bootstrap.controlnet_bootstrap_data import controlnet_bootstrap_data
from airunner.data.bootstrap.model_bootstrap_data import model_bootstrap_data
from airunner.data.bootstrap.sd_file_bootstrap_data import SD_FILE_BOOTSTRAP_DATA
from airunner.data.bootstrap.llm_file_bootstrap_data import LLM_FILE_BOOTSTRAP_DATA
from airunner.data.bootstrap.whisper import WHISPER_FILES
from airunner.data.bootstrap.speech_t5 import SPEECH_T5_FILES
from airunner.enums import SignalCode
from airunner.mediator_mixin import MediatorMixin
from airunner.settings import DEFAULT_LLM_HF_PATH, NLTK_DOWNLOAD_DIR
from airunner.settings import NLTK_DOWNLOAD_DIR
from airunner.utils.network.huggingface_downloader import HuggingfaceDownloader
from airunner.windows.main.settings_mixin import SettingsMixin
from airunner.windows.setup_wizard.base_wizard import BaseWizard
Expand Down
3 changes: 1 addition & 2 deletions src/airunner/workers/model_scanner_worker.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import os

from airunner.handlers.logger import Logger
from airunner.handlers.models.settings_models import AIModels
from airunner.data.models.settings_models import AIModels
from airunner.enums import SignalCode
from airunner.windows.main.pipeline_mixin import PipelineMixin
from airunner.workers.worker import Worker
Expand Down

0 comments on commit 58849f7

Please sign in to comment.