From 6ca7a453d40120f5a213a88e2576a9265a784573 Mon Sep 17 00:00:00 2001 From: AUTOMATIC1111 <16777216c@gmail.com> Date: Mon, 8 Jul 2024 08:27:07 +0300 Subject: [PATCH] Merge pull request #16169 from AUTOMATIC1111/py-3.9-compatibility Py 3.9 compatibility --- extensions-builtin/Lora/networks.py | 1 + scripts/xyz_grid.py | 9 ++++----- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/extensions-builtin/Lora/networks.py b/extensions-builtin/Lora/networks.py index 63e8c9465..9ed8fa435 100644 --- a/extensions-builtin/Lora/networks.py +++ b/extensions-builtin/Lora/networks.py @@ -1,3 +1,4 @@ +from __future__ import annotations import gradio as gr import logging import os diff --git a/scripts/xyz_grid.py b/scripts/xyz_grid.py index b184721be..b702c74d8 100644 --- a/scripts/xyz_grid.py +++ b/scripts/xyz_grid.py @@ -118,11 +118,10 @@ def apply_size(p, x: str, xs) -> None: def find_vae(name: str): - match name := name.lower().strip(): - case 'auto', 'automatic': - return 'Automatic' - case 'none': - return 'None' + if name := name.strip().lower() in ('auto', 'automatic'): + return 'Automatic' + elif name == 'none': + return 'None' return next((k for k in modules.sd_vae.vae_dict if k.lower() == name), print(f'No VAE found for {name}; using Automatic') or 'Automatic')