jonathanrstern commited on
Commit
c39cce5
·
1 Parent(s): 0fbce5e

safetensors load_lora_weights

Browse files
Files changed (1) hide show
  1. handler.py +7 -4
handler.py CHANGED
@@ -1,12 +1,15 @@
1
  from typing import Dict, List, Any
2
- from diffusers import ControlNetModel, StableDiffusionControlNetPipeline, StableDiffusionPipeline
3
 
4
 
5
  class EndpointHandler():
6
  def __init__(self, path=""):
7
- self.pipeline = StableDiffusionPipeline.from_single_file(
8
- "https://huggingface.co/artificialguybr/LogoRedmond-LogoLoraForSDXL/blob/main/LogoRedmond_LogoRedAF.safetensors"
9
- )
 
 
 
10
 
11
  def __call__(self, data: Dict[str, Any]) -> List[Dict[str, Any]]:
12
  """
 
1
  from typing import Dict, List, Any
2
+ from diffusers import ControlNetModel, StableDiffusionControlNetPipeline, StableDiffusionPipeline, DiffusionPipeline
3
 
4
 
5
  class EndpointHandler():
6
  def __init__(self, path=""):
7
+ self.pipeline = DiffusionPipeline.from_pretrained("stabilityai/stable-diffusion-xl-base-1.0")
8
+ self.pipeline.load_lora_weights(".", weight_name="./safetensors.safetensors")
9
+
10
+ # self.pipeline = StableDiffusionPipeline.from_single_file(
11
+ # "https://huggingface.co/artificialguybr/LogoRedmond-LogoLoraForSDXL/blob/main/LogoRedmond_LogoRedAF.safetensors"
12
+ # )
13
 
14
  def __call__(self, data: Dict[str, Any]) -> List[Dict[str, Any]]:
15
  """