mirror of
https://github.com/AUTOMATIC1111/stable-diffusion-webui.git
synced 2024-11-27 06:40:10 +08:00
Merge pull request #2131 from ssysm/upstream-master
Add VAE Path Arguments
This commit is contained in:
commit
b3d3b335cf
@ -153,7 +153,14 @@ def load_model_weights(model, checkpoint_info):
|
||||
|
||||
vae_file = os.path.splitext(checkpoint_file)[0] + ".vae.pt"
|
||||
if os.path.exists(vae_file):
|
||||
print(f"Loading VAE weights from: {vae_file}")
|
||||
print(f"Found VAE Weights: {vae_file}")
|
||||
elif shared.cmd_opts.vae_path != None:
|
||||
vae_file = shared.cmd_opts.vae_path
|
||||
print(f'No VAE found for inside the model folder. Using CLI specified : {vae_file}')
|
||||
else:
|
||||
print("No VAE found for inside the model folder. Passing.")
|
||||
|
||||
if os.path.exists(vae_file):
|
||||
vae_ckpt = torch.load(vae_file, map_location="cpu")
|
||||
vae_dict = {k: v for k, v in vae_ckpt["state_dict"].items() if k[0:4] != "loss"}
|
||||
|
||||
|
@ -66,6 +66,7 @@ parser.add_argument("--autolaunch", action='store_true', help="open the webui UR
|
||||
parser.add_argument("--use-textbox-seed", action='store_true', help="use textbox for seeds in UI (no up/down, but possible to input long seeds)", default=False)
|
||||
parser.add_argument("--disable-console-progressbars", action='store_true', help="do not output progressbars to console", default=False)
|
||||
parser.add_argument("--enable-console-prompts", action='store_true', help="print prompts to console when generating with txt2img and img2img", default=False)
|
||||
parser.add_argument('--vae-path', type=str, help='Path to Variational Autoencoders model', default=None)
|
||||
parser.add_argument("--disable-safe-unpickle", action='store_true', help="disable checking pytorch models for malicious code", default=False)
|
||||
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user