barreloflube
commited on
Commit
·
3d3f40a
1
Parent(s):
9b41963
Refactor add_to_enabled_loras function to include model parameter
Browse files- tabs/images/events.py +1 -1
- tabs/images/ui.py +1 -1
tabs/images/events.py
CHANGED
@@ -254,7 +254,7 @@ def remove_from_enabled_loras(enabled_loras, index):
|
|
254 |
def add_to_enabled_loras(model, selected_lora, enabled_loras):
|
255 |
|
256 |
for m in Config.IMAGES_MODELS:
|
257 |
-
if m['repo_id'] == model
|
258 |
lora_data = []
|
259 |
if m['loader'] == 'flux':
|
260 |
lora_data = Config.IMAGES_LORAS_FLUX
|
|
|
254 |
def add_to_enabled_loras(model, selected_lora, enabled_loras):
|
255 |
|
256 |
for m in Config.IMAGES_MODELS:
|
257 |
+
if m['repo_id'] == model:
|
258 |
lora_data = []
|
259 |
if m['loader'] == 'flux':
|
260 |
lora_data = Config.IMAGES_LORAS_FLUX
|
tabs/images/ui.py
CHANGED
@@ -142,7 +142,7 @@ def image_tab():
|
|
142 |
# Loras
|
143 |
lora_gallery.select(selected_lora_from_gallery, None, selected_lora)
|
144 |
custom_lora.change(update_selected_lora, custom_lora, [selected_lora, custom_lora_info])
|
145 |
-
add_lora.click(add_to_enabled_loras, [selected_lora, enabled_loras], [selected_lora, custom_lora_info, enabled_loras])
|
146 |
enabled_loras.change(update_lora_sliders, enabled_loras, [lora_slider_0, lora_slider_1, lora_slider_2, lora_slider_3, lora_slider_4, lora_slider_5, lora_remove_0, lora_remove_1, lora_remove_2, lora_remove_3, lora_remove_4, lora_remove_5]) # type: ignore
|
147 |
|
148 |
for i in range(6):
|
|
|
142 |
# Loras
|
143 |
lora_gallery.select(selected_lora_from_gallery, None, selected_lora)
|
144 |
custom_lora.change(update_selected_lora, custom_lora, [selected_lora, custom_lora_info])
|
145 |
+
add_lora.click(add_to_enabled_loras, [model, selected_lora, enabled_loras], [selected_lora, custom_lora_info, enabled_loras])
|
146 |
enabled_loras.change(update_lora_sliders, enabled_loras, [lora_slider_0, lora_slider_1, lora_slider_2, lora_slider_3, lora_slider_4, lora_slider_5, lora_remove_0, lora_remove_1, lora_remove_2, lora_remove_3, lora_remove_4, lora_remove_5]) # type: ignore
|
147 |
|
148 |
for i in range(6):
|