Spaces:
Paused
Paused
Update app.py
Browse files
app.py
CHANGED
@@ -131,9 +131,10 @@ def update_selection(evt: gr.SelectData, selected_indices, loras_state, width, h
|
|
131 |
gr.Warning("You can select up to 3 LoRAs, remove one to select a new one.")
|
132 |
return gr.update(), gr.update(), gr.update(), gr.update(), selected_indices, gr.update(), gr.update(), gr.update(), width, height, gr.update(), gr.update(), gr.update()
|
133 |
|
134 |
-
selected_info_1 = "
|
135 |
-
selected_info_2 = "
|
136 |
-
selected_info_3 = "
|
|
|
137 |
|
138 |
lora_scale_1 = 1.15
|
139 |
lora_scale_2 = 1.15
|
@@ -756,38 +757,51 @@ with gr.Blocks(theme="Nymbo/Nymbo_Theme", css=css, delete_cache=(60, 3600)) as a
|
|
756 |
upscale_result = gr.Image(label="Upscaled Image", type="pil")
|
757 |
upscale_seed_output = gr.Number(label="Seed Used", precision=0)
|
758 |
|
759 |
-
|
760 |
gallery.select(
|
761 |
update_selection,
|
762 |
inputs=[selected_indices, loras_state, width, height],
|
763 |
-
outputs=[prompt, selected_info_1, selected_info_2,selected_info_3, selected_indices, lora_scale_1, lora_scale_2,lora_scale_3, width, height, lora_image_1, lora_image_2,lora_image_3]
|
764 |
)
|
|
|
765 |
remove_button_1.click(
|
766 |
remove_lora_1,
|
767 |
inputs=[selected_indices, loras_state],
|
768 |
-
outputs=[selected_info_1, selected_info_2, selected_indices, lora_scale_1, lora_scale_2, lora_image_1, lora_image_2]
|
769 |
)
|
|
|
770 |
remove_button_2.click(
|
771 |
remove_lora_2,
|
772 |
inputs=[selected_indices, loras_state],
|
773 |
-
outputs=[selected_info_1, selected_info_2, selected_indices, lora_scale_1, lora_scale_2, lora_image_1, lora_image_2]
|
774 |
)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
775 |
randomize_button.click(
|
776 |
randomize_loras,
|
777 |
inputs=[selected_indices, loras_state],
|
778 |
-
outputs=[selected_info_1, selected_info_2, selected_indices, lora_scale_1, lora_scale_2, lora_image_1, lora_image_2, prompt]
|
779 |
)
|
|
|
780 |
add_custom_lora_button.click(
|
781 |
add_custom_lora,
|
782 |
inputs=[custom_lora, selected_indices, loras_state],
|
783 |
-
outputs=[loras_state, gallery, selected_info_1, selected_info_2, selected_indices, lora_scale_1, lora_scale_2, lora_image_1, lora_image_2]
|
784 |
)
|
|
|
785 |
remove_custom_lora_button.click(
|
786 |
remove_custom_lora,
|
787 |
inputs=[selected_indices, loras_state],
|
788 |
-
outputs=[loras_state, gallery, selected_info_1, selected_info_2, selected_indices, lora_scale_1, lora_scale_2, lora_image_1, lora_image_2]
|
789 |
)
|
790 |
|
|
|
|
|
|
|
791 |
gr.on(
|
792 |
triggers=[generate_button.click, prompt.submit],
|
793 |
fn=run_lora,
|
|
|
131 |
gr.Warning("You can select up to 3 LoRAs, remove one to select a new one.")
|
132 |
return gr.update(), gr.update(), gr.update(), gr.update(), selected_indices, gr.update(), gr.update(), gr.update(), width, height, gr.update(), gr.update(), gr.update()
|
133 |
|
134 |
+
selected_info_1 = gr.Markdown("LoRA 1 선택")
|
135 |
+
selected_info_2 = gr.Markdown("LoRA 2 선택")
|
136 |
+
selected_info_3 = gr.Markdown("LoRA 3 선택")
|
137 |
+
|
138 |
|
139 |
lora_scale_1 = 1.15
|
140 |
lora_scale_2 = 1.15
|
|
|
757 |
upscale_result = gr.Image(label="Upscaled Image", type="pil")
|
758 |
upscale_seed_output = gr.Number(label="Seed Used", precision=0)
|
759 |
|
|
|
760 |
gallery.select(
|
761 |
update_selection,
|
762 |
inputs=[selected_indices, loras_state, width, height],
|
763 |
+
outputs=[prompt, selected_info_1, selected_info_2, selected_info_3, selected_indices, lora_scale_1, lora_scale_2, lora_scale_3, width, height, lora_image_1, lora_image_2, lora_image_3]
|
764 |
)
|
765 |
+
|
766 |
remove_button_1.click(
|
767 |
remove_lora_1,
|
768 |
inputs=[selected_indices, loras_state],
|
769 |
+
outputs=[selected_info_1, selected_info_2, selected_info_3, selected_indices, lora_scale_1, lora_scale_2, lora_scale_3, lora_image_1, lora_image_2, lora_image_3]
|
770 |
)
|
771 |
+
|
772 |
remove_button_2.click(
|
773 |
remove_lora_2,
|
774 |
inputs=[selected_indices, loras_state],
|
775 |
+
outputs=[selected_info_1, selected_info_2, selected_info_3, selected_indices, lora_scale_1, lora_scale_2, lora_scale_3, lora_image_1, lora_image_2, lora_image_3]
|
776 |
)
|
777 |
+
|
778 |
+
remove_button_3.click(
|
779 |
+
remove_lora_3,
|
780 |
+
inputs=[selected_indices, loras_state],
|
781 |
+
outputs=[selected_info_1, selected_info_2, selected_info_3, selected_indices, lora_scale_1, lora_scale_2, lora_scale_3, lora_image_1, lora_image_2, lora_image_3]
|
782 |
+
)
|
783 |
+
|
784 |
randomize_button.click(
|
785 |
randomize_loras,
|
786 |
inputs=[selected_indices, loras_state],
|
787 |
+
outputs=[selected_info_1, selected_info_2, selected_info_3, selected_indices, lora_scale_1, lora_scale_2, lora_scale_3, lora_image_1, lora_image_2, lora_image_3, prompt]
|
788 |
)
|
789 |
+
|
790 |
add_custom_lora_button.click(
|
791 |
add_custom_lora,
|
792 |
inputs=[custom_lora, selected_indices, loras_state],
|
793 |
+
outputs=[loras_state, gallery, selected_info_1, selected_info_2, selected_info_3, selected_indices, lora_scale_1, lora_scale_2, lora_scale_3, lora_image_1, lora_image_2, lora_image_3]
|
794 |
)
|
795 |
+
|
796 |
remove_custom_lora_button.click(
|
797 |
remove_custom_lora,
|
798 |
inputs=[selected_indices, loras_state],
|
799 |
+
outputs=[loras_state, gallery, selected_info_1, selected_info_2, selected_info_3, selected_indices, lora_scale_1, lora_scale_2, lora_scale_3, lora_image_1, lora_image_2, lora_image_3]
|
800 |
)
|
801 |
|
802 |
+
|
803 |
+
|
804 |
+
|
805 |
gr.on(
|
806 |
triggers=[generate_button.click, prompt.submit],
|
807 |
fn=run_lora,
|