Skip to content

Commit a5409a6

Browse files
committed
Save VAE provided by cmd_opts.vae_path
1 parent 056f06d commit a5409a6

File tree

1 file changed

+4
-7
lines changed

1 file changed

+4
-7
lines changed

modules/sd_vae.py

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -78,27 +78,24 @@ def refresh_vae_list(vae_path=vae_path, model_path=model_path):
7878
vae_list.extend(default_vae_list)
7979
vae_list.extend(list(res.keys()))
8080
vae_dict.clear()
81-
vae_dict.update(default_vae_dict)
8281
vae_dict.update(res)
82+
vae_dict.update(default_vae_dict)
8383
return vae_list
8484

8585

8686
def resolve_vae(checkpoint_file, vae_file="auto"):
8787
global first_load, vae_dict, vae_list
88-
# save_settings = False
8988

90-
# if vae_file argument is provided, it takes priority
89+
# if vae_file argument is provided, it takes priority, but not saved
9190
if vae_file and vae_file not in default_vae_list:
9291
if not os.path.isfile(vae_file):
9392
vae_file = "auto"
94-
# save_settings = True
9593
print("VAE provided as function argument doesn't exist")
96-
# for the first load, if vae-path is provided, it takes priority and failure is reported
94+
# for the first load, if vae-path is provided, it takes priority, saved, and failure is reported
9795
if first_load and shared.cmd_opts.vae_path is not None:
9896
if os.path.isfile(shared.cmd_opts.vae_path):
9997
vae_file = shared.cmd_opts.vae_path
100-
# save_settings = True
101-
# print("Using VAE provided as command line argument")
98+
shared.opts.data['sd_vae'] = get_filename(vae_file)
10299
else:
103100
print("VAE provided as command line argument doesn't exist")
104101
# else, we load from settings

0 commit comments

Comments
 (0)