Tirando o Custom loRA
Browse files
app.py
CHANGED
@@ -440,7 +440,7 @@ def get_huggingface_safetensors(link):
|
|
440 |
raise Exception(f"You didn't include a link neither a valid Hugging Face repository with a *.safetensors LoRA")
|
441 |
return split_link[1], link, safetensors_name, trigger_word, image_url
|
442 |
|
443 |
-
#
|
444 |
# if(link.startswith("https://")):
|
445 |
# if(link.startswith("https://huggingface.co") or link.startswith("https://www.huggingface.co")):
|
446 |
# link_split = link.split("huggingface.co/")
|
@@ -486,8 +486,8 @@ def get_huggingface_safetensors(link):
|
|
486 |
# else:
|
487 |
# return gr.update(visible=False), gr.update(visible=False), gr.update(), "", None, ""
|
488 |
|
489 |
-
def remove_custom_lora():
|
490 |
-
return gr.update(visible=False), gr.update(visible=False), gr.update(), "", None, ""
|
491 |
|
492 |
run_lora.zerogpu = True
|
493 |
|
@@ -570,15 +570,15 @@ with gr.Blocks(theme=collos, delete_cache=(60, 60)) as app:
|
|
570 |
inputs=[width, height],
|
571 |
outputs=[prompt, selected_info, selected_index, width, height]
|
572 |
)
|
573 |
-
custom_lora.input(
|
574 |
-
add_custom_lora,
|
575 |
-
inputs=[custom_lora],
|
576 |
-
outputs=[custom_lora_info, custom_lora_button, gallery, selected_info, selected_index, prompt]
|
577 |
-
)
|
578 |
-
custom_lora_button.click(
|
579 |
-
remove_custom_lora,
|
580 |
-
outputs=[custom_lora_info, custom_lora_button, gallery, selected_info, selected_index, custom_lora]
|
581 |
-
)
|
582 |
gr.on(
|
583 |
triggers=[generate_button.click, prompt.submit],
|
584 |
fn=run_lora,
|
|
|
440 |
raise Exception(f"You didn't include a link neither a valid Hugging Face repository with a *.safetensors LoRA")
|
441 |
return split_link[1], link, safetensors_name, trigger_word, image_url
|
442 |
|
443 |
+
#def check_custom_model(link):
|
444 |
# if(link.startswith("https://")):
|
445 |
# if(link.startswith("https://huggingface.co") or link.startswith("https://www.huggingface.co")):
|
446 |
# link_split = link.split("huggingface.co/")
|
|
|
486 |
# else:
|
487 |
# return gr.update(visible=False), gr.update(visible=False), gr.update(), "", None, ""
|
488 |
|
489 |
+
# def remove_custom_lora():
|
490 |
+
# return gr.update(visible=False), gr.update(visible=False), gr.update(), "", None, ""
|
491 |
|
492 |
run_lora.zerogpu = True
|
493 |
|
|
|
570 |
inputs=[width, height],
|
571 |
outputs=[prompt, selected_info, selected_index, width, height]
|
572 |
)
|
573 |
+
# custom_lora.input(
|
574 |
+
# add_custom_lora,
|
575 |
+
# inputs=[custom_lora],
|
576 |
+
# outputs=[custom_lora_info, custom_lora_button, gallery, selected_info, selected_index, prompt]
|
577 |
+
# )
|
578 |
+
# custom_lora_button.click(
|
579 |
+
# remove_custom_lora,
|
580 |
+
# outputs=[custom_lora_info, custom_lora_button, gallery, selected_info, selected_index, custom_lora]
|
581 |
+
# )
|
582 |
gr.on(
|
583 |
triggers=[generate_button.click, prompt.submit],
|
584 |
fn=run_lora,
|