Merge pull request #16169 from AUTOMATIC1111/py-3.9-compatibility

Py 3.9 compatibility
This commit is contained in:
AUTOMATIC1111 2024-07-08 08:27:07 +03:00 committed by GitHub
commit bad47dcfeb
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 5 additions and 5 deletions

View File

@ -1,3 +1,4 @@
from __future__ import annotations
import gradio as gr
import logging
import os

View File

@ -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')