diff options
author | AUTOMATIC1111 <16777216c@gmail.com> | 2023-01-28 05:29:01 +0000 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-01-28 05:29:01 +0000 |
commit | 41975c375cf7167d1ac2e25caef2cb4da4ba4b31 (patch) | |
tree | a23d8fc4ae0360fd43f06215e8ce22974afe382c | |
parent | 8ce0ccf336c0009c86243780616d1ad44c38eac1 (diff) | |
parent | 6b82efd737827bbeef202f04ff5a8faec9b64ef8 (diff) | |
download | stable-diffusion-webui-gfx803-41975c375cf7167d1ac2e25caef2cb4da4ba4b31.tar.gz stable-diffusion-webui-gfx803-41975c375cf7167d1ac2e25caef2cb4da4ba4b31.tar.bz2 stable-diffusion-webui-gfx803-41975c375cf7167d1ac2e25caef2cb4da4ba4b31.zip |
Merge pull request #7294 from MrCheeze/model-detection
add v2-inpainting model detection, and broaden v-model detection to include anything with 768 in the name
-rw-r--r-- | modules/sd_models_config.py | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/modules/sd_models_config.py b/modules/sd_models_config.py index 4d1e92e1..73854a45 100644 --- a/modules/sd_models_config.py +++ b/modules/sd_models_config.py @@ -10,6 +10,7 @@ sd_repo_configs_path = os.path.join(paths.paths['Stable Diffusion'], "configs", config_default = shared.sd_default_config
config_sd2 = os.path.join(sd_repo_configs_path, "v2-inference.yaml")
config_sd2v = os.path.join(sd_repo_configs_path, "v2-inference-v.yaml")
+config_sd2_inpainting = os.path.join(sd_repo_configs_path, "v2-inpainting-inference.yaml")
config_depth_model = os.path.join(sd_repo_configs_path, "v2-midas-inference.yaml")
config_inpainting = os.path.join(sd_configs_path, "v1-inpainting-inference.yaml")
config_instruct_pix2pix = os.path.join(sd_configs_path, "instruct-pix2pix.yaml")
@@ -28,7 +29,9 @@ def guess_model_config_from_state_dict(sd, filename): return config_depth_model
if sd2_cond_proj_weight is not None and sd2_cond_proj_weight.shape[1] == 1024:
- if re.search(re_parametrization_v, fn) or "v2-1_768" in fn:
+ if diffusion_model_input.shape[1] == 9:
+ return config_sd2_inpainting
+ elif re.search(re_parametrization_v, fn) or "768" in fn:
return config_sd2v
else:
return config_sd2
|