From 8acd99c3d57da7a55b3100f23c3bada92f34f71a Mon Sep 17 00:00:00 2001 From: lllyasviel Date: Sun, 14 Jan 2024 04:28:28 -0800 Subject: [PATCH] Update sd_models_xl.py --- modules/sd_models_xl.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/modules/sd_models_xl.py b/modules/sd_models_xl.py index f6d447456..1418348ae 100644 --- a/modules/sd_models_xl.py +++ b/modules/sd_models_xl.py @@ -12,6 +12,8 @@ def get_learned_conditioning(self: sgm.models.diffusion.DiffusionEngine, batch: prompt_parser.SdConditioning | list[str]): + model_management.load_model_gpu(self.clip_patcher) + for embedder in self.conditioner.embedders: embedder.ucg_rate = 0.0 @@ -20,7 +22,7 @@ def get_learned_conditioning(self: sgm.models.diffusion.DiffusionEngine, batch: is_negative_prompt = getattr(batch, 'is_negative_prompt', False) aesthetic_score = shared.opts.sdxl_refiner_low_aesthetic_score if is_negative_prompt else shared.opts.sdxl_refiner_high_aesthetic_score - devices_args = dict(device=devices.device, dtype=devices.dtype) + devices_args = dict(device=self.clip_patcher.current_device, dtype=model_management.text_encoder_dtype()) sdxl_conds = { "txt": batch,