Spaces:
Runtime error
Runtime error
Commit
•
37f8358
1
Parent(s):
a0f2b49
Update app.py
Browse files
app.py
CHANGED
@@ -362,7 +362,7 @@ def add_custom_lora(custom_lora, selected_indices):
|
|
362 |
if(repo.endswith(".safetensors") and repo.startswith("http")):
|
363 |
repo = download_file(repo)
|
364 |
new_item = {
|
365 |
-
"image": image
|
366 |
"title": title,
|
367 |
"repo": repo,
|
368 |
"weights": path,
|
@@ -390,22 +390,12 @@ def add_custom_lora(custom_lora, selected_indices):
|
|
390 |
if len(selected_indices) >= 1:
|
391 |
lora1 = loras[selected_indices[0]]
|
392 |
selected_info_1 = f"### LoRA 1 Selected: {lora1['title']} ✨"
|
393 |
-
lora_image_1 = lora1['image']
|
394 |
if len(selected_indices) >= 2:
|
395 |
lora2 = loras[selected_indices[1]]
|
396 |
selected_info_2 = f"### LoRA 2 Selected: {lora2['title']} ✨"
|
397 |
-
lora_image_2 = lora2['image']
|
398 |
print("Chegou no final")
|
399 |
-
print (
|
400 |
-
gr.update(value=gallery_items),
|
401 |
-
selected_info_1,
|
402 |
-
selected_info_2,
|
403 |
-
selected_indices,
|
404 |
-
lora_scale_1,
|
405 |
-
lora_scale_2,
|
406 |
-
lora_image_1,
|
407 |
-
lora_image_2
|
408 |
-
)
|
409 |
return (
|
410 |
gr.update(value=gallery_items),
|
411 |
selected_info_1,
|
|
|
362 |
if(repo.endswith(".safetensors") and repo.startswith("http")):
|
363 |
repo = download_file(repo)
|
364 |
new_item = {
|
365 |
+
"image": image,
|
366 |
"title": title,
|
367 |
"repo": repo,
|
368 |
"weights": path,
|
|
|
390 |
if len(selected_indices) >= 1:
|
391 |
lora1 = loras[selected_indices[0]]
|
392 |
selected_info_1 = f"### LoRA 1 Selected: {lora1['title']} ✨"
|
393 |
+
lora_image_1 = lora1['image'] if lora1['image'] else None
|
394 |
if len(selected_indices) >= 2:
|
395 |
lora2 = loras[selected_indices[1]]
|
396 |
selected_info_2 = f"### LoRA 2 Selected: {lora2['title']} ✨"
|
397 |
+
lora_image_2 = lora2['image'] if lora2['image'] else None
|
398 |
print("Chegou no final")
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
399 |
return (
|
400 |
gr.update(value=gallery_items),
|
401 |
selected_info_1,
|