aboutsummaryrefslogtreecommitdiffstats
path: root/modules/sd_models.py
diff options
context:
space:
mode:
authorAUTOMATIC1111 <16777216c@gmail.com>2023-07-14 06:16:01 +0000
committerAUTOMATIC1111 <16777216c@gmail.com>2023-07-14 06:16:01 +0000
commit6d8dcdefa07d5f8f7e528046b0facdcc51185e60 (patch)
treec5298147907e890dc5e3094a9713f8e9a67c889e /modules/sd_models.py
parentdc3906185656dae75fcefe96625b1dcd0d31579c (diff)
downloadstable-diffusion-webui-gfx803-6d8dcdefa07d5f8f7e528046b0facdcc51185e60.tar.gz
stable-diffusion-webui-gfx803-6d8dcdefa07d5f8f7e528046b0facdcc51185e60.tar.bz2
stable-diffusion-webui-gfx803-6d8dcdefa07d5f8f7e528046b0facdcc51185e60.zip
initial SDXL refiner support
Diffstat (limited to 'modules/sd_models.py')
-rw-r--r--modules/sd_models.py3
1 files changed, 2 insertions, 1 deletions
diff --git a/modules/sd_models.py b/modules/sd_models.py
index 07702175..267f4d8e 100644
--- a/modules/sd_models.py
+++ b/modules/sd_models.py
@@ -414,6 +414,7 @@ def repair_config(sd_config):
sd1_clip_weight = 'cond_stage_model.transformer.text_model.embeddings.token_embedding.weight'
sd2_clip_weight = 'cond_stage_model.model.transformer.resblocks.0.attn.in_proj_weight'
sdxl_clip_weight = 'conditioner.embedders.1.model.ln_final.weight'
+sdxl_refiner_clip_weight = 'conditioner.embedders.0.model.ln_final.weight'
class SdModelData:
@@ -477,7 +478,7 @@ def load_model(checkpoint_info=None, already_loaded_state_dict=None):
state_dict = get_checkpoint_state_dict(checkpoint_info, timer)
checkpoint_config = sd_models_config.find_checkpoint_config(state_dict, checkpoint_info)
- clip_is_included_into_sd = sd1_clip_weight in state_dict or sd2_clip_weight in state_dict or sdxl_clip_weight in state_dict
+ clip_is_included_into_sd = any([x for x in [sd1_clip_weight, sd2_clip_weight, sdxl_clip_weight, sdxl_refiner_clip_weight] if x in state_dict])
timer.record("find config")