multimodalart HF staff commited on
Commit
582601f
1 Parent(s): f4f13e1

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +4 -3
app.py CHANGED
@@ -238,9 +238,10 @@ def run_lora(prompt, image_input, image_strength, cfg_scale, steps, selected_ind
238
  pipe.load_lora_weights(lora_path, weight_name=lora["weights"], low_cpu_mem_usage=True, adapter_name=lora_name)
239
  else:
240
  pipe.load_lora_weights(lora_path, low_cpu_mem_usage=True, adapter_name=lora_name)
241
-
242
- pipeline.set_adapters(lora_names, adapter_weights=[lora_scale_1, lora_scale_2])
243
-
 
244
  # Set random seed for reproducibility
245
  with calculateDuration("Randomizing seed"):
246
  if randomize_seed:
 
238
  pipe.load_lora_weights(lora_path, weight_name=lora["weights"], low_cpu_mem_usage=True, adapter_name=lora_name)
239
  else:
240
  pipe.load_lora_weights(lora_path, low_cpu_mem_usage=True, adapter_name=lora_name)
241
+ if image_input is not None:
242
+ pipe_i2i.set_adapters(lora_names, adapter_weights=[lora_scale_1, lora_scale_2])
243
+ else:
244
+ pipe.set_adapters(lora_names, adapter_weights=[lora_scale_1, lora_scale_2])
245
  # Set random seed for reproducibility
246
  with calculateDuration("Randomizing seed"):
247
  if randomize_seed: