AlekseyCalvin commited on
Commit
a2aad52
1 Parent(s): 2e43aab

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +7 -7
app.py CHANGED
@@ -68,7 +68,7 @@ class calculateDuration:
68
  def __enter__(self):
69
  self.start_time = time.time()
70
  return self
71
-
72
  def __exit__(self, exc_type, exc_value, traceback):
73
  self.end_time = time.time()
74
  self.elapsed_time = self.end_time - self.start_time
@@ -137,13 +137,13 @@ def run_lora(prompt, cfg_scale, steps, selected_index, randomize_seed, seed, wid
137
  # Load LoRA weights
138
  with calculateDuration(f"Loading LoRA weights for {selected_lora['title']}"):
139
  if "weights" in selected_lora:
140
- pipe.load_lora_weights(lora_path, weight_name=selected_lora["weights"], adapter_name="soon")
141
- pipe.load_lora_weights("ostris/OpenFLUX.1", weight_name="openflux1-v0.1.0-fast-lora.safetensors", adapter_name="fast")
142
- pipe.set_adapters(["fast", "soon"], adapter_weights=[1.0, lora_scale])
143
  else:
144
- pipe.load_lora_weights(lora_path, adapter_name="soon")
145
- pipe.load_lora_weights("ostris/OpenFLUX.1", weight_name="openflux1-v0.1.0-fast-lora.safetensors", adapter_name="fast")
146
- pipe.set_adapters(["fast", "soon"], adapter_weights=[1.0, lora_scale])
147
 
148
  # Set random seed for reproducibility
149
  with calculateDuration("Randomizing seed"):
 
68
  def __enter__(self):
69
  self.start_time = time.time()
70
  return self
71
+
72
  def __exit__(self, exc_type, exc_value, traceback):
73
  self.end_time = time.time()
74
  self.elapsed_time = self.end_time - self.start_time
 
137
  # Load LoRA weights
138
  with calculateDuration(f"Loading LoRA weights for {selected_lora['title']}"):
139
  if "weights" in selected_lora:
140
+ pipe.load_lora_weights(lora_path, weight_name=selected_lora["weights"], adapter_name=selected_lora['title'], adapter_weights=lora_scale)
141
+ pipe.load_lora_weights("ostris/OpenFLUX.1", weight_name="openflux1-v0.1.0-fast-lora.safetensors", adapter_name="fast", adapter_weights=[1.0])
142
+ pipe.set_adapters(["fast", 'title'], adapter_weights=[1.0, lora_scale])
143
  else:
144
+ pipe.load_lora_weights(lora_path, adapter_name=selected_lora['title'], adapter_weights=lora_scale)
145
+ pipe.load_lora_weights("ostris/OpenFLUX.1", weight_name="openflux1-v0.1.0-fast-lora.safetensors", adapter_name="fast", adapter_weights=[1.0])
146
+ pipe.set_adapters(["fast", 'title'], adapter_weights=[1.0, lora_scale])
147
 
148
  # Set random seed for reproducibility
149
  with calculateDuration("Randomizing seed"):