aboutsummaryrefslogtreecommitdiffstats
path: root/modules/sd_models_config.py
diff options
context:
space:
mode:
authorSj-Si <sjw.jetty@gmail.com>2024-01-11 21:37:35 +0000
committerSj-Si <sjw.jetty@gmail.com>2024-01-11 21:37:35 +0000
commit036500223de0a3caaa86360a8ad3ed301e4367b0 (patch)
treef05f0d5fc503d9c35d57bad077a5dab1dfd6569e /modules/sd_models_config.py
parent0726a6e12e85a37d1e514f5603acf9f058c11783 (diff)
parentcb5b335acddd126d4f6c990982816c06beb0d6ae (diff)
downloadstable-diffusion-webui-gfx803-036500223de0a3caaa86360a8ad3ed301e4367b0.tar.gz
stable-diffusion-webui-gfx803-036500223de0a3caaa86360a8ad3ed301e4367b0.tar.bz2
stable-diffusion-webui-gfx803-036500223de0a3caaa86360a8ad3ed301e4367b0.zip
Merge changes from dev
Diffstat (limited to 'modules/sd_models_config.py')
-rw-r--r--modules/sd_models_config.py6
1 files changed, 5 insertions, 1 deletions
diff --git a/modules/sd_models_config.py b/modules/sd_models_config.py
index deab2f6e..b38137eb 100644
--- a/modules/sd_models_config.py
+++ b/modules/sd_models_config.py
@@ -15,6 +15,7 @@ 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_sdxl = os.path.join(sd_xl_repo_configs_path, "sd_xl_base.yaml")
config_sdxl_refiner = os.path.join(sd_xl_repo_configs_path, "sd_xl_refiner.yaml")
+config_sdxl_inpainting = os.path.join(sd_configs_path, "sd_xl_inpaint.yaml")
config_depth_model = os.path.join(sd_repo_configs_path, "v2-midas-inference.yaml")
config_unclip = os.path.join(sd_repo_configs_path, "v2-1-stable-unclip-l-inference.yaml")
config_unopenclip = os.path.join(sd_repo_configs_path, "v2-1-stable-unclip-h-inference.yaml")
@@ -71,7 +72,10 @@ def guess_model_config_from_state_dict(sd, filename):
sd2_variations_weight = sd.get('embedder.model.ln_final.weight', None)
if sd.get('conditioner.embedders.1.model.ln_final.weight', None) is not None:
- return config_sdxl
+ if diffusion_model_input.shape[1] == 9:
+ return config_sdxl_inpainting
+ else:
+ return config_sdxl
if sd.get('conditioner.embedders.0.model.ln_final.weight', None) is not None:
return config_sdxl_refiner
elif sd.get('depth_model.model.pretrained.act_postprocess3.0.project.0.bias', None) is not None: