Keltezaa commited on
Commit
5c5fd17
·
verified ·
1 Parent(s): 407aadc

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +4 -4
app.py CHANGED
@@ -106,16 +106,16 @@ def update_selection(evt: gr.SelectData, selected_indices, loras_state, width, h
106
  selected_info_2 = "Select a LoRA 2"
107
  lora_scale_1 = 1.15
108
  lora_scale_2 = 1.15
109
- lora_image_1 = None
110
- lora_image_2 = None
111
  if len(selected_indices) >= 1:
112
  lora1 = loras_state[selected_indices[0]]
113
  selected_info_1 = f"### LoRA 1 Selected: [{lora1['title']}](https://huggingface.co/{lora1['repo']}) ✨"
114
- lora_image_1 = lora1['image']
115
  if len(selected_indices) >= 2:
116
  lora2 = loras_state[selected_indices[1]]
117
  selected_info_2 = f"### LoRA 2 Selected: [{lora2['title']}](https://huggingface.co/{lora2['repo']}) ✨"
118
- lora_image_2 = lora2['image']
119
 
120
  if selected_indices:
121
  last_selected_lora = loras_state[selected_indices[-1]]
 
106
  selected_info_2 = "Select a LoRA 2"
107
  lora_scale_1 = 1.15
108
  lora_scale_2 = 1.15
109
+ lora_image_1 = "/path/to/default/image.png" # Provide a default image path
110
+ lora_image_2 = "/path/to/default/image.png" # Provide a default image path
111
  if len(selected_indices) >= 1:
112
  lora1 = loras_state[selected_indices[0]]
113
  selected_info_1 = f"### LoRA 1 Selected: [{lora1['title']}](https://huggingface.co/{lora1['repo']}) ✨"
114
+ lora_image_1 = lora1['image'] if lora1['image'] else lora_image_1 # Use default if None
115
  if len(selected_indices) >= 2:
116
  lora2 = loras_state[selected_indices[1]]
117
  selected_info_2 = f"### LoRA 2 Selected: [{lora2['title']}](https://huggingface.co/{lora2['repo']}) ✨"
118
+ lora_image_2 = lora2['image'] if lora2['image'] else lora_image_2 # Use default if None
119
 
120
  if selected_indices:
121
  last_selected_lora = loras_state[selected_indices[-1]]