Keltezaa commited on
Commit
6ad8a43
Β·
verified Β·
1 Parent(s): 59d789e

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +6 -2
app.py CHANGED
@@ -473,10 +473,14 @@ def generate_image(prompt_mash, steps, seed, cfg_scale, width, height, progress)
473
 
474
  @spaces.GPU(duration=75)
475
  def run_lora(prompt, cfg_scale, steps, selected_indices, lora_scale_1, lora_scale_2, randomize_seed, seed, width, height, loras_state, progress=gr.Progress(track_tqdm=True)):
 
 
 
476
  if not selected_indices:
477
  raise gr.Error("You must select at least one LoRA before proceeding.")
478
 
479
  selected_loras = [loras_state[idx] for idx in selected_indices]
 
480
 
481
  # Build the prompt with trigger words
482
  prepends = []
@@ -496,7 +500,7 @@ def run_lora(prompt, cfg_scale, steps, selected_indices, lora_scale_1, lora_scal
496
  pipe.unload_lora_weights()
497
  pipe_i2i.unload_lora_weights()
498
 
499
- print(pipe.get_active_adapters())
500
 
501
  # Load LoRA weights with respective scales
502
  lora_names = []
@@ -524,7 +528,7 @@ def run_lora(prompt, cfg_scale, steps, selected_indices, lora_scale_1, lora_scal
524
  else:
525
  pipe.set_adapters(lora_names, adapter_weights=lora_weights)
526
 
527
- print(pipe.get_active_adapters())
528
 
529
  # Set random seed for reproducibility
530
  with calculateDuration("Randomizing seed"):
 
473
 
474
  @spaces.GPU(duration=75)
475
  def run_lora(prompt, cfg_scale, steps, selected_indices, lora_scale_1, lora_scale_2, randomize_seed, seed, width, height, loras_state, progress=gr.Progress(track_tqdm=True)):
476
+ print("run_lora function called.") # Debugging statement
477
+ print(f"Inputs received - Prompt: {prompt}, CFG Scale: {cfg_scale}, Steps: {steps}, Seed: {seed}, Width: {width}, Height: {height}") # Debugging statement
478
+
479
  if not selected_indices:
480
  raise gr.Error("You must select at least one LoRA before proceeding.")
481
 
482
  selected_loras = [loras_state[idx] for idx in selected_indices]
483
+ print(f"Selected LoRAs: {selected_loras}") # Debugging statement
484
 
485
  # Build the prompt with trigger words
486
  prepends = []
 
500
  pipe.unload_lora_weights()
501
  pipe_i2i.unload_lora_weights()
502
 
503
+ print("Active adapters before loading new LoRAs:", pipe.get_active_adapters())
504
 
505
  # Load LoRA weights with respective scales
506
  lora_names = []
 
528
  else:
529
  pipe.set_adapters(lora_names, adapter_weights=lora_weights)
530
 
531
+ print("Active adapters after loading new LoRAs:", pipe.get_active_adapters())
532
 
533
  # Set random seed for reproducibility
534
  with calculateDuration("Randomizing seed"):