aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAUTOMATIC <16777216c@gmail.com>2022-09-30 19:16:03 +0000
committerAUTOMATIC <16777216c@gmail.com>2022-09-30 19:16:03 +0000
commit2b03f0bbda1229dff6e7ab6f656b28587eba8308 (patch)
tree1884e07a560daf5dc10be0e7e0d8d3e08b8ce3ce
parent3a876b16a92a23e5536d828c9217fda998e5d9c1 (diff)
downloadstable-diffusion-webui-gfx803-2b03f0bbda1229dff6e7ab6f656b28587eba8308.tar.gz
stable-diffusion-webui-gfx803-2b03f0bbda1229dff6e7ab6f656b28587eba8308.tar.bz2
stable-diffusion-webui-gfx803-2b03f0bbda1229dff6e7ab6f656b28587eba8308.zip
if --ckpt option is specified, load that model
-rw-r--r--modules/sd_models.py1
-rw-r--r--modules/shared.py2
2 files changed, 2 insertions, 1 deletions
diff --git a/modules/sd_models.py b/modules/sd_models.py
index ab014efb..2539f14c 100644
--- a/modules/sd_models.py
+++ b/modules/sd_models.py
@@ -69,6 +69,7 @@ def list_models():
h = model_hash(cmd_ckpt)
title, short_model_name = modeltitle(cmd_ckpt, h)
checkpoints_list[title] = CheckpointInfo(cmd_ckpt, title, h, short_model_name)
+ shared.opts.sd_model_checkpoint = title
elif cmd_ckpt is not None and cmd_ckpt != shared.default_sd_model_file:
print(f"Checkpoint in --ckpt argument not found (Possible it was moved to {model_path}: {cmd_ckpt}", file=sys.stderr)
for filename in model_list:
diff --git a/modules/shared.py b/modules/shared.py
index 8428c7a3..ac968b2d 100644
--- a/modules/shared.py
+++ b/modules/shared.py
@@ -20,7 +20,7 @@ default_sd_model_file = sd_model_file
model_path = os.path.join(script_path, 'models')
parser = argparse.ArgumentParser()
parser.add_argument("--config", type=str, default=os.path.join(sd_path, "configs/stable-diffusion/v1-inference.yaml"), help="path to config which constructs model",)
-parser.add_argument("--ckpt", type=str, default=sd_model_file, help="path to checkpoint of stable diffusion model; this checkpoint will be added to the list of checkpoints and loaded by default if you don't have a checkpoint selected in settings",)
+parser.add_argument("--ckpt", type=str, default=sd_model_file, help="path to checkpoint of stable diffusion model; if specified, this checkpoint will be added to the list of checkpoints and loaded",)
parser.add_argument("--ckpt-dir", type=str, default=None, help="Path to directory with stable diffusion checkpoints")
parser.add_argument("--gfpgan-dir", type=str, help="GFPGAN directory", default=('./src/gfpgan' if os.path.exists('./src/gfpgan') else './GFPGAN'))
parser.add_argument("--gfpgan-model", type=str, help="GFPGAN model file name", default=None)