diff options
author | AUTOMATIC1111 <16777216c@gmail.com> | 2023-07-13 18:17:50 +0000 |
---|---|---|
committer | AUTOMATIC1111 <16777216c@gmail.com> | 2023-07-13 18:17:50 +0000 |
commit | 6c5f83b19b331d51bde28c5033d13d0d64c11e54 (patch) | |
tree | 201ceae91b2cdb0dc3e49e51705cda6b7164413c /modules | |
parent | ff73841c608f5f02e6352bb235d9dbf63d922990 (diff) | |
download | stable-diffusion-webui-gfx803-6c5f83b19b331d51bde28c5033d13d0d64c11e54.tar.gz stable-diffusion-webui-gfx803-6c5f83b19b331d51bde28c5033d13d0d64c11e54.tar.bz2 stable-diffusion-webui-gfx803-6c5f83b19b331d51bde28c5033d13d0d64c11e54.zip |
add support for SDXL loras with te1/te2 modules
Diffstat (limited to 'modules')
-rw-r--r-- | modules/sd_models.py | 3 | ||||
-rw-r--r-- | modules/sd_models_xl.py | 1 |
2 files changed, 2 insertions, 2 deletions
diff --git a/modules/sd_models.py b/modules/sd_models.py index 9e8cb3cf..07702175 100644 --- a/modules/sd_models.py +++ b/modules/sd_models.py @@ -289,7 +289,8 @@ def load_model_weights(model, checkpoint_info: CheckpointInfo, state_dict, timer if state_dict is None:
state_dict = get_checkpoint_state_dict(checkpoint_info, timer)
- if hasattr(model, 'conditioner'):
+ model.is_sdxl = hasattr(model, 'conditioner')
+ if model.is_sdxl:
sd_models_xl.extend_sdxl(model)
model.load_state_dict(state_dict, strict=False)
diff --git a/modules/sd_models_xl.py b/modules/sd_models_xl.py index af445a61..a7240dc0 100644 --- a/modules/sd_models_xl.py +++ b/modules/sd_models_xl.py @@ -48,7 +48,6 @@ def extend_sdxl(model): discretization = sgm.modules.diffusionmodules.discretizer.LegacyDDPMDiscretization()
model.alphas_cumprod = torch.asarray(discretization.alphas_cumprod, device=devices.device, dtype=dtype)
- model.is_sdxl = True
sgm.models.diffusion.DiffusionEngine.get_learned_conditioning = get_learned_conditioning
|