diff --git a/matrixai.service b/matrixai.service index 69ec63f..77bcef9 100644 --- a/matrixai.service +++ b/matrixai.service @@ -1,7 +1,11 @@ [Unit] Description=Matrix AI -After=multi-user.target[Service] +After=multi-user.target + +[Service] Type=simple Restart=always -ExecStart=/usr/bin/python3 /home/0xmrtt/matrixai/run.sh +ExecStart=/home/0xmrtt/matrixai/run.sh + +[Install] WantedBy=multi-user.target \ No newline at end of file diff --git a/matrixai/__init__.py b/matrixai/__init__.py index 6314827..e139408 100644 --- a/matrixai/__init__.py +++ b/matrixai/__init__.py @@ -445,8 +445,12 @@ def run(): async def generate_image(image_prompt, style_value, ratio_value, negative): imagine = AsyncImagine() filename = str(uuid.uuid4()) + ".png" - style_enum = Style[style_value] - ratio_enum = Ratio[ratio_value] + try: + style_enum = Style[style_value] + ratio_enum = Ratio[ratio_value] + except KeyError: + style_enum = Style.IMAGINE_V3 + ratio_enum = Ratio.RATIO_1X1 img_data = await imagine.sdprem( prompt=image_prompt, style=style_enum,