diff options
author | AUTOMATIC1111 <16777216c@gmail.com> | 2023-12-31 19:33:32 +0000 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-12-31 19:33:32 +0000 |
commit | be5f1acc8f6e5bfc7f8234fd570d663b2fde9c27 (patch) | |
tree | a07510354ce2dddf0afaf37ba256eba6d820900d /modules/sd_models_xl.py | |
parent | f3af8c8d04d6be58ddb3b55f77d8006241dca8f6 (diff) | |
parent | 5768afc776a66bb94e77a9c1daebeea58fa731d5 (diff) | |
download | stable-diffusion-webui-gfx803-be5f1acc8f6e5bfc7f8234fd570d663b2fde9c27.tar.gz stable-diffusion-webui-gfx803-be5f1acc8f6e5bfc7f8234fd570d663b2fde9c27.tar.bz2 stable-diffusion-webui-gfx803-be5f1acc8f6e5bfc7f8234fd570d663b2fde9c27.zip |
Merge pull request #14478 from akx/dtype-inspect
Add utility to inspect a model's dtype/device
Diffstat (limited to 'modules/sd_models_xl.py')
-rw-r--r-- | modules/sd_models_xl.py | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/modules/sd_models_xl.py b/modules/sd_models_xl.py index 1de31b0d..c3602a7e 100644 --- a/modules/sd_models_xl.py +++ b/modules/sd_models_xl.py @@ -6,6 +6,7 @@ import sgm.models.diffusion import sgm.modules.diffusionmodules.denoiser_scaling
import sgm.modules.diffusionmodules.discretizer
from modules import devices, shared, prompt_parser
+from modules.torch_utils import get_param
def get_learned_conditioning(self: sgm.models.diffusion.DiffusionEngine, batch: prompt_parser.SdConditioning | list[str]):
@@ -90,7 +91,7 @@ sgm.modules.GeneralConditioner.get_target_prompt_token_count = get_target_prompt def extend_sdxl(model):
"""this adds a bunch of parameters to make SDXL model look a bit more like SD1.5 to the rest of the codebase."""
- dtype = next(model.model.diffusion_model.parameters()).dtype
+ dtype = get_param(model.model.diffusion_model).dtype
model.model.diffusion_model.dtype = dtype
model.model.conditioning_key = 'crossattn'
model.cond_stage_key = 'txt'
|