improved correction of pred norm by targeting the prior

This commit is contained in:
Jaret Burkett
2024-02-01 06:31:04 -07:00
parent 1ae1017748
commit 177c7130ec
3 changed files with 26 additions and 26 deletions

View File

@@ -306,6 +306,7 @@ class ModelConfig:
self.refiner_name_or_path = kwargs.get('refiner_name_or_path', None)
self._original_refiner_name_or_path = self.refiner_name_or_path
self.refiner_start_at = kwargs.get('refiner_start_at', 0.5)
self.lora_path = kwargs.get('lora_path', None)
# only for SDXL models for now
self.use_text_encoder_1: bool = kwargs.get('use_text_encoder_1', True)

View File

@@ -281,6 +281,12 @@ class StableDiffusion:
self.unet.requires_grad_(False)
self.unet.eval()
# load any loras we have
if self.model_config.lora_path is not None:
pipe.load_lora_weights(self.model_config.lora_path, adapter_name="lora1")
pipe.fuse_lora()
self.unet.fuse_lora()
self.tokenizer = tokenizer
self.text_encoder = text_encoder
self.pipeline = pipe