Skip to content

Commit

Permalink
sort VAE
Browse files Browse the repository at this point in the history
  • Loading branch information
w-e-w committed Aug 4, 2023
1 parent 09c1be9 commit 36b19be
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions modules/sd_vae.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
from modules import paths, shared, devices, script_callbacks, sd_models
import glob
from copy import deepcopy
from collections import OrderedDict


vae_path = os.path.abspath(os.path.join(paths.models_path, "VAE"))
Expand Down Expand Up @@ -50,6 +51,7 @@ def get_filename(filepath):


def refresh_vae_list():
global vae_dict
vae_dict.clear()

paths = [
Expand Down Expand Up @@ -83,6 +85,8 @@ def refresh_vae_list():
name = get_filename(filepath)
vae_dict[name] = filepath

vae_dict = OrderedDict(sorted(vae_dict.items(), key=lambda item: item[0].lower()))


def find_vae_near_checkpoint(checkpoint_file):
checkpoint_path = os.path.basename(checkpoint_file).rsplit('.', 1)[0]
Expand Down

0 comments on commit 36b19be

Please sign in to comment.