Commit
•
2657980
1
Parent(s):
b0a2c25
Update app.py
Browse files
app.py
CHANGED
@@ -109,8 +109,8 @@ def update_selection(evt: gr.SelectData, selected_indices, width, height):
|
|
109 |
# Initialize outputs
|
110 |
selected_info_1 = "Select a LoRA 1"
|
111 |
selected_info_2 = "Select a LoRA 2"
|
112 |
-
lora_scale_1 =
|
113 |
-
lora_scale_2 =
|
114 |
lora_image_1 = None
|
115 |
lora_image_2 = None
|
116 |
if len(selected_indices) >= 1:
|
@@ -149,8 +149,8 @@ def remove_lora_1(selected_indices):
|
|
149 |
# Update selected_info_1 and selected_info_2
|
150 |
selected_info_1 = "Select a LoRA 1"
|
151 |
selected_info_2 = "Select a LoRA 2"
|
152 |
-
lora_scale_1 =
|
153 |
-
lora_scale_2 =
|
154 |
lora_image_1 = None
|
155 |
lora_image_2 = None
|
156 |
if len(selected_indices) >= 1:
|
@@ -170,8 +170,8 @@ def remove_lora_2(selected_indices):
|
|
170 |
# Update selected_info_1 and selected_info_2
|
171 |
selected_info_1 = "Select a LoRA 1"
|
172 |
selected_info_2 = "Select a LoRA 2"
|
173 |
-
lora_scale_1 =
|
174 |
-
lora_scale_2 =
|
175 |
lora_image_1 = None
|
176 |
lora_image_2 = None
|
177 |
if len(selected_indices) >= 1:
|
@@ -192,8 +192,8 @@ def randomize_loras(selected_indices):
|
|
192 |
lora2 = loras[selected_indices[1]]
|
193 |
selected_info_1 = f"### LoRA 1 Selected: [{lora1['title']}](https://huggingface.co/{lora1['repo']}) ✨"
|
194 |
selected_info_2 = f"### LoRA 2 Selected: [{lora2['title']}](https://huggingface.co/{lora2['repo']}) ✨"
|
195 |
-
lora_scale_1 =
|
196 |
-
lora_scale_2 =
|
197 |
lora_image_1 = lora1['image']
|
198 |
lora_image_2 = lora2['image']
|
199 |
random_prompt = random.choice(prompt_values)
|
@@ -393,8 +393,8 @@ def add_custom_lora(custom_lora, selected_indices):
|
|
393 |
# Update selected_info and images
|
394 |
selected_info_1 = "Select a LoRA 1"
|
395 |
selected_info_2 = "Select a LoRA 2"
|
396 |
-
lora_scale_1 =
|
397 |
-
lora_scale_2 =
|
398 |
lora_image_1 = None
|
399 |
lora_image_2 = None
|
400 |
if len(selected_indices) >= 1:
|
@@ -438,8 +438,8 @@ def remove_custom_lora(selected_indices):
|
|
438 |
# Update selected_info and images
|
439 |
selected_info_1 = "Select a LoRA 1"
|
440 |
selected_info_2 = "Select a LoRA 2"
|
441 |
-
lora_scale_1 =
|
442 |
-
lora_scale_2 =
|
443 |
lora_image_1 = None
|
444 |
lora_image_2 = None
|
445 |
if len(selected_indices) >= 1:
|
@@ -509,7 +509,7 @@ with gr.Blocks(theme=gr.themes.Soft(), css=css, delete_cache=(60, 3600)) as app:
|
|
509 |
with gr.Column(scale=3, min_width=100):
|
510 |
selected_info_1 = gr.Markdown("Select a LoRA 1")
|
511 |
with gr.Column(scale=5, min_width=50):
|
512 |
-
lora_scale_1 = gr.Slider(label="LoRA 1 Scale", minimum=0, maximum=3, step=0.01, value=
|
513 |
with gr.Row():
|
514 |
remove_button_1 = gr.Button("Remove", size="sm")
|
515 |
with gr.Column(scale=8):
|
@@ -519,7 +519,7 @@ with gr.Blocks(theme=gr.themes.Soft(), css=css, delete_cache=(60, 3600)) as app:
|
|
519 |
with gr.Column(scale=3, min_width=100):
|
520 |
selected_info_2 = gr.Markdown("Select a LoRA 2")
|
521 |
with gr.Column(scale=5, min_width=50):
|
522 |
-
lora_scale_2 = gr.Slider(label="LoRA 2 Scale", minimum=0, maximum=3, step=0.01, value=
|
523 |
with gr.Row():
|
524 |
remove_button_2 = gr.Button("Remove", size="sm")
|
525 |
with gr.Row():
|
|
|
109 |
# Initialize outputs
|
110 |
selected_info_1 = "Select a LoRA 1"
|
111 |
selected_info_2 = "Select a LoRA 2"
|
112 |
+
lora_scale_1 = 1.15
|
113 |
+
lora_scale_2 = 1.15
|
114 |
lora_image_1 = None
|
115 |
lora_image_2 = None
|
116 |
if len(selected_indices) >= 1:
|
|
|
149 |
# Update selected_info_1 and selected_info_2
|
150 |
selected_info_1 = "Select a LoRA 1"
|
151 |
selected_info_2 = "Select a LoRA 2"
|
152 |
+
lora_scale_1 = 1.15
|
153 |
+
lora_scale_2 = 1.15
|
154 |
lora_image_1 = None
|
155 |
lora_image_2 = None
|
156 |
if len(selected_indices) >= 1:
|
|
|
170 |
# Update selected_info_1 and selected_info_2
|
171 |
selected_info_1 = "Select a LoRA 1"
|
172 |
selected_info_2 = "Select a LoRA 2"
|
173 |
+
lora_scale_1 = 1.15
|
174 |
+
lora_scale_2 = 1.15
|
175 |
lora_image_1 = None
|
176 |
lora_image_2 = None
|
177 |
if len(selected_indices) >= 1:
|
|
|
192 |
lora2 = loras[selected_indices[1]]
|
193 |
selected_info_1 = f"### LoRA 1 Selected: [{lora1['title']}](https://huggingface.co/{lora1['repo']}) ✨"
|
194 |
selected_info_2 = f"### LoRA 2 Selected: [{lora2['title']}](https://huggingface.co/{lora2['repo']}) ✨"
|
195 |
+
lora_scale_1 = 1.15
|
196 |
+
lora_scale_2 = 1.15
|
197 |
lora_image_1 = lora1['image']
|
198 |
lora_image_2 = lora2['image']
|
199 |
random_prompt = random.choice(prompt_values)
|
|
|
393 |
# Update selected_info and images
|
394 |
selected_info_1 = "Select a LoRA 1"
|
395 |
selected_info_2 = "Select a LoRA 2"
|
396 |
+
lora_scale_1 = 1.15
|
397 |
+
lora_scale_2 = 1.15
|
398 |
lora_image_1 = None
|
399 |
lora_image_2 = None
|
400 |
if len(selected_indices) >= 1:
|
|
|
438 |
# Update selected_info and images
|
439 |
selected_info_1 = "Select a LoRA 1"
|
440 |
selected_info_2 = "Select a LoRA 2"
|
441 |
+
lora_scale_1 = 1.15
|
442 |
+
lora_scale_2 = 1.15
|
443 |
lora_image_1 = None
|
444 |
lora_image_2 = None
|
445 |
if len(selected_indices) >= 1:
|
|
|
509 |
with gr.Column(scale=3, min_width=100):
|
510 |
selected_info_1 = gr.Markdown("Select a LoRA 1")
|
511 |
with gr.Column(scale=5, min_width=50):
|
512 |
+
lora_scale_1 = gr.Slider(label="LoRA 1 Scale", minimum=0, maximum=3, step=0.01, value=1.15)
|
513 |
with gr.Row():
|
514 |
remove_button_1 = gr.Button("Remove", size="sm")
|
515 |
with gr.Column(scale=8):
|
|
|
519 |
with gr.Column(scale=3, min_width=100):
|
520 |
selected_info_2 = gr.Markdown("Select a LoRA 2")
|
521 |
with gr.Column(scale=5, min_width=50):
|
522 |
+
lora_scale_2 = gr.Slider(label="LoRA 2 Scale", minimum=0, maximum=3, step=0.01, value=1.15)
|
523 |
with gr.Row():
|
524 |
remove_button_2 = gr.Button("Remove", size="sm")
|
525 |
with gr.Row():
|