From 21e72d1a5e6cac133c379cae62a4315fec81ee9d Mon Sep 17 00:00:00 2001 From: w-e-w <40751091+w-e-w@users.noreply.github.com> Date: Mon, 8 Jul 2024 14:07:26 +0900 Subject: [PATCH] py 3.9 find_vae() --- scripts/xyz_grid.py | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) 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')