diff --git a/src/airunner/aihandler/llm.py b/src/airunner/aihandler/llm.py index 6319d7822..0409994b6 100644 --- a/src/airunner/aihandler/llm.py +++ b/src/airunner/aihandler/llm.py @@ -2,7 +2,7 @@ import traceback from airunner.aihandler.transformer_runner import TransformerRunner -from airunner.aihandler.logger import Logger as logger +from airunner.aihandler.logger import Logger from airunner.aihandler.enums import MessageCode import os from jinja2 import Environment, FileSystemLoader @@ -143,5 +143,5 @@ def generate(self): answers.append(answer.strip().lower()) return answers else: - logger.error(f"Failed to call generator for {self.generator.name}") + Logger.error(f"Failed to call generator for {self.generator.name}") # self.llm_api.request(**kwargs) diff --git a/src/airunner/alembic/versions/55c1dff62eba_adds_ai_mode_to_settings.py b/src/airunner/alembic/versions/55c1dff62eba_adds_ai_mode_to_settings.py new file mode 100644 index 000000000..3b485aec7 --- /dev/null +++ b/src/airunner/alembic/versions/55c1dff62eba_adds_ai_mode_to_settings.py @@ -0,0 +1,30 @@ +"""Adds ai_mode to settings + +Revision ID: 55c1dff62eba +Revises: 08728ca819b8 +Create Date: 2024-01-09 03:43:41.928457 + +""" +from typing import Sequence, Union + +from alembic import op +import sqlalchemy as sa + + +# revision identifiers, used by Alembic. +revision: str = '55c1dff62eba' +down_revision: Union[str, None] = '08728ca819b8' +branch_labels: Union[str, Sequence[str], None] = None +depends_on: Union[str, Sequence[str], None] = None + + +def upgrade() -> None: + # ### commands auto generated by Alembic - please adjust! ### + op.add_column('settings', sa.Column('ai_mode', sa.Boolean(), nullable=True)) + # ### end Alembic commands ### + + +def downgrade() -> None: + # ### commands auto generated by Alembic - please adjust! ### + op.drop_column('settings', 'ai_mode') + # ### end Alembic commands ### diff --git a/src/airunner/data/models.py b/src/airunner/data/models.py index 1a31fc370..fa10c5f11 100644 --- a/src/airunner/data/models.py +++ b/src/airunner/data/models.py @@ -660,8 +660,8 @@ class Settings(BaseModel): enable_advanced_mode = Column(Boolean, default=False) enable_tts = Column(Boolean, default=True) - generator_settings_override_id = Column(Integer, ForeignKey('generator_settings.id')) + ai_mode = Column(Boolean, default=True) class StandardImageWidgetSettings(BaseModel): diff --git a/src/airunner/tests/test_get_latest_version.py b/src/airunner/tests/test_get_latest_version.py deleted file mode 100644 index bea00f247..000000000 --- a/src/airunner/tests/test_get_latest_version.py +++ /dev/null @@ -1,7 +0,0 @@ -import unittest -from airunner.utils import get_latest_version - - -class TestVersion(unittest.TestCase): - def test_get_latest_version(self): - self.assertEqual(get_latest_version(), "1.12.1") diff --git a/src/airunner/widgets/canvas_plus/standard_image_widget.py b/src/airunner/widgets/canvas_plus/standard_image_widget.py index 556ee284a..64960656a 100644 --- a/src/airunner/widgets/canvas_plus/standard_image_widget.py +++ b/src/airunner/widgets/canvas_plus/standard_image_widget.py @@ -20,6 +20,7 @@ from airunner.widgets.slider.slider_widget import SliderWidget from airunner.data.models import ActionScheduler, Pipeline, GeneratorSetting + class StandardImageWidget(StandardBaseWidget): widget_class_ = Ui_standard_image_widget _pixmap = None diff --git a/src/airunner/widgets/canvas_plus/templates/standard_image_widget.ui b/src/airunner/widgets/canvas_plus/templates/standard_image_widget.ui index 7dae3c629..072abcc5d 100644 --- a/src/airunner/widgets/canvas_plus/templates/standard_image_widget.ui +++ b/src/airunner/widgets/canvas_plus/templates/standard_image_widget.ui @@ -6,8 +6,8 @@ 0 0 - 1181 - 1243 + 690 + 969 @@ -80,415 +80,8 @@ Qt::LeftToRight - 4 + 0 - - - - - - - .. - - - Settings - - - Stable Diffusion settings - - - - 0 - - - 0 - - - 0 - - - 0 - - - - - true - - - - - 0 - 0 - 438 - 1211 - - - - - - - Qt::Vertical - - - - 20 - 40 - - - - - - - - - - Steps - - - handle_value_change - - - 0 - - - 200 - - - 200.000000000000000 - - - false - - - 1 - - - 1 - - - 1 - - - 1 - - - generator.steps - - - - - - - Scale - - - 0 - - - 10000 - - - 100.000000000000000 - - - true - - - 0.010000000000000 - - - 0.010000000000000 - - - handle_value_change - - - generator.scale - - - - - - - - - - - Samples - - - handle_value_change - - - 0 - - - 500 - - - 500.000000000000000 - - - false - - - 1 - - - 1 - - - 1 - - - 1 - - - generator.n_samples - - - - - - - Clip Skip - - - 0 - - - 11 - - - 12.000000000000000 - - - false - - - 1 - - - 1 - - - 0 - - - 0 - - - handle_value_change - - - generator.clip_skip - - - - - - - - - - - DDIM ETA - - - handle_value_change - - - 1 - - - 10 - - - 10 - - - false - - - 1 - - - 1 - - - 1 - - - 1 - - - generator.ddim_eta - - - - - - - Frames - - - handle_value_change - - - 0 - - - 200 - - - 200.000000000000000 - - - false - - - 1 - - - 1 - - - 1 - - - 1 - - - generator.n_samples - - - - - - - - - - - - - - 8 - true - - - - Pipeline - - - - - - - - - - - - - - - 8 - true - - - - Version - - - - - - - - - - - - - - - 8 - true - - - - Model - - - - - - - - - - - - - - - 8 - true - - - - Scheduler - - - - - - - ArrowCursor - - - - - - - - - - - - - - - - - - - generator.random_seed - - - - - - - - - - - - - generator.random_latents_seed - - - - - - - - - - - Presets @@ -507,23 +100,23 @@ - + - Embeddings + LoRA - + - + - + - LoRA + Embeddings - + - + @@ -732,6 +325,458 @@ + + + + + + + .. + + + Settings + + + Stable Diffusion settings + + + + 0 + + + 0 + + + 0 + + + 0 + + + + + QTabWidget::East + + + 1 + + + + + + + Image + + + + 0 + + + 0 + + + 0 + + + 0 + + + + + true + + + + + 0 + 0 + 414 + 933 + + + + + + + + + Samples + + + handle_value_change + + + 0 + + + 500 + + + 500.000000000000000 + + + false + + + 1 + + + 1 + + + 1 + + + 1 + + + generator.n_samples + + + + + + + Clip Skip + + + 0 + + + 11 + + + 12.000000000000000 + + + false + + + 1 + + + 1 + + + 0 + + + 0 + + + handle_value_change + + + generator.clip_skip + + + + + + + + + + + + + + + + + generator.random_seed + + + + + + + + + + + + + generator.random_latents_seed + + + + + + + + + + + Steps + + + handle_value_change + + + 0 + + + 200 + + + 200.000000000000000 + + + false + + + 1 + + + 1 + + + 1 + + + 1 + + + generator.steps + + + + + + + Scale + + + 0 + + + 10000 + + + 100.000000000000000 + + + true + + + 0.010000000000000 + + + 0.010000000000000 + + + handle_value_change + + + generator.scale + + + + + + + + + + + DDIM ETA + + + handle_value_change + + + 1 + + + 10 + + + 10 + + + false + + + 1 + + + 1 + + + 1 + + + 1 + + + generator.ddim_eta + + + + + + + Frames + + + handle_value_change + + + 0 + + + 200 + + + 200.000000000000000 + + + false + + + 1 + + + 1 + + + 1 + + + 1 + + + generator.n_samples + + + + + + + + + + + + + + 8 + true + + + + Pipeline + + + + + + + + + + + + + + + 8 + true + + + + Version + + + + + + + + + + + + + + + 8 + true + + + + Model + + + + + + + + + + + + + + + 8 + true + + + + Scheduler + + + + + + + ArrowCursor + + + + + + + + + + + Qt::Vertical + + + + 20 + 40 + + + + + + + + + + + + + + + + Text + + + + + + + + + + + @@ -785,6 +830,12 @@ + + LLMSettingsWidget + QWidget +
airunner/widgets/llm/llm_settings_widget
+ 1 +
SliderWidget QWidget @@ -848,7 +899,7 @@ 79 - -16 + 0 @@ -864,7 +915,7 @@ 286 - -12 + 0 @@ -912,7 +963,7 @@ 24 - -5 + 0 @@ -927,7 +978,7 @@ 135 - -3 + 0 44 @@ -944,7 +995,7 @@ 259 - -1 + 0 @@ -960,7 +1011,7 @@ 464 - -11 + 0 @@ -976,7 +1027,7 @@ 458 - -17 + 0 @@ -992,7 +1043,7 @@ 418 - -7 + 0 @@ -1008,7 +1059,7 @@ 342 - -12 + 0 diff --git a/src/airunner/widgets/canvas_plus/templates/standard_image_widget_ui.py b/src/airunner/widgets/canvas_plus/templates/standard_image_widget_ui.py index 4e7e3e8d0..82365fdaa 100644 --- a/src/airunner/widgets/canvas_plus/templates/standard_image_widget_ui.py +++ b/src/airunner/widgets/canvas_plus/templates/standard_image_widget_ui.py @@ -12,7 +12,7 @@ class Ui_standard_image_widget(object): def setupUi(self, standard_image_widget): standard_image_widget.setObjectName("standard_image_widget") - standard_image_widget.resize(1181, 1243) + standard_image_widget.resize(690, 969) standard_image_widget.setMaximumSize(QtCore.QSize(16777215, 16777215)) self.gridLayout_2 = QtWidgets.QGridLayout(standard_image_widget) self.gridLayout_2.setContentsMargins(0, 0, 0, 0) @@ -38,49 +38,134 @@ def setupUi(self, standard_image_widget): self.tabWidget.setFont(font) self.tabWidget.setLayoutDirection(QtCore.Qt.LayoutDirection.LeftToRight) self.tabWidget.setObjectName("tabWidget") + self.tab_5 = QtWidgets.QWidget() + self.tab_5.setObjectName("tab_5") + self.gridLayout_3 = QtWidgets.QGridLayout(self.tab_5) + self.gridLayout_3.setObjectName("gridLayout_3") + self.brushes_container = BrushesContainer(parent=self.tab_5) + self.brushes_container.setAcceptDrops(True) + self.brushes_container.setObjectName("brushes_container") + self.gridLayout_17 = QtWidgets.QGridLayout(self.brushes_container) + self.gridLayout_17.setObjectName("gridLayout_17") + self.gridLayout_3.addWidget(self.brushes_container, 0, 0, 1, 1) + self.tabWidget.addTab(self.tab_5, "") + self.tab_4 = QtWidgets.QWidget() + self.tab_4.setObjectName("tab_4") + self.gridLayout_8 = QtWidgets.QGridLayout(self.tab_4) + self.gridLayout_8.setObjectName("gridLayout_8") + self.lora_container_widget = LoraContainerWidget(parent=self.tab_4) + self.lora_container_widget.setObjectName("lora_container_widget") + self.gridLayout_8.addWidget(self.lora_container_widget, 0, 0, 1, 1) + self.tabWidget.addTab(self.tab_4, "") + self.tab_3 = QtWidgets.QWidget() + self.tab_3.setObjectName("tab_3") + self.gridLayout_9 = QtWidgets.QGridLayout(self.tab_3) + self.gridLayout_9.setObjectName("gridLayout_9") + self.embeddings_container_widget = EmbeddingsContainerWidget(parent=self.tab_3) + self.embeddings_container_widget.setObjectName("embeddings_container_widget") + self.gridLayout_9.addWidget(self.embeddings_container_widget, 0, 0, 1, 1) + self.tabWidget.addTab(self.tab_3, "") + self.tab = QtWidgets.QWidget() + self.tab.setObjectName("tab") + self.gridLayout_5 = QtWidgets.QGridLayout(self.tab) + self.gridLayout_5.setObjectName("gridLayout_5") + self.horizontalLayout_4 = QtWidgets.QHBoxLayout() + self.horizontalLayout_4.setObjectName("horizontalLayout_4") + self.samples_widget = SliderWidget(parent=self.tab) + self.samples_widget.setMinimumSize(QtCore.QSize(0, 20)) + self.samples_widget.setProperty("slider_callback", "handle_value_change") + self.samples_widget.setProperty("current_value", 100) + self.samples_widget.setProperty("slider_maximum", 100) + self.samples_widget.setProperty("spinbox_maximum", 1.0) + self.samples_widget.setProperty("display_as_float", True) + self.samples_widget.setProperty("spinbox_single_step", 0.01) + self.samples_widget.setProperty("spinbox_page_step", 0.01) + self.samples_widget.setProperty("spinbox_minimum", 0.0) + self.samples_widget.setProperty("slider_minimum", 0) + self.samples_widget.setObjectName("samples_widget") + self.horizontalLayout_4.addWidget(self.samples_widget) + self.generate_single_simillar_button = QtWidgets.QPushButton(parent=self.tab) + self.generate_single_simillar_button.setCursor(QtGui.QCursor(QtCore.Qt.CursorShape.PointingHandCursor)) + self.generate_single_simillar_button.setObjectName("generate_single_simillar_button") + self.horizontalLayout_4.addWidget(self.generate_single_simillar_button) + self.generate_batch_similar_button = QtWidgets.QPushButton(parent=self.tab) + self.generate_batch_similar_button.setCursor(QtGui.QCursor(QtCore.Qt.CursorShape.PointingHandCursor)) + self.generate_batch_similar_button.setObjectName("generate_batch_similar_button") + self.horizontalLayout_4.addWidget(self.generate_batch_similar_button) + self.gridLayout_5.addLayout(self.horizontalLayout_4, 2, 0, 1, 1) + self.advanced_settings = QtWidgets.QWidget(parent=self.tab) + self.advanced_settings.setObjectName("advanced_settings") + self.gridLayout_4 = QtWidgets.QGridLayout(self.advanced_settings) + self.gridLayout_4.setObjectName("gridLayout_4") + self.input_image_widget = InputImageSettingsWidget(parent=self.advanced_settings) + self.input_image_widget.setObjectName("input_image_widget") + self.gridLayout_4.addWidget(self.input_image_widget, 0, 0, 1, 1) + self.controlnet_settings = ControlNetSettingsWidget(parent=self.advanced_settings) + self.controlnet_settings.setObjectName("controlnet_settings") + self.gridLayout_4.addWidget(self.controlnet_settings, 1, 0, 1, 1) + self.gridLayout_5.addWidget(self.advanced_settings, 1, 0, 1, 1) + spacerItem = QtWidgets.QSpacerItem(20, 40, QtWidgets.QSizePolicy.Policy.Minimum, QtWidgets.QSizePolicy.Policy.Expanding) + self.gridLayout_5.addItem(spacerItem, 3, 0, 1, 1) + self.advanced_settings_checkbox = QtWidgets.QCheckBox(parent=self.tab) + self.advanced_settings_checkbox.setObjectName("advanced_settings_checkbox") + self.gridLayout_5.addWidget(self.advanced_settings_checkbox, 0, 0, 1, 1) + self.tabWidget.addTab(self.tab, "") + self.tab_2 = QtWidgets.QWidget() + self.tab_2.setObjectName("tab_2") + self.gridLayout_6 = QtWidgets.QGridLayout(self.tab_2) + self.gridLayout_6.setObjectName("gridLayout_6") + self.horizontalLayout = QtWidgets.QHBoxLayout() + self.horizontalLayout.setObjectName("horizontalLayout") + self.upscale_model = QtWidgets.QComboBox(parent=self.tab_2) + self.upscale_model.setObjectName("upscale_model") + self.upscale_model.addItem("") + self.upscale_model.addItem("") + self.upscale_model.addItem("") + self.upscale_model.addItem("") + self.upscale_model.addItem("") + self.upscale_model.addItem("") + self.horizontalLayout.addWidget(self.upscale_model) + self.face_enhance = QtWidgets.QCheckBox(parent=self.tab_2) + self.face_enhance.setObjectName("face_enhance") + self.horizontalLayout.addWidget(self.face_enhance) + self.gridLayout_6.addLayout(self.horizontalLayout, 0, 0, 1, 1) + self.horizontalLayout_2 = QtWidgets.QHBoxLayout() + self.horizontalLayout_2.setObjectName("horizontalLayout_2") + self.comboBox = QtWidgets.QComboBox(parent=self.tab_2) + self.comboBox.setObjectName("comboBox") + self.comboBox.addItem("") + self.comboBox.addItem("") + self.horizontalLayout_2.addWidget(self.comboBox) + self.upscale_2x = QtWidgets.QPushButton(parent=self.tab_2) + self.upscale_2x.setCursor(QtGui.QCursor(QtCore.Qt.CursorShape.PointingHandCursor)) + self.upscale_2x.setObjectName("upscale_2x") + self.horizontalLayout_2.addWidget(self.upscale_2x) + self.gridLayout_6.addLayout(self.horizontalLayout_2, 1, 0, 1, 1) + spacerItem1 = QtWidgets.QSpacerItem(20, 40, QtWidgets.QSizePolicy.Policy.Minimum, QtWidgets.QSizePolicy.Policy.Expanding) + self.gridLayout_6.addItem(spacerItem1, 2, 0, 1, 1) + self.tabWidget.addTab(self.tab_2, "") self.tab_6 = QtWidgets.QWidget() self.tab_6.setStyleSheet("") self.tab_6.setObjectName("tab_6") self.gridLayout_11 = QtWidgets.QGridLayout(self.tab_6) self.gridLayout_11.setContentsMargins(0, 0, 0, 0) self.gridLayout_11.setObjectName("gridLayout_11") - self.scrollArea_2 = QtWidgets.QScrollArea(parent=self.tab_6) + self.tabWidget_2 = QtWidgets.QTabWidget(parent=self.tab_6) + self.tabWidget_2.setTabPosition(QtWidgets.QTabWidget.TabPosition.East) + self.tabWidget_2.setObjectName("tabWidget_2") + self.tab_7 = QtWidgets.QWidget() + self.tab_7.setObjectName("tab_7") + self.gridLayout_13 = QtWidgets.QGridLayout(self.tab_7) + self.gridLayout_13.setContentsMargins(0, 0, 0, 0) + self.gridLayout_13.setObjectName("gridLayout_13") + self.scrollArea_2 = QtWidgets.QScrollArea(parent=self.tab_7) self.scrollArea_2.setWidgetResizable(True) self.scrollArea_2.setObjectName("scrollArea_2") self.scrollAreaWidgetContents_2 = QtWidgets.QWidget() - self.scrollAreaWidgetContents_2.setGeometry(QtCore.QRect(0, 0, 438, 1211)) + self.scrollAreaWidgetContents_2.setGeometry(QtCore.QRect(0, 0, 414, 933)) self.scrollAreaWidgetContents_2.setObjectName("scrollAreaWidgetContents_2") self.gridLayout_10 = QtWidgets.QGridLayout(self.scrollAreaWidgetContents_2) self.gridLayout_10.setObjectName("gridLayout_10") - spacerItem = QtWidgets.QSpacerItem(20, 40, QtWidgets.QSizePolicy.Policy.Minimum, QtWidgets.QSizePolicy.Policy.Expanding) - self.gridLayout_10.addItem(spacerItem, 5, 0, 1, 1) - self.horizontalLayout_5 = QtWidgets.QHBoxLayout() - self.horizontalLayout_5.setObjectName("horizontalLayout_5") - self.steps_widget = SliderWidget(parent=self.scrollAreaWidgetContents_2) - self.steps_widget.setProperty("slider_callback", "handle_value_change") - self.steps_widget.setProperty("current_value", 0) - self.steps_widget.setProperty("slider_maximum", 200) - self.steps_widget.setProperty("spinbox_maximum", 200.0) - self.steps_widget.setProperty("display_as_float", False) - self.steps_widget.setProperty("spinbox_single_step", 1) - self.steps_widget.setProperty("spinbox_page_step", 1) - self.steps_widget.setProperty("spinbox_minimum", 1) - self.steps_widget.setProperty("slider_minimum", 1) - self.steps_widget.setProperty("settings_property", "generator.steps") - self.steps_widget.setObjectName("steps_widget") - self.horizontalLayout_5.addWidget(self.steps_widget) - self.scale_widget = SliderWidget(parent=self.scrollAreaWidgetContents_2) - self.scale_widget.setProperty("current_value", 0) - self.scale_widget.setProperty("slider_maximum", 10000) - self.scale_widget.setProperty("spinbox_maximum", 100.0) - self.scale_widget.setProperty("display_as_float", True) - self.scale_widget.setProperty("spinbox_single_step", 0.01) - self.scale_widget.setProperty("spinbox_page_step", 0.01) - self.scale_widget.setProperty("slider_callback", "handle_value_change") - self.scale_widget.setProperty("settings_property", "generator.scale") - self.scale_widget.setObjectName("scale_widget") - self.horizontalLayout_5.addWidget(self.scale_widget) - self.gridLayout_10.addLayout(self.horizontalLayout_5, 2, 0, 1, 1) self.horizontalLayout_6 = QtWidgets.QHBoxLayout() self.horizontalLayout_6.setObjectName("horizontalLayout_6") self.samples_widget_2 = SliderWidget(parent=self.scrollAreaWidgetContents_2) @@ -109,6 +194,46 @@ def setupUi(self, standard_image_widget): self.clip_skip_slider_widget.setObjectName("clip_skip_slider_widget") self.horizontalLayout_6.addWidget(self.clip_skip_slider_widget) self.gridLayout_10.addLayout(self.horizontalLayout_6, 3, 0, 1, 1) + self.horizontalLayout_3 = QtWidgets.QHBoxLayout() + self.horizontalLayout_3.setObjectName("horizontalLayout_3") + self.seed_widget = SeedWidget(parent=self.scrollAreaWidgetContents_2) + self.seed_widget.setProperty("generator_section", "") + self.seed_widget.setProperty("generator_name", "") + self.seed_widget.setObjectName("seed_widget") + self.horizontalLayout_3.addWidget(self.seed_widget) + self.seed_widget_latents = SeedWidget(parent=self.scrollAreaWidgetContents_2) + self.seed_widget_latents.setProperty("generator_section", "") + self.seed_widget_latents.setProperty("generator_name", "") + self.seed_widget_latents.setObjectName("seed_widget_latents") + self.horizontalLayout_3.addWidget(self.seed_widget_latents) + self.gridLayout_10.addLayout(self.horizontalLayout_3, 1, 0, 1, 1) + self.horizontalLayout_5 = QtWidgets.QHBoxLayout() + self.horizontalLayout_5.setObjectName("horizontalLayout_5") + self.steps_widget = SliderWidget(parent=self.scrollAreaWidgetContents_2) + self.steps_widget.setProperty("slider_callback", "handle_value_change") + self.steps_widget.setProperty("current_value", 0) + self.steps_widget.setProperty("slider_maximum", 200) + self.steps_widget.setProperty("spinbox_maximum", 200.0) + self.steps_widget.setProperty("display_as_float", False) + self.steps_widget.setProperty("spinbox_single_step", 1) + self.steps_widget.setProperty("spinbox_page_step", 1) + self.steps_widget.setProperty("spinbox_minimum", 1) + self.steps_widget.setProperty("slider_minimum", 1) + self.steps_widget.setProperty("settings_property", "generator.steps") + self.steps_widget.setObjectName("steps_widget") + self.horizontalLayout_5.addWidget(self.steps_widget) + self.scale_widget = SliderWidget(parent=self.scrollAreaWidgetContents_2) + self.scale_widget.setProperty("current_value", 0) + self.scale_widget.setProperty("slider_maximum", 10000) + self.scale_widget.setProperty("spinbox_maximum", 100.0) + self.scale_widget.setProperty("display_as_float", True) + self.scale_widget.setProperty("spinbox_single_step", 0.01) + self.scale_widget.setProperty("spinbox_page_step", 0.01) + self.scale_widget.setProperty("slider_callback", "handle_value_change") + self.scale_widget.setProperty("settings_property", "generator.scale") + self.scale_widget.setObjectName("scale_widget") + self.horizontalLayout_5.addWidget(self.scale_widget) + self.gridLayout_10.addLayout(self.horizontalLayout_5, 2, 0, 1, 1) self.ddim_frames = QtWidgets.QHBoxLayout() self.ddim_frames.setObjectName("ddim_frames") self.ddim_eta_slider_widget = SliderWidget(parent=self.scrollAreaWidgetContents_2) @@ -194,129 +319,24 @@ def setupUi(self, standard_image_widget): self.verticalLayout_2.addWidget(self.scheduler) self.verticalLayout_3.addLayout(self.verticalLayout_2) self.gridLayout_10.addLayout(self.verticalLayout_3, 0, 0, 1, 1) - self.horizontalLayout_3 = QtWidgets.QHBoxLayout() - self.horizontalLayout_3.setObjectName("horizontalLayout_3") - self.seed_widget = SeedWidget(parent=self.scrollAreaWidgetContents_2) - self.seed_widget.setProperty("generator_section", "") - self.seed_widget.setProperty("generator_name", "") - self.seed_widget.setObjectName("seed_widget") - self.horizontalLayout_3.addWidget(self.seed_widget) - self.seed_widget_latents = SeedWidget(parent=self.scrollAreaWidgetContents_2) - self.seed_widget_latents.setProperty("generator_section", "") - self.seed_widget_latents.setProperty("generator_name", "") - self.seed_widget_latents.setObjectName("seed_widget_latents") - self.horizontalLayout_3.addWidget(self.seed_widget_latents) - self.gridLayout_10.addLayout(self.horizontalLayout_3, 1, 0, 1, 1) + spacerItem2 = QtWidgets.QSpacerItem(20, 40, QtWidgets.QSizePolicy.Policy.Minimum, QtWidgets.QSizePolicy.Policy.Expanding) + self.gridLayout_10.addItem(spacerItem2, 5, 0, 1, 1) self.scrollArea_2.setWidget(self.scrollAreaWidgetContents_2) - self.gridLayout_11.addWidget(self.scrollArea_2, 0, 0, 1, 1) + self.gridLayout_13.addWidget(self.scrollArea_2, 0, 0, 1, 1) + icon = QtGui.QIcon.fromTheme("applications-graphics") + self.tabWidget_2.addTab(self.tab_7, icon, "") + self.tab_8 = QtWidgets.QWidget() + self.tab_8.setObjectName("tab_8") + self.gridLayout_12 = QtWidgets.QGridLayout(self.tab_8) + self.gridLayout_12.setObjectName("gridLayout_12") + self.llm_settings_widget = LLMSettingsWidget(parent=self.tab_8) + self.llm_settings_widget.setObjectName("llm_settings_widget") + self.gridLayout_12.addWidget(self.llm_settings_widget, 0, 0, 1, 1) + icon = QtGui.QIcon.fromTheme("emblem-documents") + self.tabWidget_2.addTab(self.tab_8, icon, "") + self.gridLayout_11.addWidget(self.tabWidget_2, 0, 0, 1, 1) icon = QtGui.QIcon.fromTheme("document-properties") self.tabWidget.addTab(self.tab_6, icon, "") - self.tab_5 = QtWidgets.QWidget() - self.tab_5.setObjectName("tab_5") - self.gridLayout_3 = QtWidgets.QGridLayout(self.tab_5) - self.gridLayout_3.setObjectName("gridLayout_3") - self.brushes_container = BrushesContainer(parent=self.tab_5) - self.brushes_container.setAcceptDrops(True) - self.brushes_container.setObjectName("brushes_container") - self.gridLayout_17 = QtWidgets.QGridLayout(self.brushes_container) - self.gridLayout_17.setObjectName("gridLayout_17") - self.gridLayout_3.addWidget(self.brushes_container, 0, 0, 1, 1) - self.tabWidget.addTab(self.tab_5, "") - self.tab_3 = QtWidgets.QWidget() - self.tab_3.setObjectName("tab_3") - self.gridLayout_9 = QtWidgets.QGridLayout(self.tab_3) - self.gridLayout_9.setObjectName("gridLayout_9") - self.embeddings_container_widget = EmbeddingsContainerWidget(parent=self.tab_3) - self.embeddings_container_widget.setObjectName("embeddings_container_widget") - self.gridLayout_9.addWidget(self.embeddings_container_widget, 0, 0, 1, 1) - self.tabWidget.addTab(self.tab_3, "") - self.tab_4 = QtWidgets.QWidget() - self.tab_4.setObjectName("tab_4") - self.gridLayout_8 = QtWidgets.QGridLayout(self.tab_4) - self.gridLayout_8.setObjectName("gridLayout_8") - self.lora_container_widget = LoraContainerWidget(parent=self.tab_4) - self.lora_container_widget.setObjectName("lora_container_widget") - self.gridLayout_8.addWidget(self.lora_container_widget, 0, 0, 1, 1) - self.tabWidget.addTab(self.tab_4, "") - self.tab = QtWidgets.QWidget() - self.tab.setObjectName("tab") - self.gridLayout_5 = QtWidgets.QGridLayout(self.tab) - self.gridLayout_5.setObjectName("gridLayout_5") - self.horizontalLayout_4 = QtWidgets.QHBoxLayout() - self.horizontalLayout_4.setObjectName("horizontalLayout_4") - self.samples_widget = SliderWidget(parent=self.tab) - self.samples_widget.setMinimumSize(QtCore.QSize(0, 20)) - self.samples_widget.setProperty("slider_callback", "handle_value_change") - self.samples_widget.setProperty("current_value", 100) - self.samples_widget.setProperty("slider_maximum", 100) - self.samples_widget.setProperty("spinbox_maximum", 1.0) - self.samples_widget.setProperty("display_as_float", True) - self.samples_widget.setProperty("spinbox_single_step", 0.01) - self.samples_widget.setProperty("spinbox_page_step", 0.01) - self.samples_widget.setProperty("spinbox_minimum", 0.0) - self.samples_widget.setProperty("slider_minimum", 0) - self.samples_widget.setObjectName("samples_widget") - self.horizontalLayout_4.addWidget(self.samples_widget) - self.generate_single_simillar_button = QtWidgets.QPushButton(parent=self.tab) - self.generate_single_simillar_button.setCursor(QtGui.QCursor(QtCore.Qt.CursorShape.PointingHandCursor)) - self.generate_single_simillar_button.setObjectName("generate_single_simillar_button") - self.horizontalLayout_4.addWidget(self.generate_single_simillar_button) - self.generate_batch_similar_button = QtWidgets.QPushButton(parent=self.tab) - self.generate_batch_similar_button.setCursor(QtGui.QCursor(QtCore.Qt.CursorShape.PointingHandCursor)) - self.generate_batch_similar_button.setObjectName("generate_batch_similar_button") - self.horizontalLayout_4.addWidget(self.generate_batch_similar_button) - self.gridLayout_5.addLayout(self.horizontalLayout_4, 2, 0, 1, 1) - self.advanced_settings = QtWidgets.QWidget(parent=self.tab) - self.advanced_settings.setObjectName("advanced_settings") - self.gridLayout_4 = QtWidgets.QGridLayout(self.advanced_settings) - self.gridLayout_4.setObjectName("gridLayout_4") - self.input_image_widget = InputImageSettingsWidget(parent=self.advanced_settings) - self.input_image_widget.setObjectName("input_image_widget") - self.gridLayout_4.addWidget(self.input_image_widget, 0, 0, 1, 1) - self.controlnet_settings = ControlNetSettingsWidget(parent=self.advanced_settings) - self.controlnet_settings.setObjectName("controlnet_settings") - self.gridLayout_4.addWidget(self.controlnet_settings, 1, 0, 1, 1) - self.gridLayout_5.addWidget(self.advanced_settings, 1, 0, 1, 1) - spacerItem1 = QtWidgets.QSpacerItem(20, 40, QtWidgets.QSizePolicy.Policy.Minimum, QtWidgets.QSizePolicy.Policy.Expanding) - self.gridLayout_5.addItem(spacerItem1, 3, 0, 1, 1) - self.advanced_settings_checkbox = QtWidgets.QCheckBox(parent=self.tab) - self.advanced_settings_checkbox.setObjectName("advanced_settings_checkbox") - self.gridLayout_5.addWidget(self.advanced_settings_checkbox, 0, 0, 1, 1) - self.tabWidget.addTab(self.tab, "") - self.tab_2 = QtWidgets.QWidget() - self.tab_2.setObjectName("tab_2") - self.gridLayout_6 = QtWidgets.QGridLayout(self.tab_2) - self.gridLayout_6.setObjectName("gridLayout_6") - self.horizontalLayout = QtWidgets.QHBoxLayout() - self.horizontalLayout.setObjectName("horizontalLayout") - self.upscale_model = QtWidgets.QComboBox(parent=self.tab_2) - self.upscale_model.setObjectName("upscale_model") - self.upscale_model.addItem("") - self.upscale_model.addItem("") - self.upscale_model.addItem("") - self.upscale_model.addItem("") - self.upscale_model.addItem("") - self.upscale_model.addItem("") - self.horizontalLayout.addWidget(self.upscale_model) - self.face_enhance = QtWidgets.QCheckBox(parent=self.tab_2) - self.face_enhance.setObjectName("face_enhance") - self.horizontalLayout.addWidget(self.face_enhance) - self.gridLayout_6.addLayout(self.horizontalLayout, 0, 0, 1, 1) - self.horizontalLayout_2 = QtWidgets.QHBoxLayout() - self.horizontalLayout_2.setObjectName("horizontalLayout_2") - self.comboBox = QtWidgets.QComboBox(parent=self.tab_2) - self.comboBox.setObjectName("comboBox") - self.comboBox.addItem("") - self.comboBox.addItem("") - self.horizontalLayout_2.addWidget(self.comboBox) - self.upscale_2x = QtWidgets.QPushButton(parent=self.tab_2) - self.upscale_2x.setCursor(QtGui.QCursor(QtCore.Qt.CursorShape.PointingHandCursor)) - self.upscale_2x.setObjectName("upscale_2x") - self.horizontalLayout_2.addWidget(self.upscale_2x) - self.gridLayout_6.addLayout(self.horizontalLayout_2, 1, 0, 1, 1) - spacerItem2 = QtWidgets.QSpacerItem(20, 40, QtWidgets.QSizePolicy.Policy.Minimum, QtWidgets.QSizePolicy.Policy.Expanding) - self.gridLayout_6.addItem(spacerItem2, 2, 0, 1, 1) - self.tabWidget.addTab(self.tab_2, "") self.gridLayout_7.addWidget(self.tabWidget, 0, 0, 1, 1) self.layoutWidget = QtWidgets.QWidget(parent=self.splitter) self.layoutWidget.setObjectName("layoutWidget") @@ -338,7 +358,8 @@ def setupUi(self, standard_image_widget): self.gridLayout_2.addWidget(self.splitter, 0, 0, 1, 1) self.retranslateUi(standard_image_widget) - self.tabWidget.setCurrentIndex(4) + self.tabWidget.setCurrentIndex(0) + self.tabWidget_2.setCurrentIndex(1) self.upscale_model.currentTextChanged['QString'].connect(standard_image_widget.upscale_model_changed) # type: ignore self.face_enhance.clicked['bool'].connect(standard_image_widget.face_enhance_toggled) # type: ignore self.comboBox.currentIndexChanged['int'].connect(standard_image_widget.upscale_number_changed) # type: ignore @@ -355,25 +376,10 @@ def setupUi(self, standard_image_widget): def retranslateUi(self, standard_image_widget): _translate = QtCore.QCoreApplication.translate standard_image_widget.setWindowTitle(_translate("standard_image_widget", "Form")) - self.steps_widget.setProperty("label_text", _translate("standard_image_widget", "Steps")) - self.scale_widget.setProperty("label_text", _translate("standard_image_widget", "Scale")) - self.samples_widget_2.setProperty("label_text", _translate("standard_image_widget", "Samples")) - self.samples_widget_2.setProperty("settings_property", _translate("standard_image_widget", "generator.n_samples")) - self.clip_skip_slider_widget.setProperty("label_text", _translate("standard_image_widget", "Clip Skip")) - self.ddim_eta_slider_widget.setProperty("label_text", _translate("standard_image_widget", "DDIM ETA")) - self.frames_slider_widget.setProperty("label_text", _translate("standard_image_widget", "Frames")) - self.label_5.setText(_translate("standard_image_widget", "Pipeline")) - self.label_6.setText(_translate("standard_image_widget", "Version")) - self.label_3.setText(_translate("standard_image_widget", "Model")) - self.label_4.setText(_translate("standard_image_widget", "Scheduler")) - self.seed_widget.setProperty("property_name", _translate("standard_image_widget", "generator.random_seed")) - self.seed_widget_latents.setProperty("property_name", _translate("standard_image_widget", "generator.random_latents_seed")) - self.tabWidget.setTabText(self.tabWidget.indexOf(self.tab_6), _translate("standard_image_widget", "Settings")) - self.tabWidget.setTabToolTip(self.tabWidget.indexOf(self.tab_6), _translate("standard_image_widget", "Stable Diffusion settings")) self.tabWidget.setTabText(self.tabWidget.indexOf(self.tab_5), _translate("standard_image_widget", "Presets")) self.tabWidget.setTabToolTip(self.tabWidget.indexOf(self.tab_5), _translate("standard_image_widget", "Stable Diffusion setting presets")) - self.tabWidget.setTabText(self.tabWidget.indexOf(self.tab_3), _translate("standard_image_widget", "Embeddings")) self.tabWidget.setTabText(self.tabWidget.indexOf(self.tab_4), _translate("standard_image_widget", "LoRA")) + self.tabWidget.setTabText(self.tabWidget.indexOf(self.tab_3), _translate("standard_image_widget", "Embeddings")) self.samples_widget.setProperty("label_text", _translate("standard_image_widget", "Similarity")) self.samples_widget.setProperty("settings_property", _translate("standard_image_widget", "standard_image_widget_settings.image_similarity")) self.generate_single_simillar_button.setToolTip(_translate("standard_image_widget", "Generate one variation")) @@ -393,11 +399,29 @@ def retranslateUi(self, standard_image_widget): self.comboBox.setItemText(1, _translate("standard_image_widget", "4x")) self.upscale_2x.setText(_translate("standard_image_widget", "Upscale")) self.tabWidget.setTabText(self.tabWidget.indexOf(self.tab_2), _translate("standard_image_widget", "Upscale")) + self.samples_widget_2.setProperty("label_text", _translate("standard_image_widget", "Samples")) + self.samples_widget_2.setProperty("settings_property", _translate("standard_image_widget", "generator.n_samples")) + self.clip_skip_slider_widget.setProperty("label_text", _translate("standard_image_widget", "Clip Skip")) + self.seed_widget.setProperty("property_name", _translate("standard_image_widget", "generator.random_seed")) + self.seed_widget_latents.setProperty("property_name", _translate("standard_image_widget", "generator.random_latents_seed")) + self.steps_widget.setProperty("label_text", _translate("standard_image_widget", "Steps")) + self.scale_widget.setProperty("label_text", _translate("standard_image_widget", "Scale")) + self.ddim_eta_slider_widget.setProperty("label_text", _translate("standard_image_widget", "DDIM ETA")) + self.frames_slider_widget.setProperty("label_text", _translate("standard_image_widget", "Frames")) + self.label_5.setText(_translate("standard_image_widget", "Pipeline")) + self.label_6.setText(_translate("standard_image_widget", "Version")) + self.label_3.setText(_translate("standard_image_widget", "Model")) + self.label_4.setText(_translate("standard_image_widget", "Scheduler")) + self.tabWidget_2.setTabText(self.tabWidget_2.indexOf(self.tab_7), _translate("standard_image_widget", "Image")) + self.tabWidget_2.setTabText(self.tabWidget_2.indexOf(self.tab_8), _translate("standard_image_widget", "Text")) + self.tabWidget.setTabText(self.tabWidget.indexOf(self.tab_6), _translate("standard_image_widget", "Settings")) + self.tabWidget.setTabToolTip(self.tabWidget.indexOf(self.tab_6), _translate("standard_image_widget", "Stable Diffusion settings")) from airunner.widgets.brushes.brushes_container import BrushesContainer from airunner.widgets.canvas_plus.canvas_plus_widget import CanvasPlusWidget from airunner.widgets.controlnet_settings.controlnet_settings_widget import ControlNetSettingsWidget from airunner.widgets.embeddings.embeddings_container_widget import EmbeddingsContainerWidget from airunner.widgets.input_image.input_image_settings_widget import InputImageSettingsWidget +from airunner.widgets.llm.llm_settings_widget import LLMSettingsWidget from airunner.widgets.lora.lora_container_widget import LoraContainerWidget from airunner.widgets.seed.seed_widget import SeedWidget from airunner.widgets.slider.slider_widget import SliderWidget diff --git a/src/airunner/widgets/generator_form/generator_form_widget.py b/src/airunner/widgets/generator_form/generator_form_widget.py index 5cf58d522..446e62d0d 100644 --- a/src/airunner/widgets/generator_form/generator_form_widget.py +++ b/src/airunner/widgets/generator_form/generator_form_widget.py @@ -23,9 +23,6 @@ class GeneratorForm(BaseWidget): initialized = False parent = None generate_signal = pyqtSignal(dict) - icons = ( - ("artificial-intelligence-ai-chip-icon", "ai_button"), - ) @property def is_txt2img(self): @@ -122,10 +119,14 @@ def controlnet_image(self): def __init__(self, *args, **kwargs): super().__init__(*args, **kwargs) + self.ui.generator_form_tabs.tabBar().hide() self.active_grid_settings = session.query(ActiveGridSettings).first() self.canvas_settings = session.query(CanvasSettings).first() - self.settings_manager.changed_signal.connect(self.handle_changed_signal) + self.activate_ai_mode() + + def activate_ai_mode(self): + self.ui.generator_form_tabs.setCurrentIndex(1 if self.settings_manager.ai_mode is True else 0) def toggle_advanced_generation(self): advanced_mode = self.settings_manager.enable_advanced_mode diff --git a/src/airunner/widgets/generator_form/generator_tab_widget.py b/src/airunner/widgets/generator_form/generator_tab_widget.py index 03d713b35..66d274d2b 100644 --- a/src/airunner/widgets/generator_form/generator_tab_widget.py +++ b/src/airunner/widgets/generator_form/generator_tab_widget.py @@ -19,8 +19,6 @@ class GeneratorTabWidget(BaseWidget): def __init__(self, *args, **kwargs): super().__init__(*args, **kwargs) self.app.loaded.connect(self.initialize) - self.ui.generator_tabs.tabBar().hide() - #self.ui.tab_widget_stablediffusion.tabBar().hide() @property def current_generator_widget(self): diff --git a/src/airunner/widgets/generator_form/templates/generatorform.ui b/src/airunner/widgets/generator_form/templates/generatorform.ui index 2ad953d8e..3eff2d839 100644 --- a/src/airunner/widgets/generator_form/templates/generatorform.ui +++ b/src/airunner/widgets/generator_form/templates/generatorform.ui @@ -35,7 +35,7 @@ 0 - + 0 @@ -45,16 +45,16 @@ - 0 + 8 - 0 + 8 - 0 + 8 - 0 + 8 @@ -72,8 +72,8 @@ 0 0 - 357 - 1038 + 341 + 1022 @@ -96,8 +96,17 @@ + + 0 + + + 0 + + + 0 + - 9 + 0 @@ -121,20 +130,6 @@ - - - - - - - - :/icons/light/artificial-intelligence-ai-chip-icon.svg:/icons/light/artificial-intelligence-ai-chip-icon.svg - - - true - - - @@ -161,8 +156,17 @@ + + 0 + - 9 + 0 + + + 0 + + + 0 @@ -227,6 +231,18 @@ Tab 2 + + 8 + + + 8 + + + 8 + + + 8 + diff --git a/src/airunner/widgets/generator_form/templates/generatorform_ui.py b/src/airunner/widgets/generator_form/templates/generatorform_ui.py index a2236295d..fb3317724 100644 --- a/src/airunner/widgets/generator_form/templates/generatorform_ui.py +++ b/src/airunner/widgets/generator_form/templates/generatorform_ui.py @@ -20,12 +20,12 @@ def setupUi(self, generator_form): self.gridLayout_4 = QtWidgets.QGridLayout(generator_form) self.gridLayout_4.setContentsMargins(0, 0, 0, 0) self.gridLayout_4.setObjectName("gridLayout_4") - self.tabWidget = QtWidgets.QTabWidget(parent=generator_form) - self.tabWidget.setObjectName("tabWidget") + self.generator_form_tabs = QtWidgets.QTabWidget(parent=generator_form) + self.generator_form_tabs.setObjectName("generator_form_tabs") self.tab = QtWidgets.QWidget() self.tab.setObjectName("tab") self.gridLayout_3 = QtWidgets.QGridLayout(self.tab) - self.gridLayout_3.setContentsMargins(0, 0, 0, 0) + self.gridLayout_3.setContentsMargins(8, 8, 8, 8) self.gridLayout_3.setObjectName("gridLayout_3") self.scrollArea = QtWidgets.QScrollArea(parent=self.tab) self.scrollArea.setFrameShape(QtWidgets.QFrame.Shape.NoFrame) @@ -33,7 +33,7 @@ def setupUi(self, generator_form): self.scrollArea.setWidgetResizable(True) self.scrollArea.setObjectName("scrollArea") self.scrollAreaWidgetContents = QtWidgets.QWidget() - self.scrollAreaWidgetContents.setGeometry(QtCore.QRect(0, 0, 357, 1038)) + self.scrollAreaWidgetContents.setGeometry(QtCore.QRect(0, 0, 341, 1022)) self.scrollAreaWidgetContents.setObjectName("scrollAreaWidgetContents") self.gridLayout = QtWidgets.QGridLayout(self.scrollAreaWidgetContents) self.gridLayout.setContentsMargins(0, 0, 0, 0) @@ -44,7 +44,7 @@ def setupUi(self, generator_form): self.layoutWidget = QtWidgets.QWidget(parent=self.splitter) self.layoutWidget.setObjectName("layoutWidget") self.gridLayout_2 = QtWidgets.QGridLayout(self.layoutWidget) - self.gridLayout_2.setContentsMargins(0, 0, 0, 9) + self.gridLayout_2.setContentsMargins(0, 0, 0, 0) self.gridLayout_2.setObjectName("gridLayout_2") self.horizontalLayout_6 = QtWidgets.QHBoxLayout() self.horizontalLayout_6.setObjectName("horizontalLayout_6") @@ -53,14 +53,6 @@ def setupUi(self, generator_form): self.pushButton = QtWidgets.QPushButton(parent=self.layoutWidget) self.pushButton.setObjectName("pushButton") self.horizontalLayout_6.addWidget(self.pushButton) - self.ai_button = QtWidgets.QPushButton(parent=self.layoutWidget) - self.ai_button.setText("") - icon = QtGui.QIcon() - icon.addPixmap(QtGui.QPixmap(":/icons/light/artificial-intelligence-ai-chip-icon.svg"), QtGui.QIcon.Mode.Normal, QtGui.QIcon.State.Off) - self.ai_button.setIcon(icon) - self.ai_button.setCheckable(True) - self.ai_button.setObjectName("ai_button") - self.horizontalLayout_6.addWidget(self.ai_button) self.gridLayout_2.addLayout(self.horizontalLayout_6, 0, 1, 1, 1) self.label = QtWidgets.QLabel(parent=self.layoutWidget) font = QtGui.QFont() @@ -75,7 +67,7 @@ def setupUi(self, generator_form): self.layoutWidget1 = QtWidgets.QWidget(parent=self.splitter) self.layoutWidget1.setObjectName("layoutWidget1") self.verticalLayout_6 = QtWidgets.QVBoxLayout(self.layoutWidget1) - self.verticalLayout_6.setContentsMargins(0, 9, 0, 0) + self.verticalLayout_6.setContentsMargins(0, 0, 0, 0) self.verticalLayout_6.setObjectName("verticalLayout_6") self.label_2 = QtWidgets.QLabel(parent=self.layoutWidget1) font = QtGui.QFont() @@ -104,19 +96,20 @@ def setupUi(self, generator_form): self.gridLayout.addLayout(self.horizontalLayout_9, 1, 1, 1, 1) self.scrollArea.setWidget(self.scrollAreaWidgetContents) self.gridLayout_3.addWidget(self.scrollArea, 0, 0, 1, 1) - self.tabWidget.addTab(self.tab, "") + self.generator_form_tabs.addTab(self.tab, "") self.tab_2 = QtWidgets.QWidget() self.tab_2.setObjectName("tab_2") self.gridLayout_5 = QtWidgets.QGridLayout(self.tab_2) + self.gridLayout_5.setContentsMargins(8, 8, 8, 8) self.gridLayout_5.setObjectName("gridLayout_5") self.widget = ChatPromptWidget(parent=self.tab_2) self.widget.setObjectName("widget") self.gridLayout_5.addWidget(self.widget, 0, 0, 1, 1) - self.tabWidget.addTab(self.tab_2, "") - self.gridLayout_4.addWidget(self.tabWidget, 0, 0, 1, 1) + self.generator_form_tabs.addTab(self.tab_2, "") + self.gridLayout_4.addWidget(self.generator_form_tabs, 0, 0, 1, 1) self.retranslateUi(generator_form) - self.tabWidget.setCurrentIndex(0) + self.generator_form_tabs.setCurrentIndex(0) self.pushButton.clicked.connect(generator_form.action_clicked_button_save_prompts) # type: ignore self.interrupt_button.clicked.connect(generator_form.handle_interrupt_button_clicked) # type: ignore self.generate_button.clicked.connect(generator_form.handle_generate_button_clicked) # type: ignore @@ -134,6 +127,6 @@ def retranslateUi(self, generator_form): self.negative_prompt.setPlaceholderText(_translate("generator_form", "Enter a negative prompt...")) self.generate_button.setText(_translate("generator_form", "Generate")) self.interrupt_button.setText(_translate("generator_form", "Interrupt")) - self.tabWidget.setTabText(self.tabWidget.indexOf(self.tab), _translate("generator_form", "Tab 1")) - self.tabWidget.setTabText(self.tabWidget.indexOf(self.tab_2), _translate("generator_form", "Tab 2")) + self.generator_form_tabs.setTabText(self.generator_form_tabs.indexOf(self.tab), _translate("generator_form", "Tab 1")) + self.generator_form_tabs.setTabText(self.generator_form_tabs.indexOf(self.tab_2), _translate("generator_form", "Tab 2")) from airunner.widgets.llm.chat_prompt_widget import ChatPromptWidget diff --git a/src/airunner/widgets/llm/chat_prompt_widget.py b/src/airunner/widgets/llm/chat_prompt_widget.py index cdb60c044..e02cfa613 100644 --- a/src/airunner/widgets/llm/chat_prompt_widget.py +++ b/src/airunner/widgets/llm/chat_prompt_widget.py @@ -25,7 +25,7 @@ class ChatPromptWidget(BaseWidget): @property def generator(self): try: - return self.app.ui.llm_widget.generator + return self.app.generator except Exception as e: Logger.error(e) import traceback @@ -34,7 +34,7 @@ def generator(self): @property def generator_settings(self): try: - return self.app.ui.llm_widget.generator_settings + return self.app.generator_settings except Exception as e: Logger.error(e) @@ -66,6 +66,13 @@ def initialize(self): self.ui.prompt.textChanged.connect(self.prompt_text_changed) self.ui.conversation.hide() self.ui.chat_container.show() + + self.ui.username.blockSignals(True) + self.ui.botname.blockSignals(True) + self.ui.username.setText(self.generator.username) + self.ui.botname.setText(self.generator.botname) + self.ui.username.blockSignals(False) + self.ui.botname.blockSignals(False) def handle_token_signal(self, val): if val != "[END]": @@ -305,3 +312,22 @@ def action_button_clicked_clear_conversation(self): def message_type_text_changed(self, val): self.generator.message_type = val save_session() + + def action_button_clicked_generate_characters(self): + pass + + def prefix_text_changed(self): + self.generator.prefix = self.ui.prefix.toPlainText() + save_session() + + def suffix_text_changed(self): + self.generator.suffix = self.ui.suffix.toPlainText() + save_session() + + def username_text_changed(self, val): + self.generator.username = val + save_session() + + def botname_text_changed(self, val): + self.generator.botname = val + save_session() \ No newline at end of file diff --git a/src/airunner/widgets/llm/llm_preferences_widget.py b/src/airunner/widgets/llm/llm_preferences_widget.py deleted file mode 100644 index 91fed15a1..000000000 --- a/src/airunner/widgets/llm/llm_preferences_widget.py +++ /dev/null @@ -1,62 +0,0 @@ -from airunner.widgets.base_widget import BaseWidget -from airunner.widgets.llm.templates.llm_preferences_ui import Ui_llm_preferences_widget -from airunner.utils import get_session, save_session -from airunner.data.models import LLMPromptTemplate -from airunner.widgets.base_widget import BaseWidget -from airunner.aihandler.logger import Logger - - - -class LLMPreferencesWidget(BaseWidget): - widget_class_ = Ui_llm_preferences_widget - - @property - def generator(self): - try: - return self.app.ui.llm_widget.generator - except Exception as e: - Logger.error(e) - import traceback - traceback.print_exc() - - @property - def generator_settings(self): - try: - return self.app.ui.llm_widget.generator_settings - except Exception as e: - Logger.error(e) - - def initialize(self): - self.ui.prefix.blockSignals(True) - self.ui.suffix.blockSignals(True) - self.ui.personality_type.blockSignals(True) - if self.generator: - self.ui.prefix.setPlainText(self.generator.prefix) - self.ui.suffix.setPlainText(self.generator.suffix) - self.ui.personality_type.setCurrentText(self.generator.bot_personality) - self.ui.prefix.blockSignals(False) - self.ui.suffix.blockSignals(False) - self.ui.personality_type.blockSignals(False) - - def action_button_clicked_generate_characters(self): - pass - - def personality_type_changed(self, val): - self.generator.bot_personality = val - save_session() - - def prefix_text_changed(self): - self.generator.prefix = self.ui.prefix.toPlainText() - save_session() - - def suffix_text_changed(self): - self.generator.suffix = self.ui.suffix.toPlainText() - save_session() - - def username_text_changed(self, val): - self.generator.username = val - save_session() - - def botname_text_changed(self, val): - self.generator.botname = val - save_session() \ No newline at end of file diff --git a/src/airunner/widgets/llm/llm_settings_widget.py b/src/airunner/widgets/llm/llm_settings_widget.py index 6af9d0187..41f2ce8c8 100644 --- a/src/airunner/widgets/llm/llm_settings_widget.py +++ b/src/airunner/widgets/llm/llm_settings_widget.py @@ -24,7 +24,7 @@ class LLMSettingsWidget(BaseWidget): @property def generator(self): try: - return self.app.ui.llm_widget.generator + return self.app.generator except Exception as e: Logger.error(e) import traceback @@ -33,7 +33,7 @@ def generator(self): @property def generator_settings(self): try: - return self.app.ui.llm_widget.generator_settings + return self.app.generator_settings except Exception as e: Logger.error(e) diff --git a/src/airunner/widgets/llm/llm_widget.py b/src/airunner/widgets/llm/llm_widget.py deleted file mode 100644 index 997241db0..000000000 --- a/src/airunner/widgets/llm/llm_widget.py +++ /dev/null @@ -1,43 +0,0 @@ -""" -This class should be used to create a window widget for the LLM. -""" -from airunner.utils import get_session -from airunner.data.models import LLMGenerator, LLMGeneratorSetting -from airunner.widgets.base_widget import BaseWidget -from airunner.widgets.llm.templates.llm_widget_ui import Ui_llm_widget -from airunner.aihandler.logger import Logger - - -class LLMWidget(BaseWidget): - widget_class_ = Ui_llm_widget - generator = None - _generator = None - _generator_settings = None - - @property - def generator(self): - if self._generator is None: - session = get_session() - try: - self._generator = session.query(LLMGenerator).filter( - LLMGenerator.name == self.ui.llm_settings_widget.current_generator - ).first() - if self._generator is None: - Logger.error("Unable to locate generator by name " + self.ui.llm_settings_widget.current_generator if self.ui.llm_settings_widget.current_generator else "None") - except Exception as e: - Logger.error(e) - return self._generator - - @property - def generator_settings(self): - try: - return self.generator.generator_settings[0] - except Exception as e: - Logger.error(e) - return None - - def __init__(self, *args, **kwargs): - super().__init__(*args, **kwargs) - - # After the app is loaded, initialize other widgets - self.app.loaded.connect(self.initialize) \ No newline at end of file diff --git a/src/airunner/widgets/llm/templates/chat_prompt.ui b/src/airunner/widgets/llm/templates/chat_prompt.ui index f9017ca49..993efdb0b 100644 --- a/src/airunner/widgets/llm/templates/chat_prompt.ui +++ b/src/airunner/widgets/llm/templates/chat_prompt.ui @@ -6,94 +6,100 @@ 0 0 - 734 - 1077 + 679 + 1044 Form - - - - true - - + + + + + + User + + + + + + + User + + + User name + + + + - - - - true - - - - - 0 - 0 - 714 - 492 - - - - - + + + + + + Bot + + + + + + + ChatAI + + + 6 + + + Bot name + + + + - - - - - 0 - - - 0 - - - 0 - - - 0 - - - - - Chat input + + + + + + Chat input + + + + + + + + Chat - - - - - - - Chat - - - - - Narrate - - - - - Generate Image - - - - - Summarize - - - - - Translate - - - - - - + + + + Narrate + + + + + Generate Image + + + + + Summarize + + + + + Translate + + + + + - + @@ -118,6 +124,47 @@ + + + + QFrame::NoFrame + + + true + + + + + 0 + 0 + 661 + 904 + + + + + 0 + + + 0 + + + 0 + + + 0 + + + + + true + + + + + + + @@ -129,12 +176,12 @@ action_button_clicked_send() - 75 - 1057 + 89 + 1033 211 - -12 + 0 @@ -145,12 +192,12 @@ action_button_clicked_clear_conversation() - 657 - 1052 + 668 + 1009 565 - -13 + 0 @@ -161,12 +208,44 @@ message_type_text_changed(QString) - 634 - 1018 + 668 + 976 465 - -3 + 0 + + + + + username + textChanged(QString) + chat_prompt + username_text_changed(QString) + + + 163 + 967 + + + 107 + 0 + + + + + botname + textChanged(QString) + chat_prompt + botname_text_changed(QString) + + + 668 + 967 + + + 170 + 0 @@ -175,5 +254,8 @@ action_button_clicked_send() action_button_clicked_clear_conversation() message_type_text_changed(QString) + username_text_changed(QString) + botname_text_changed(QString) + personality_type_changed(QString) diff --git a/src/airunner/widgets/llm/templates/chat_prompt_ui.py b/src/airunner/widgets/llm/templates/chat_prompt_ui.py index cba47dece..1da65ac62 100644 --- a/src/airunner/widgets/llm/templates/chat_prompt_ui.py +++ b/src/airunner/widgets/llm/templates/chat_prompt_ui.py @@ -12,32 +12,34 @@ class Ui_chat_prompt(object): def setupUi(self, chat_prompt): chat_prompt.setObjectName("chat_prompt") - chat_prompt.resize(734, 1077) + chat_prompt.resize(679, 1044) self.gridLayout = QtWidgets.QGridLayout(chat_prompt) self.gridLayout.setObjectName("gridLayout") - self.conversation = QtWidgets.QTextEdit(parent=chat_prompt) - self.conversation.setReadOnly(True) - self.conversation.setObjectName("conversation") - self.gridLayout.addWidget(self.conversation, 0, 0, 1, 1) - self.chat_container = QtWidgets.QScrollArea(parent=chat_prompt) - self.chat_container.setWidgetResizable(True) - self.chat_container.setObjectName("chat_container") - self.scrollAreaWidgetContents = QtWidgets.QWidget() - self.scrollAreaWidgetContents.setGeometry(QtCore.QRect(0, 0, 714, 492)) - self.scrollAreaWidgetContents.setObjectName("scrollAreaWidgetContents") - self.verticalLayout = QtWidgets.QVBoxLayout(self.scrollAreaWidgetContents) - self.verticalLayout.setObjectName("verticalLayout") - self.chat_container.setWidget(self.scrollAreaWidgetContents) - self.gridLayout.addWidget(self.chat_container, 1, 0, 1, 1) - self.widget_5 = QtWidgets.QWidget(parent=chat_prompt) - self.widget_5.setObjectName("widget_5") - self.horizontalLayout = QtWidgets.QHBoxLayout(self.widget_5) - self.horizontalLayout.setContentsMargins(0, 0, 0, 0) + self.verticalLayout_5 = QtWidgets.QVBoxLayout() + self.verticalLayout_5.setObjectName("verticalLayout_5") + self.label_3 = QtWidgets.QLabel(parent=chat_prompt) + self.label_3.setObjectName("label_3") + self.verticalLayout_5.addWidget(self.label_3) + self.username = QtWidgets.QLineEdit(parent=chat_prompt) + self.username.setObjectName("username") + self.verticalLayout_5.addWidget(self.username) + self.gridLayout.addLayout(self.verticalLayout_5, 2, 0, 1, 1) + self.verticalLayout_6 = QtWidgets.QVBoxLayout() + self.verticalLayout_6.setObjectName("verticalLayout_6") + self.label = QtWidgets.QLabel(parent=chat_prompt) + self.label.setObjectName("label") + self.verticalLayout_6.addWidget(self.label) + self.botname = QtWidgets.QLineEdit(parent=chat_prompt) + self.botname.setCursorPosition(6) + self.botname.setObjectName("botname") + self.verticalLayout_6.addWidget(self.botname) + self.gridLayout.addLayout(self.verticalLayout_6, 2, 1, 1, 1) + self.horizontalLayout = QtWidgets.QHBoxLayout() self.horizontalLayout.setObjectName("horizontalLayout") - self.prompt = QtWidgets.QLineEdit(parent=self.widget_5) + self.prompt = QtWidgets.QLineEdit(parent=chat_prompt) self.prompt.setObjectName("prompt") self.horizontalLayout.addWidget(self.prompt) - self.comboBox = QtWidgets.QComboBox(parent=self.widget_5) + self.comboBox = QtWidgets.QComboBox(parent=chat_prompt) self.comboBox.setObjectName("comboBox") self.comboBox.addItem("") self.comboBox.addItem("") @@ -45,7 +47,7 @@ def setupUi(self, chat_prompt): self.comboBox.addItem("") self.comboBox.addItem("") self.horizontalLayout.addWidget(self.comboBox) - self.gridLayout.addWidget(self.widget_5, 2, 0, 1, 1) + self.gridLayout.addLayout(self.horizontalLayout, 3, 0, 1, 2) self.horizontalLayout_2 = QtWidgets.QHBoxLayout() self.horizontalLayout_2.setObjectName("horizontalLayout_2") self.send_button = QtWidgets.QPushButton(parent=chat_prompt) @@ -58,17 +60,41 @@ def setupUi(self, chat_prompt): self.clear_conversatiion_button = QtWidgets.QPushButton(parent=chat_prompt) self.clear_conversatiion_button.setObjectName("clear_conversatiion_button") self.horizontalLayout_2.addWidget(self.clear_conversatiion_button) - self.gridLayout.addLayout(self.horizontalLayout_2, 3, 0, 1, 1) + self.gridLayout.addLayout(self.horizontalLayout_2, 4, 0, 1, 2) + self.chat_container = QtWidgets.QScrollArea(parent=chat_prompt) + self.chat_container.setFrameShape(QtWidgets.QFrame.Shape.NoFrame) + self.chat_container.setWidgetResizable(True) + self.chat_container.setObjectName("chat_container") + self.scrollAreaWidgetContents = QtWidgets.QWidget() + self.scrollAreaWidgetContents.setGeometry(QtCore.QRect(0, 0, 661, 904)) + self.scrollAreaWidgetContents.setObjectName("scrollAreaWidgetContents") + self.gridLayout_2 = QtWidgets.QGridLayout(self.scrollAreaWidgetContents) + self.gridLayout_2.setContentsMargins(0, 0, 0, 0) + self.gridLayout_2.setObjectName("gridLayout_2") + self.conversation = QtWidgets.QTextEdit(parent=self.scrollAreaWidgetContents) + self.conversation.setReadOnly(True) + self.conversation.setObjectName("conversation") + self.gridLayout_2.addWidget(self.conversation, 0, 0, 1, 1) + self.chat_container.setWidget(self.scrollAreaWidgetContents) + self.gridLayout.addWidget(self.chat_container, 1, 0, 1, 2) self.retranslateUi(chat_prompt) self.send_button.clicked.connect(chat_prompt.action_button_clicked_send) # type: ignore self.clear_conversatiion_button.clicked.connect(chat_prompt.action_button_clicked_clear_conversation) # type: ignore self.comboBox.currentTextChanged['QString'].connect(chat_prompt.message_type_text_changed) # type: ignore + self.username.textChanged['QString'].connect(chat_prompt.username_text_changed) # type: ignore + self.botname.textChanged['QString'].connect(chat_prompt.botname_text_changed) # type: ignore QtCore.QMetaObject.connectSlotsByName(chat_prompt) def retranslateUi(self, chat_prompt): _translate = QtCore.QCoreApplication.translate chat_prompt.setWindowTitle(_translate("chat_prompt", "Form")) + self.label_3.setText(_translate("chat_prompt", "User")) + self.username.setText(_translate("chat_prompt", "User")) + self.username.setPlaceholderText(_translate("chat_prompt", "User name")) + self.label.setText(_translate("chat_prompt", "Bot")) + self.botname.setText(_translate("chat_prompt", "ChatAI")) + self.botname.setPlaceholderText(_translate("chat_prompt", "Bot name")) self.prompt.setPlaceholderText(_translate("chat_prompt", "Chat input")) self.comboBox.setItemText(0, _translate("chat_prompt", "Chat")) self.comboBox.setItemText(1, _translate("chat_prompt", "Narrate")) diff --git a/src/airunner/widgets/llm/templates/message.ui b/src/airunner/widgets/llm/templates/message.ui index f1ffdeab5..7bd9410a3 100644 --- a/src/airunner/widgets/llm/templates/message.ui +++ b/src/airunner/widgets/llm/templates/message.ui @@ -6,79 +6,65 @@ 0 0 - 394 - 92 + 605 + 707 Form - + - - - - 0 - 0 - - - - - 0 - 50 - - - - - - - TextLabel - - - Qt::AlignBottom|Qt::AlignLeading|Qt::AlignLeft - - - - - - - - 0 - 0 - - - - - 0 - 40 - - - - border-radius: 5px; border: 5px solid #1f1f1f; background-color: #1f1f1f; color: #ffffff; - - - QFrame::NoFrame - - - QFrame::Plain - - - true - - - - - - - TextLabel - - - Qt::AlignBottom|Qt::AlignLeading|Qt::AlignLeft - - - - - + + + + + TextLabel + + + Qt::AlignBottom|Qt::AlignLeading|Qt::AlignLeft + + + + + + + + 0 + 0 + + + + + 0 + 40 + + + + border-radius: 5px; border: 5px solid #1f1f1f; background-color: #1f1f1f; color: #ffffff; + + + QFrame::NoFrame + + + QFrame::Plain + + + true + + + + + + + TextLabel + + + Qt::AlignBottom|Qt::AlignLeading|Qt::AlignLeft + + + + diff --git a/src/airunner/widgets/llm/templates/message_ui.py b/src/airunner/widgets/llm/templates/message_ui.py index bc0bd80d3..8c8996942 100644 --- a/src/airunner/widgets/llm/templates/message_ui.py +++ b/src/airunner/widgets/llm/templates/message_ui.py @@ -12,25 +12,17 @@ class Ui_message(object): def setupUi(self, message): message.setObjectName("message") - message.resize(394, 92) - self.gridLayout_2 = QtWidgets.QGridLayout(message) - self.gridLayout_2.setObjectName("gridLayout_2") - self.widget = QtWidgets.QWidget(parent=message) - sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Policy.Preferred, QtWidgets.QSizePolicy.Policy.MinimumExpanding) - sizePolicy.setHorizontalStretch(0) - sizePolicy.setVerticalStretch(0) - sizePolicy.setHeightForWidth(self.widget.sizePolicy().hasHeightForWidth()) - self.widget.setSizePolicy(sizePolicy) - self.widget.setMinimumSize(QtCore.QSize(0, 50)) - self.widget.setObjectName("widget") - self.gridLayout = QtWidgets.QGridLayout(self.widget) + message.resize(605, 707) + self.gridLayout = QtWidgets.QGridLayout(message) self.gridLayout.setObjectName("gridLayout") - self.user_name = QtWidgets.QLabel(parent=self.widget) + self.horizontalLayout = QtWidgets.QHBoxLayout() + self.horizontalLayout.setObjectName("horizontalLayout") + self.user_name = QtWidgets.QLabel(parent=message) self.user_name.setAlignment(QtCore.Qt.AlignmentFlag.AlignBottom|QtCore.Qt.AlignmentFlag.AlignLeading|QtCore.Qt.AlignmentFlag.AlignLeft) self.user_name.setObjectName("user_name") - self.gridLayout.addWidget(self.user_name, 0, 0, 1, 1) - self.content = QtWidgets.QPlainTextEdit(parent=self.widget) - sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Policy.Expanding, QtWidgets.QSizePolicy.Policy.MinimumExpanding) + self.horizontalLayout.addWidget(self.user_name) + self.content = QtWidgets.QPlainTextEdit(parent=message) + sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Policy.Expanding, QtWidgets.QSizePolicy.Policy.Preferred) sizePolicy.setHorizontalStretch(0) sizePolicy.setVerticalStretch(0) sizePolicy.setHeightForWidth(self.content.sizePolicy().hasHeightForWidth()) @@ -41,12 +33,12 @@ def setupUi(self, message): self.content.setFrameShadow(QtWidgets.QFrame.Shadow.Plain) self.content.setReadOnly(True) self.content.setObjectName("content") - self.gridLayout.addWidget(self.content, 0, 1, 1, 1) - self.bot_name = QtWidgets.QLabel(parent=self.widget) + self.horizontalLayout.addWidget(self.content) + self.bot_name = QtWidgets.QLabel(parent=message) self.bot_name.setAlignment(QtCore.Qt.AlignmentFlag.AlignBottom|QtCore.Qt.AlignmentFlag.AlignLeading|QtCore.Qt.AlignmentFlag.AlignLeft) self.bot_name.setObjectName("bot_name") - self.gridLayout.addWidget(self.bot_name, 0, 2, 1, 1) - self.gridLayout_2.addWidget(self.widget, 0, 0, 1, 1) + self.horizontalLayout.addWidget(self.bot_name) + self.gridLayout.addLayout(self.horizontalLayout, 0, 0, 1, 1) self.retranslateUi(message) QtCore.QMetaObject.connectSlotsByName(message) diff --git a/src/airunner/windows/main/main_window.py b/src/airunner/windows/main/main_window.py index b01d6c5f4..f80793fc1 100644 --- a/src/airunner/windows/main/main_window.py +++ b/src/airunner/windows/main/main_window.py @@ -25,7 +25,7 @@ from airunner.aihandler.settings_manager import SettingsManager from airunner.airunner_api import AIRunnerAPI from airunner.data.db import session -from airunner.data.models import SplitterSection, Prompt, TabSection +from airunner.data.models import SplitterSection, Prompt, TabSection, LLMGenerator from airunner.filters.windows.filter_base import FilterBase from airunner.input_event_manager import InputEventManager from airunner.mixins.history_mixin import HistoryMixin @@ -101,6 +101,32 @@ class MainWindow( load_image = pyqtSignal(str) load_image_object = pyqtSignal(object) + generator = None + _generator = None + _generator_settings = None + + @property + def generator(self): + if self._generator is None: + session = get_session() + try: + self._generator = session.query(LLMGenerator).filter( + LLMGenerator.name == self.ui.standard_image_widget.ui.llm_settings_widget.current_generator + ).first() + if self._generator is None: + logger.error("Unable to locate generator by name " + self.ui.standard_image_widget.ui.llm_settings_widget.current_generator if self.ui.llm_settings_widget.current_generator else "None") + except Exception as e: + logger.error(e) + return self._generator + + @property + def generator_settings(self): + try: + return self.generator.generator_settings[0] + except Exception as e: + logger.error(e) + return None + @property def generate_signal(self): return self.generator_tab_widget.generate_signal @@ -681,7 +707,6 @@ def set_stylesheet(self): self.setStyleSheet(stylesheet) for icon_data in [ ("image-file-icon", "image_generation_button"), - ("edit-document-icon", "language_processing_button"), ("tech-icon", "model_manager_button"), ("photo-editor-icon", "image_generators_button"), ("video-editor-icon", "txt2vid_button"), @@ -692,10 +717,6 @@ def set_stylesheet(self): ("circle-center-icon", "focus_button"), ("artificial-intelligence-ai-chip-icon", "ai_button"), ("setting-line-icon", "settings_button"), - ("chat-box-icon", "chat_button"), - ("setting-line-icon", "llm_preferences_button"), - #("clamp-as-indicated-symbol-icon", "llm_quantization_button"), - ("sliders-icon", "llm_settings_button"), ("object-selected-icon", "toggle_active_grid_area_button"), ]: self.set_icons(icon_data[0], icon_data[1], "dark" if self.is_dark else "light") @@ -744,7 +765,21 @@ def handle_generate(self): pass def initialize_default_buttons(self): - pass + self.ui.toggle_active_grid_area_button.blockSignals(True) + self.ui.toggle_brush_button.blockSignals(True) + self.ui.toggle_eraser_button.blockSignals(True) + self.ui.toggle_grid_button.blockSignals(True) + self.ui.ai_button.blockSignals(True) + self.ui.toggle_active_grid_area_button.setChecked(self.settings_manager.current_tool == "active_grid_area") + self.ui.toggle_brush_button.setChecked(self.settings_manager.current_tool == "brush") + self.ui.toggle_eraser_button.setChecked(self.settings_manager.current_tool == "eraser") + self.ui.toggle_grid_button.setChecked(self.settings_manager.grid_settings.show_grid is True) + self.ui.ai_button.setChecked(self.settings_manager.ai_mode is True) + self.ui.toggle_active_grid_area_button.blockSignals(False) + self.ui.toggle_brush_button.blockSignals(False) + self.ui.toggle_eraser_button.blockSignals(False) + self.ui.toggle_grid_button.blockSignals(False) + self.ui.ai_button.blockSignals(False) @pyqtSlot(dict) def handle_button_clicked(self, kwargs): @@ -1332,7 +1367,6 @@ def set_button_checked(self, name, val=True, block_signals=True): def set_all_section_buttons(self): self.set_button_checked("image_generation", self.settings_manager.mode == Mode.IMAGE.value) - self.set_button_checked("language_processing", self.settings_manager.mode == Mode.LANGUAGE_PROCESSOR.value) self.set_button_checked("model_manager", self.settings_manager.mode == Mode.MODEL_MANAGER.value) self.toggle_header_buttons() @@ -1347,27 +1381,6 @@ def toggle_header_buttons(self): self.ui.image_generator_header_tools.hide() self.ui.text_generator_header_tools.hide() - def chat_clicked(self, val): - self.set_llm_widget_tab("chat", val) - - def chat_preferences_clicked(self, val): - self.set_llm_widget_tab("preferences", val) - - def chat_settings_clicked(self, val): - self.set_llm_widget_tab("settings", val) - - def quantization_clicked(self, val): - self.set_llm_widget_tab("quantization", val) - - def set_llm_widget_tab(self, name, val): - self.toggle_llm_button_signals(blocked=True) - self.ui.chat_button.setChecked(name == "chat") - self.ui.llm_preferences_button.setChecked(name == "preferences") - self.ui.llm_settings_button.setChecked(name == "settings") - index = self.ui.llm_widget.ui.tabWidget.indexOf(self.ui.llm_widget.ui.tabWidget.findChild(QWidget, name)) - self.ui.llm_widget.ui.tabWidget.setCurrentIndex(index) - self.toggle_llm_button_signals(blocked=False) - def toggle_llm_button_signals(self, blocked): self.ui.chat_button.blockSignals(blocked) self.ui.llm_preferences_button.blockSignals(blocked) @@ -1457,3 +1470,10 @@ def redraw(self): # Update the window self.update() + + def action_center_clicked(self): + print("center clicked") + + def action_ai_toggled(self, val): + self.settings_manager.set_value("ai_mode", val) + self.generator_tab_widget.activate_ai_mode() diff --git a/src/airunner/windows/main/templates/main_window.ui b/src/airunner/windows/main/templates/main_window.ui index 514bdf4cd..b941ec9f9 100644 --- a/src/airunner/windows/main/templates/main_window.ui +++ b/src/airunner/windows/main/templates/main_window.ui @@ -8,7 +8,7 @@ 0 0 1144 - 955 + 964 @@ -129,7 +129,7 @@ 0 0 1140 - 50 + 48 @@ -195,53 +195,6 @@ - - - - - 0 - 0 - - - - - 48 - 48 - - - - - 48 - 48 - - - - PointingHandCursor - - - Language Processing - - - - - - - :/icons/light/edit-document-icon.svg:/icons/light/edit-document-icon.svg - - - - 32 - 32 - - - - true - - - true - - - @@ -304,123 +257,6 @@ 0 - - - - - 48 - 48 - - - - - 48 - 48 - - - - PointingHandCursor - - - - - - - :/icons/light/chat-box-icon.svg:/icons/light/chat-box-icon.svg - - - - 24 - 24 - - - - true - - - false - - - true - - - - - - - - 48 - 48 - - - - - 48 - 48 - - - - PointingHandCursor - - - - - - - :/icons/light/setting-line-icon.svg:/icons/light/setting-line-icon.svg - - - - 24 - 24 - - - - true - - - true - - - - - - - - 48 - 48 - - - - - 48 - 48 - - - - PointingHandCursor - - - - - - - :/icons/light/sliders-icon.svg:/icons/light/sliders-icon.svg - - - - 24 - 24 - - - - true - - - true - - - @@ -1059,7 +895,7 @@ 0 0 386 - 831 + 835 @@ -1461,6 +1297,9 @@ 20 + + true + true @@ -1535,28 +1374,6 @@ - - - Text Generation - - - - 0 - - - 0 - - - 0 - - - 0 - - - - - - Model Manager @@ -2353,12 +2170,6 @@
airunner/widgets/canvas_plus/standard_image_widget
1
- - LLMWidget - QWidget -
airunner/widgets/llm/llm_widget
- 1 -
@@ -2973,22 +2784,6 @@ - - language_processing_button - pressed() - MainWindow - language_processing_toggled() - - - 80 - 67 - - - 0 - 137 - - - model_manager_button pressed() @@ -2996,8 +2791,8 @@ model_manager_toggled() - 124 - 48 + 97 + 70 770 @@ -3029,7 +2824,7 @@ 916 - 65 + 64 1002 @@ -3045,7 +2840,7 @@ 1093 - 65 + 64 1002 @@ -3061,7 +2856,7 @@ 1135 - 65 + 64 1002 @@ -3077,7 +2872,7 @@ 1042 - 65 + 64 1002 @@ -3092,8 +2887,8 @@ image_generators_toggled() - 658 - 71 + 667 + 70 0 @@ -3108,8 +2903,8 @@ text_to_video_toggled() - 706 - 71 + 715 + 70 0 @@ -3124,8 +2919,8 @@ prompt_builder_toggled() - 754 - 71 + 763 + 70 0 @@ -3149,22 +2944,6 @@ - - language_processing_button - released() - MainWindow - language_processing_toggled() - - - 59 - 44 - - - 82 - 0 - - - model_manager_button released() @@ -3172,8 +2951,8 @@ model_manager_toggled() - 111 - 47 + 97 + 69 0 @@ -3188,8 +2967,8 @@ image_generators_toggled() - 658 - 71 + 667 + 70 754 @@ -3204,8 +2983,8 @@ text_to_video_toggled() - 706 - 71 + 715 + 70 1002 @@ -3220,8 +2999,8 @@ prompt_builder_toggled() - 754 - 71 + 763 + 70 1002 @@ -3237,7 +3016,7 @@ 1138 - 426 + 491 1002 @@ -3358,50 +3137,34 @@ - chat_button - toggled(bool) - MainWindow - chat_clicked(bool) - - - 170 - 54 - - - 452 - 0 - - - - - llm_preferences_button - toggled(bool) + focus_button + clicked() MainWindow - chat_preferences_clicked(bool) + action_center_clicked() - 217 - 43 + 1120 + 350 - 444 - 0 + 806 + -15 - llm_settings_button + ai_button toggled(bool) MainWindow - chat_settings_clicked(bool) + action_ai_toggled(bool) - 279 - 43 + 1110 + 412 - 728 - 0 + 917 + -11 @@ -3494,5 +3257,7 @@ chat_preferences_clicked(bool) chat_settings_clicked(bool) quantization_clicked(bool) + action_center_clicked() + action_ai_toggled(bool) diff --git a/src/airunner/windows/main/templates/main_window_ui.py b/src/airunner/windows/main/templates/main_window_ui.py index 9597e9657..1c2c1ff46 100644 --- a/src/airunner/windows/main/templates/main_window_ui.py +++ b/src/airunner/windows/main/templates/main_window_ui.py @@ -12,7 +12,7 @@ class Ui_MainWindow(object): def setupUi(self, MainWindow): MainWindow.setObjectName("MainWindow") - MainWindow.resize(1144, 955) + MainWindow.resize(1144, 964) sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Policy.MinimumExpanding, QtWidgets.QSizePolicy.Policy.Preferred) sizePolicy.setHorizontalStretch(0) sizePolicy.setVerticalStretch(0) @@ -58,7 +58,7 @@ def setupUi(self, MainWindow): self.scrollArea_3.setWidgetResizable(True) self.scrollArea_3.setObjectName("scrollArea_3") self.scrollAreaWidgetContents_3 = QtWidgets.QWidget() - self.scrollAreaWidgetContents_3.setGeometry(QtCore.QRect(0, 0, 1140, 50)) + self.scrollAreaWidgetContents_3.setGeometry(QtCore.QRect(0, 0, 1140, 48)) self.scrollAreaWidgetContents_3.setObjectName("scrollAreaWidgetContents_3") self.horizontalLayout_2 = QtWidgets.QHBoxLayout(self.scrollAreaWidgetContents_3) self.horizontalLayout_2.setContentsMargins(0, 0, 0, 0) @@ -82,32 +82,14 @@ def setupUi(self, MainWindow): self.image_generation_button.setFlat(True) self.image_generation_button.setObjectName("image_generation_button") self.horizontalLayout_2.addWidget(self.image_generation_button) - self.language_processing_button = QtWidgets.QPushButton(parent=self.scrollAreaWidgetContents_3) - sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Policy.Preferred, QtWidgets.QSizePolicy.Policy.Preferred) - sizePolicy.setHorizontalStretch(0) - sizePolicy.setVerticalStretch(0) - sizePolicy.setHeightForWidth(self.language_processing_button.sizePolicy().hasHeightForWidth()) - self.language_processing_button.setSizePolicy(sizePolicy) - self.language_processing_button.setMinimumSize(QtCore.QSize(48, 48)) - self.language_processing_button.setMaximumSize(QtCore.QSize(48, 48)) - self.language_processing_button.setCursor(QtGui.QCursor(QtCore.Qt.CursorShape.PointingHandCursor)) - self.language_processing_button.setText("") - icon2 = QtGui.QIcon() - icon2.addPixmap(QtGui.QPixmap(":/icons/light/edit-document-icon.svg"), QtGui.QIcon.Mode.Normal, QtGui.QIcon.State.Off) - self.language_processing_button.setIcon(icon2) - self.language_processing_button.setIconSize(QtCore.QSize(32, 32)) - self.language_processing_button.setCheckable(True) - self.language_processing_button.setFlat(True) - self.language_processing_button.setObjectName("language_processing_button") - self.horizontalLayout_2.addWidget(self.language_processing_button) self.model_manager_button = QtWidgets.QPushButton(parent=self.scrollAreaWidgetContents_3) self.model_manager_button.setMinimumSize(QtCore.QSize(48, 48)) self.model_manager_button.setMaximumSize(QtCore.QSize(48, 48)) self.model_manager_button.setCursor(QtGui.QCursor(QtCore.Qt.CursorShape.PointingHandCursor)) self.model_manager_button.setText("") - icon3 = QtGui.QIcon() - icon3.addPixmap(QtGui.QPixmap(":/icons/light/tech-icon.svg"), QtGui.QIcon.Mode.Normal, QtGui.QIcon.State.Off) - self.model_manager_button.setIcon(icon3) + icon2 = QtGui.QIcon() + icon2.addPixmap(QtGui.QPixmap(":/icons/light/tech-icon.svg"), QtGui.QIcon.Mode.Normal, QtGui.QIcon.State.Off) + self.model_manager_button.setIcon(icon2) self.model_manager_button.setIconSize(QtCore.QSize(32, 32)) self.model_manager_button.setCheckable(True) self.model_manager_button.setFlat(True) @@ -120,46 +102,6 @@ def setupUi(self, MainWindow): self.horizontalLayout_5 = QtWidgets.QHBoxLayout(self.text_generator_header_tools) self.horizontalLayout_5.setContentsMargins(0, 0, 0, 0) self.horizontalLayout_5.setObjectName("horizontalLayout_5") - self.chat_button = QtWidgets.QPushButton(parent=self.text_generator_header_tools) - self.chat_button.setMinimumSize(QtCore.QSize(48, 48)) - self.chat_button.setMaximumSize(QtCore.QSize(48, 48)) - self.chat_button.setCursor(QtGui.QCursor(QtCore.Qt.CursorShape.PointingHandCursor)) - self.chat_button.setText("") - icon4 = QtGui.QIcon() - icon4.addPixmap(QtGui.QPixmap(":/icons/light/chat-box-icon.svg"), QtGui.QIcon.Mode.Normal, QtGui.QIcon.State.Off) - self.chat_button.setIcon(icon4) - self.chat_button.setIconSize(QtCore.QSize(24, 24)) - self.chat_button.setCheckable(True) - self.chat_button.setChecked(False) - self.chat_button.setFlat(True) - self.chat_button.setObjectName("chat_button") - self.horizontalLayout_5.addWidget(self.chat_button) - self.llm_preferences_button = QtWidgets.QPushButton(parent=self.text_generator_header_tools) - self.llm_preferences_button.setMinimumSize(QtCore.QSize(48, 48)) - self.llm_preferences_button.setMaximumSize(QtCore.QSize(48, 48)) - self.llm_preferences_button.setCursor(QtGui.QCursor(QtCore.Qt.CursorShape.PointingHandCursor)) - self.llm_preferences_button.setText("") - icon5 = QtGui.QIcon() - icon5.addPixmap(QtGui.QPixmap(":/icons/light/setting-line-icon.svg"), QtGui.QIcon.Mode.Normal, QtGui.QIcon.State.Off) - self.llm_preferences_button.setIcon(icon5) - self.llm_preferences_button.setIconSize(QtCore.QSize(24, 24)) - self.llm_preferences_button.setCheckable(True) - self.llm_preferences_button.setFlat(True) - self.llm_preferences_button.setObjectName("llm_preferences_button") - self.horizontalLayout_5.addWidget(self.llm_preferences_button) - self.llm_settings_button = QtWidgets.QPushButton(parent=self.text_generator_header_tools) - self.llm_settings_button.setMinimumSize(QtCore.QSize(48, 48)) - self.llm_settings_button.setMaximumSize(QtCore.QSize(48, 48)) - self.llm_settings_button.setCursor(QtGui.QCursor(QtCore.Qt.CursorShape.PointingHandCursor)) - self.llm_settings_button.setText("") - icon6 = QtGui.QIcon() - icon6.addPixmap(QtGui.QPixmap(":/icons/light/sliders-icon.svg"), QtGui.QIcon.Mode.Normal, QtGui.QIcon.State.Off) - self.llm_settings_button.setIcon(icon6) - self.llm_settings_button.setIconSize(QtCore.QSize(24, 24)) - self.llm_settings_button.setCheckable(True) - self.llm_settings_button.setFlat(True) - self.llm_settings_button.setObjectName("llm_settings_button") - self.horizontalLayout_5.addWidget(self.llm_settings_button) spacerItem = QtWidgets.QSpacerItem(40, 20, QtWidgets.QSizePolicy.Policy.Expanding, QtWidgets.QSizePolicy.Policy.Minimum) self.horizontalLayout_5.addItem(spacerItem) self.horizontalLayout_2.addWidget(self.text_generator_header_tools) @@ -176,9 +118,9 @@ def setupUi(self, MainWindow): self.image_generators_button.setMaximumSize(QtCore.QSize(48, 48)) self.image_generators_button.setCursor(QtGui.QCursor(QtCore.Qt.CursorShape.PointingHandCursor)) self.image_generators_button.setText("") - icon7 = QtGui.QIcon() - icon7.addPixmap(QtGui.QPixmap(":/icons/light/photo-editor-icon.svg"), QtGui.QIcon.Mode.Normal, QtGui.QIcon.State.Off) - self.image_generators_button.setIcon(icon7) + icon3 = QtGui.QIcon() + icon3.addPixmap(QtGui.QPixmap(":/icons/light/photo-editor-icon.svg"), QtGui.QIcon.Mode.Normal, QtGui.QIcon.State.Off) + self.image_generators_button.setIcon(icon3) self.image_generators_button.setIconSize(QtCore.QSize(24, 24)) self.image_generators_button.setCheckable(True) self.image_generators_button.setChecked(False) @@ -190,9 +132,9 @@ def setupUi(self, MainWindow): self.txt2vid_button.setMaximumSize(QtCore.QSize(48, 48)) self.txt2vid_button.setCursor(QtGui.QCursor(QtCore.Qt.CursorShape.PointingHandCursor)) self.txt2vid_button.setText("") - icon8 = QtGui.QIcon() - icon8.addPixmap(QtGui.QPixmap(":/icons/light/video-editor-icon.svg"), QtGui.QIcon.Mode.Normal, QtGui.QIcon.State.Off) - self.txt2vid_button.setIcon(icon8) + icon4 = QtGui.QIcon() + icon4.addPixmap(QtGui.QPixmap(":/icons/light/video-editor-icon.svg"), QtGui.QIcon.Mode.Normal, QtGui.QIcon.State.Off) + self.txt2vid_button.setIcon(icon4) self.txt2vid_button.setIconSize(QtCore.QSize(24, 24)) self.txt2vid_button.setCheckable(True) self.txt2vid_button.setFlat(True) @@ -203,9 +145,9 @@ def setupUi(self, MainWindow): self.prompt_builder_button.setMaximumSize(QtCore.QSize(48, 48)) self.prompt_builder_button.setCursor(QtGui.QCursor(QtCore.Qt.CursorShape.PointingHandCursor)) self.prompt_builder_button.setText("") - icon9 = QtGui.QIcon() - icon9.addPixmap(QtGui.QPixmap(":/icons/light/prompt-editor-icon.svg"), QtGui.QIcon.Mode.Normal, QtGui.QIcon.State.Off) - self.prompt_builder_button.setIcon(icon9) + icon5 = QtGui.QIcon() + icon5.addPixmap(QtGui.QPixmap(":/icons/light/prompt-editor-icon.svg"), QtGui.QIcon.Mode.Normal, QtGui.QIcon.State.Off) + self.prompt_builder_button.setIcon(icon5) self.prompt_builder_button.setIconSize(QtCore.QSize(24, 24)) self.prompt_builder_button.setCheckable(True) self.prompt_builder_button.setFlat(True) @@ -385,7 +327,7 @@ def setupUi(self, MainWindow): self.scrollArea.setWidgetResizable(True) self.scrollArea.setObjectName("scrollArea") self.scrollAreaWidgetContents = QtWidgets.QWidget() - self.scrollAreaWidgetContents.setGeometry(QtCore.QRect(0, 0, 386, 831)) + self.scrollAreaWidgetContents.setGeometry(QtCore.QRect(0, 0, 386, 835)) self.scrollAreaWidgetContents.setObjectName("scrollAreaWidgetContents") self.gridLayout = QtWidgets.QGridLayout(self.scrollAreaWidgetContents) self.gridLayout.setObjectName("gridLayout") @@ -449,9 +391,9 @@ def setupUi(self, MainWindow): self.toggle_active_grid_area_button.setMaximumSize(QtCore.QSize(50, 45)) self.toggle_active_grid_area_button.setCursor(QtGui.QCursor(QtCore.Qt.CursorShape.PointingHandCursor)) self.toggle_active_grid_area_button.setText("") - icon10 = QtGui.QIcon() - icon10.addPixmap(QtGui.QPixmap(":/icons/light/object-selected-icon.svg"), QtGui.QIcon.Mode.Normal, QtGui.QIcon.State.Off) - self.toggle_active_grid_area_button.setIcon(icon10) + icon6 = QtGui.QIcon() + icon6.addPixmap(QtGui.QPixmap(":/icons/light/object-selected-icon.svg"), QtGui.QIcon.Mode.Normal, QtGui.QIcon.State.Off) + self.toggle_active_grid_area_button.setIcon(icon6) self.toggle_active_grid_area_button.setIconSize(QtCore.QSize(18, 18)) self.toggle_active_grid_area_button.setCheckable(True) self.toggle_active_grid_area_button.setFlat(True) @@ -467,9 +409,9 @@ def setupUi(self, MainWindow): self.toggle_brush_button.setMaximumSize(QtCore.QSize(50, 45)) self.toggle_brush_button.setCursor(QtGui.QCursor(QtCore.Qt.CursorShape.PointingHandCursor)) self.toggle_brush_button.setText("") - icon11 = QtGui.QIcon() - icon11.addPixmap(QtGui.QPixmap(":/icons/light/pencil-icon.svg"), QtGui.QIcon.Mode.Normal, QtGui.QIcon.State.Off) - self.toggle_brush_button.setIcon(icon11) + icon7 = QtGui.QIcon() + icon7.addPixmap(QtGui.QPixmap(":/icons/light/pencil-icon.svg"), QtGui.QIcon.Mode.Normal, QtGui.QIcon.State.Off) + self.toggle_brush_button.setIcon(icon7) self.toggle_brush_button.setIconSize(QtCore.QSize(18, 18)) self.toggle_brush_button.setCheckable(True) self.toggle_brush_button.setFlat(True) @@ -485,9 +427,9 @@ def setupUi(self, MainWindow): self.toggle_eraser_button.setMaximumSize(QtCore.QSize(50, 45)) self.toggle_eraser_button.setCursor(QtGui.QCursor(QtCore.Qt.CursorShape.PointingHandCursor)) self.toggle_eraser_button.setText("") - icon12 = QtGui.QIcon() - icon12.addPixmap(QtGui.QPixmap(":/icons/light/eraser-icon.svg"), QtGui.QIcon.Mode.Normal, QtGui.QIcon.State.Off) - self.toggle_eraser_button.setIcon(icon12) + icon8 = QtGui.QIcon() + icon8.addPixmap(QtGui.QPixmap(":/icons/light/eraser-icon.svg"), QtGui.QIcon.Mode.Normal, QtGui.QIcon.State.Off) + self.toggle_eraser_button.setIcon(icon8) self.toggle_eraser_button.setIconSize(QtCore.QSize(18, 18)) self.toggle_eraser_button.setCheckable(True) self.toggle_eraser_button.setFlat(True) @@ -513,9 +455,9 @@ def setupUi(self, MainWindow): self.toggle_grid_button.setMaximumSize(QtCore.QSize(50, 45)) self.toggle_grid_button.setCursor(QtGui.QCursor(QtCore.Qt.CursorShape.PointingHandCursor)) self.toggle_grid_button.setText("") - icon13 = QtGui.QIcon() - icon13.addPixmap(QtGui.QPixmap(":/icons/light/frame-grid-icon.svg"), QtGui.QIcon.Mode.Normal, QtGui.QIcon.State.Off) - self.toggle_grid_button.setIcon(icon13) + icon9 = QtGui.QIcon() + icon9.addPixmap(QtGui.QPixmap(":/icons/light/frame-grid-icon.svg"), QtGui.QIcon.Mode.Normal, QtGui.QIcon.State.Off) + self.toggle_grid_button.setIcon(icon9) self.toggle_grid_button.setIconSize(QtCore.QSize(18, 18)) self.toggle_grid_button.setCheckable(True) self.toggle_grid_button.setFlat(True) @@ -531,9 +473,9 @@ def setupUi(self, MainWindow): self.focus_button.setMaximumSize(QtCore.QSize(50, 45)) self.focus_button.setCursor(QtGui.QCursor(QtCore.Qt.CursorShape.PointingHandCursor)) self.focus_button.setText("") - icon14 = QtGui.QIcon() - icon14.addPixmap(QtGui.QPixmap(":/icons/light/circle-center-icon.svg"), QtGui.QIcon.Mode.Normal, QtGui.QIcon.State.Off) - self.focus_button.setIcon(icon14) + icon10 = QtGui.QIcon() + icon10.addPixmap(QtGui.QPixmap(":/icons/light/circle-center-icon.svg"), QtGui.QIcon.Mode.Normal, QtGui.QIcon.State.Off) + self.focus_button.setIcon(icon10) self.focus_button.setIconSize(QtCore.QSize(18, 18)) self.focus_button.setFlat(True) self.focus_button.setObjectName("focus_button") @@ -552,10 +494,11 @@ def setupUi(self, MainWindow): self.ai_button.setMinimumSize(QtCore.QSize(50, 45)) self.ai_button.setCursor(QtGui.QCursor(QtCore.Qt.CursorShape.PointingHandCursor)) self.ai_button.setText("") - icon15 = QtGui.QIcon() - icon15.addPixmap(QtGui.QPixmap(":/icons/light/artificial-intelligence-ai-chip-icon.svg"), QtGui.QIcon.Mode.Normal, QtGui.QIcon.State.Off) - self.ai_button.setIcon(icon15) + icon11 = QtGui.QIcon() + icon11.addPixmap(QtGui.QPixmap(":/icons/light/artificial-intelligence-ai-chip-icon.svg"), QtGui.QIcon.Mode.Normal, QtGui.QIcon.State.Off) + self.ai_button.setIcon(icon11) self.ai_button.setIconSize(QtCore.QSize(20, 20)) + self.ai_button.setCheckable(True) self.ai_button.setFlat(True) self.ai_button.setObjectName("ai_button") self.verticalLayout.addWidget(self.ai_button) @@ -574,7 +517,9 @@ def setupUi(self, MainWindow): self.settings_button.setMaximumSize(QtCore.QSize(50, 45)) self.settings_button.setCursor(QtGui.QCursor(QtCore.Qt.CursorShape.PointingHandCursor)) self.settings_button.setText("") - self.settings_button.setIcon(icon5) + icon12 = QtGui.QIcon() + icon12.addPixmap(QtGui.QPixmap(":/icons/light/setting-line-icon.svg"), QtGui.QIcon.Mode.Normal, QtGui.QIcon.State.Off) + self.settings_button.setIcon(icon12) self.settings_button.setIconSize(QtCore.QSize(18, 18)) self.settings_button.setFlat(True) self.settings_button.setObjectName("settings_button") @@ -583,15 +528,6 @@ def setupUi(self, MainWindow): self.verticalLayout.addItem(spacerItem2) self.gridLayout_4.addWidget(self.button_menu, 0, 1, 1, 1) self.mode_tab_widget.addTab(self.art, "") - self.chat = QtWidgets.QWidget() - self.chat.setObjectName("chat") - self.gridLayout_11 = QtWidgets.QGridLayout(self.chat) - self.gridLayout_11.setContentsMargins(0, 0, 0, 0) - self.gridLayout_11.setObjectName("gridLayout_11") - self.llm_widget = LLMWidget(parent=self.chat) - self.llm_widget.setObjectName("llm_widget") - self.gridLayout_11.addWidget(self.llm_widget, 0, 0, 1, 1) - self.mode_tab_widget.addTab(self.chat, "") self.tab_5 = QtWidgets.QWidget() self.tab_5.setObjectName("tab_5") self.gridLayout_6 = QtWidgets.QGridLayout(self.tab_5) @@ -643,15 +579,15 @@ def setupUi(self, MainWindow): self.actionPaste = QtGui.QAction(parent=MainWindow) self.actionPaste.setObjectName("actionPaste") self.actionUndo = QtGui.QAction(parent=MainWindow) - icon16 = QtGui.QIcon() - icon16.addPixmap(QtGui.QPixmap("/home/joe/Projects/imagetopixel/airunner/src/airunner/../../src/airunner/windows/main/templates/../../../../../../../../../../../../../../.designer/src/icons/007-undo.png"), QtGui.QIcon.Mode.Normal, QtGui.QIcon.State.Off) - self.actionUndo.setIcon(icon16) + icon13 = QtGui.QIcon() + icon13.addPixmap(QtGui.QPixmap("/home/joe/Projects/imagetopixel/airunner/src/airunner/../../src/airunner/windows/main/templates/../../../../../../../../../../../../../../.designer/src/icons/007-undo.png"), QtGui.QIcon.Mode.Normal, QtGui.QIcon.State.Off) + self.actionUndo.setIcon(icon13) self.actionUndo.setWhatsThis("") self.actionUndo.setObjectName("actionUndo") self.actionRedo = QtGui.QAction(parent=MainWindow) - icon17 = QtGui.QIcon() - icon17.addPixmap(QtGui.QPixmap("/home/joe/Projects/imagetopixel/airunner/src/airunner/../../src/airunner/windows/main/templates/../../../../../../../../../../../../../../.designer/src/icons/008-redo.png"), QtGui.QIcon.Mode.Normal, QtGui.QIcon.State.Off) - self.actionRedo.setIcon(icon17) + icon14 = QtGui.QIcon() + icon14.addPixmap(QtGui.QPixmap("/home/joe/Projects/imagetopixel/airunner/src/airunner/../../src/airunner/windows/main/templates/../../../../../../../../../../../../../../.designer/src/icons/008-redo.png"), QtGui.QIcon.Mode.Normal, QtGui.QIcon.State.Off) + self.actionRedo.setIcon(icon14) self.actionRedo.setObjectName("actionRedo") self.actionGrid = QtGui.QAction(parent=MainWindow) self.actionGrid.setObjectName("actionGrid") @@ -767,10 +703,10 @@ def setupUi(self, MainWindow): self.actionClear_all_prompts = QtGui.QAction(parent=MainWindow) self.actionClear_all_prompts.setObjectName("actionClear_all_prompts") self.actionUndo_2 = QtGui.QAction(parent=MainWindow) - self.actionUndo_2.setIcon(icon16) + self.actionUndo_2.setIcon(icon13) self.actionUndo_2.setObjectName("actionUndo_2") self.actionRedo_2 = QtGui.QAction(parent=MainWindow) - self.actionRedo_2.setIcon(icon17) + self.actionRedo_2.setIcon(icon14) self.actionRedo_2.setObjectName("actionRedo_2") self.actionCut = QtGui.QAction(parent=MainWindow) self.actionCut.setObjectName("actionCut") @@ -943,7 +879,6 @@ def setupUi(self, MainWindow): self.actionStandard_Batches.triggered.connect(MainWindow.action_show_standard_batches) # type: ignore self.actionLLM_beta.triggered.connect(MainWindow.action_show_llm) # type: ignore self.image_generation_button.pressed.connect(MainWindow.image_generation_toggled) # type: ignore - self.language_processing_button.pressed.connect(MainWindow.language_processing_toggled) # type: ignore self.model_manager_button.pressed.connect(MainWindow.model_manager_toggled) # type: ignore self.center_tab.currentChanged['int'].connect(MainWindow.center_panel_tab_index_changed) # type: ignore self.file_new_button.clicked.connect(MainWindow.action_new_document_triggered) # type: ignore @@ -954,7 +889,6 @@ def setupUi(self, MainWindow): self.txt2vid_button.pressed.connect(MainWindow.text_to_video_toggled) # type: ignore self.prompt_builder_button.pressed.connect(MainWindow.prompt_builder_toggled) # type: ignore self.image_generation_button.released.connect(MainWindow.image_generation_toggled) # type: ignore - self.language_processing_button.released.connect(MainWindow.language_processing_toggled) # type: ignore self.model_manager_button.released.connect(MainWindow.model_manager_toggled) # type: ignore self.image_generators_button.released.connect(MainWindow.image_generators_toggled) # type: ignore self.txt2vid_button.released.connect(MainWindow.text_to_video_toggled) # type: ignore @@ -967,16 +901,14 @@ def setupUi(self, MainWindow): self.actionBug_report.triggered.connect(MainWindow.action_open_bug_report) # type: ignore self.actionDiscord.triggered.connect(MainWindow.action_open_discord) # type: ignore self.actionReport_vulnerability.triggered.connect(MainWindow.action_open_vulnerability_report) # type: ignore - self.chat_button.toggled['bool'].connect(MainWindow.chat_clicked) # type: ignore - self.llm_preferences_button.toggled['bool'].connect(MainWindow.chat_preferences_clicked) # type: ignore - self.llm_settings_button.toggled['bool'].connect(MainWindow.chat_settings_clicked) # type: ignore + self.focus_button.clicked.connect(MainWindow.action_center_clicked) # type: ignore + self.ai_button.toggled['bool'].connect(MainWindow.action_ai_toggled) # type: ignore QtCore.QMetaObject.connectSlotsByName(MainWindow) def retranslateUi(self, MainWindow): _translate = QtCore.QCoreApplication.translate MainWindow.setWindowTitle(_translate("MainWindow", "AI Runner")) self.image_generation_button.setToolTip(_translate("MainWindow", "Image Generation")) - self.language_processing_button.setToolTip(_translate("MainWindow", "Language Processing")) self.model_manager_button.setToolTip(_translate("MainWindow", "Model manager")) self.image_generators_button.setToolTip(_translate("MainWindow", "Image generators")) self.txt2vid_button.setToolTip(_translate("MainWindow", "Text to Video")) @@ -999,7 +931,6 @@ def retranslateUi(self, MainWindow): self.focus_button.setToolTip(_translate("MainWindow", "Recenter canvas")) self.settings_button.setToolTip(_translate("MainWindow", "AI Runner Settings")) self.mode_tab_widget.setTabText(self.mode_tab_widget.indexOf(self.art), _translate("MainWindow", "Image Generation")) - self.mode_tab_widget.setTabText(self.mode_tab_widget.indexOf(self.chat), _translate("MainWindow", "Text Generation")) self.mode_tab_widget.setTabText(self.mode_tab_widget.indexOf(self.tab_5), _translate("MainWindow", "Model Manager")) self.menuFile.setTitle(_translate("MainWindow", "File")) self.menuEdit.setTitle(_translate("MainWindow", "Edit")) @@ -1133,6 +1064,5 @@ def retranslateUi(self, MainWindow): from airunner.widgets.generator_form.generator_form_widget import GeneratorForm from airunner.widgets.image.image_panel_widget import ImagePanelWidget from airunner.widgets.layers.layer_container_widget import LayerContainerWidget -from airunner.widgets.llm.llm_widget import LLMWidget from airunner.widgets.model_manager.model_manager_widget import ModelManagerWidget from airunner.widgets.prompt_builder.prompt_builder_widget import PromptBuilderWidget