From 329d54213376136202c85395afc1f15864e23bd4 Mon Sep 17 00:00:00 2001 From: Paillat Date: Sun, 18 Feb 2024 22:50:11 +0100 Subject: [PATCH] Add SettingsEngine class for handling base settings --- src/engines/SettingsEngine/SettingsEngine.py | 25 ++++++++++++++++++++ 1 file changed, 25 insertions(+) create mode 100644 src/engines/SettingsEngine/SettingsEngine.py diff --git a/src/engines/SettingsEngine/SettingsEngine.py b/src/engines/SettingsEngine/SettingsEngine.py new file mode 100644 index 0000000..69f5688 --- /dev/null +++ b/src/engines/SettingsEngine/SettingsEngine.py @@ -0,0 +1,25 @@ +import gradio as gr +from abc import ABC, abstractmethod +from ..BaseEngine import BaseEngine + + +class SettingsEngine(BaseEngine): + def __init__(self, options: list) -> None: + self.width = options[0] + self.height = options[1] + super().__init__() + + name = "Settings Engine" + description = "Engine for handling all the base settings for the content generation" + num_options = 2 + + def load(self): + self.ctx.width = self.width + self.ctx.height = self.height + @classmethod + def get_options(cls): + #minimum is 720p, maximum is 4k, default is portrait hd + width = gr.Number(value=1080, minimum=720, maximum=3840, label="Width", step=1) + height = gr.Number(value=1920, minimum=720, maximum=3840, label="Height", step=1) + + return [width, height] \ No newline at end of file