diff options
author | Sakura-Luna <53183413+Sakura-Luna@users.noreply.github.com> | 2023-05-11 06:29:52 +0000 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-05-11 06:29:52 +0000 |
commit | 1dcd6723242c3d691610f9ed937951baea49c2d1 (patch) | |
tree | 11bdb5fd033d193da2eb014499ec815ab7c47510 /modules/sd_vae.py | |
parent | 749a93295e5259fbba2e2a849cde5a37c67aa69f (diff) | |
download | stable-diffusion-webui-gfx803-1dcd6723242c3d691610f9ed937951baea49c2d1.tar.gz stable-diffusion-webui-gfx803-1dcd6723242c3d691610f9ed937951baea49c2d1.tar.bz2 stable-diffusion-webui-gfx803-1dcd6723242c3d691610f9ed937951baea49c2d1.zip |
Update sd_vae.py
There is no need to use split.
Diffstat (limited to 'modules/sd_vae.py')
-rw-r--r-- | modules/sd_vae.py | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/modules/sd_vae.py b/modules/sd_vae.py index 17d1f702..95262ca3 100644 --- a/modules/sd_vae.py +++ b/modules/sd_vae.py @@ -88,10 +88,9 @@ def refresh_vae_list(): def find_vae_near_checkpoint(checkpoint_file): - checkpoint_path = os.path.basename(checkpoint_file).split('.', 1)[0] + checkpoint_path = os.path.basename(checkpoint_file).rsplit('.', 1)[0] for vae_file in vae_dict.values(): - vae_path = os.path.basename(vae_file).split('.', 1)[0] - if vae_path == checkpoint_path: + if os.path.basename(vae_file).startswith(checkpoint_path): return vae_file return None |