From 40a8ff57311d2545b5fbd0226988acda3015d6cf Mon Sep 17 00:00:00 2001 From: Jaret Burkett Date: Mon, 23 Sep 2024 10:37:12 -0600 Subject: [PATCH] Load local hugging face packages for assistant adapter --- toolkit/stable_diffusion_model.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/toolkit/stable_diffusion_model.py b/toolkit/stable_diffusion_model.py index dd9c6062..94140c33 100644 --- a/toolkit/stable_diffusion_model.py +++ b/toolkit/stable_diffusion_model.py @@ -504,8 +504,11 @@ class StableDiffusion: if not self.is_flux: raise ValueError("Assistant lora is only supported for flux models currently") - # handle downloading from the hub if needed - if not os.path.exists(self.model_config.assistant_lora_path): + if os.path.isdir(self.model_config.assistant_lora_path): + self.model_config.assistant_lora_path = os.path.join( + self.model_config.assistant_lora_path, "pytorch_lora_weights.safetensors" + ) + elif not os.path.exists(self.model_config.assistant_lora_path): print(f"Grabbing assistant lora from the hub: {self.model_config.assistant_lora_path}") new_lora_path = hf_hub_download( self.model_config.assistant_lora_path,