From dd4aa6c6b0d2237a7b86000a0a89ffb447e5e16e Mon Sep 17 00:00:00 2001 From: nullquant Date: Thu, 18 Apr 2024 21:01:45 +0300 Subject: [PATCH] lora scaling removed in prompt_encode() --- brushnet/pipeline_brushnet.py | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/brushnet/pipeline_brushnet.py b/brushnet/pipeline_brushnet.py index 20a52dc..af68b42 100644 --- a/brushnet/pipeline_brushnet.py +++ b/brushnet/pipeline_brushnet.py @@ -430,9 +430,12 @@ class StableDiffusionBrushNetPipeline( negative_prompt_embeds = negative_prompt_embeds.repeat(1, num_images_per_prompt, 1) negative_prompt_embeds = negative_prompt_embeds.view(batch_size * num_images_per_prompt, seq_len, -1) - if isinstance(self, LoraLoaderMixin) and USE_PEFT_BACKEND: - # Retrieve the original scale by scaling back the LoRA layers - unscale_lora_layers(self.text_encoder, lora_scale) + # self.text_encoder is not used after encode_prompt() + # self.text_encoder = None (we use prompt_embeds and negative_prompt_embeds in brushnet_nodes) + # So, nullquant commented out this section. + #if isinstance(self, LoraLoaderMixin) and USE_PEFT_BACKEND: + # # Retrieve the original scale by scaling back the LoRA layers + # unscale_lora_layers(self.text_encoder, lora_scale) return prompt_embeds, negative_prompt_embeds