Spaces:
Paused
Paused
Update app.py
Browse files
app.py
CHANGED
|
@@ -744,207 +744,198 @@ input:focus, textarea:focus {
|
|
| 744 |
}
|
| 745 |
'''
|
| 746 |
|
| 747 |
-
|
| 748 |
with gr.Blocks(theme=custom_theme, css=css, delete_cache=(60, 3600)) as app:
|
| 749 |
-
|
| 750 |
-
|
| 751 |
-
|
| 752 |
-
|
| 753 |
-
|
| 754 |
-
|
| 755 |
-
|
| 756 |
-
|
| 757 |
-
|
| 758 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 759 |
|
| 760 |
-
|
| 761 |
-
|
| 762 |
-
|
| 763 |
-
|
| 764 |
-
|
| 765 |
-
|
| 766 |
-
|
| 767 |
-
|
| 768 |
-
|
| 769 |
-
|
| 770 |
-
|
| 771 |
-
container=True,
|
| 772 |
-
preview=False
|
| 773 |
-
)
|
| 774 |
|
| 775 |
-
|
| 776 |
-
|
| 777 |
-
# Prompt and Generate Button
|
| 778 |
-
with gr.Row():
|
| 779 |
-
with gr.Column(scale=3):
|
| 780 |
-
prompt = gr.Textbox(label="Prompt", lines=1, placeholder="Type a prompt after selecting a LoRA")
|
| 781 |
-
with gr.Column(scale=1):
|
| 782 |
-
generate_button = gr.Button("Generate", variant="primary", elem_classes=["button_total"])
|
| 783 |
-
|
| 784 |
-
# LoRA Selection Area
|
| 785 |
-
with gr.Row(elem_id="loaded_loras"):
|
| 786 |
-
# Randomize Button
|
| 787 |
-
with gr.Column(scale=1, min_width=25):
|
| 788 |
-
randomize_button = gr.Button("๐ฒ", variant="secondary", scale=1, elem_id="random_btn")
|
| 789 |
-
|
| 790 |
-
# LoRA 1
|
| 791 |
-
with gr.Column(scale=8):
|
| 792 |
-
with gr.Row():
|
| 793 |
-
with gr.Column(scale=0, min_width=50):
|
| 794 |
-
lora_image_1 = gr.Image(label="LoRA 1 Image", interactive=False, min_width=50, width=50, show_label=False, show_share_button=False, show_download_button=False, show_fullscreen_button=False, height=50)
|
| 795 |
-
with gr.Column(scale=3, min_width=100):
|
| 796 |
-
selected_info_1 = gr.Markdown("Select a LoRA 1")
|
| 797 |
-
with gr.Column(scale=5, min_width=50):
|
| 798 |
-
lora_scale_1 = gr.Slider(label="LoRA 1 Scale", minimum=0, maximum=3, step=0.01, value=1.15)
|
| 799 |
-
with gr.Row():
|
| 800 |
-
remove_button_1 = gr.Button("Remove", size="sm")
|
| 801 |
-
|
| 802 |
-
# LoRA 2
|
| 803 |
-
with gr.Column(scale=8):
|
| 804 |
-
with gr.Row():
|
| 805 |
-
with gr.Column(scale=0, min_width=50):
|
| 806 |
-
lora_image_2 = gr.Image(label="LoRA 2 Image", interactive=False, min_width=50, width=50, show_label=False, show_share_button=False, show_download_button=False, show_fullscreen_button=False, height=50)
|
| 807 |
-
with gr.Column(scale=3, min_width=100):
|
| 808 |
-
selected_info_2 = gr.Markdown("Select a LoRA 2")
|
| 809 |
-
with gr.Column(scale=5, min_width=50):
|
| 810 |
-
lora_scale_2 = gr.Slider(label="LoRA 2 Scale", minimum=0, maximum=3, step=0.01, value=1.15)
|
| 811 |
-
with gr.Row():
|
| 812 |
-
remove_button_2 = gr.Button("Remove", size="sm")
|
| 813 |
-
|
| 814 |
-
# LoRA 3
|
| 815 |
-
with gr.Column(scale=8):
|
| 816 |
-
with gr.Row():
|
| 817 |
-
with gr.Column(scale=0, min_width=50):
|
| 818 |
-
lora_image_3 = gr.Image(label="LoRA 3 Image", interactive=False, min_width=50, width=50, show_label=False, show_share_button=False, show_download_button=False, show_fullscreen_button=False, height=50)
|
| 819 |
-
with gr.Column(scale=3, min_width=100):
|
| 820 |
-
selected_info_3 = gr.Markdown("Select a LoRA 3")
|
| 821 |
-
with gr.Column(scale=5, min_width=50):
|
| 822 |
-
lora_scale_3 = gr.Slider(label="LoRA 3 Scale", minimum=0, maximum=3, step=0.01, value=1.15)
|
| 823 |
-
with gr.Row():
|
| 824 |
-
remove_button_3 = gr.Button("Remove", size="sm")
|
| 825 |
-
|
| 826 |
-
# Result and Progress Area
|
| 827 |
-
with gr.Column(scale=0.9): # 10% ์ถ์๋ฅผ ์ํด scale ๊ฐ์ 0.9๋ก ์ค์
|
| 828 |
-
progress_bar = gr.Markdown(elem_id="progress", visible=False)
|
| 829 |
-
result = gr.Image(
|
| 830 |
-
label="Generated Image",
|
| 831 |
-
interactive=False,
|
| 832 |
-
elem_classes=["generated-image", "result-container"],
|
| 833 |
-
scale=0.9 # ์ด๋ฏธ์ง ํฌ๊ธฐ๋ 10% ์ถ์
|
| 834 |
-
)
|
| 835 |
-
with gr.Accordion("History", open=False):
|
| 836 |
-
history_gallery = gr.Gallery(
|
| 837 |
-
label="History",
|
| 838 |
-
columns=6,
|
| 839 |
-
object_fit="contain",
|
| 840 |
-
interactive=False,
|
| 841 |
-
elem_classes=["history-gallery"],
|
| 842 |
-
scale=0.9 # ํ์คํ ๋ฆฌ ๊ฐค๋ฌ๋ฆฌ๋ 10% ์ถ์
|
| 843 |
-
)
|
| 844 |
-
|
| 845 |
-
# Advanced Settings
|
| 846 |
-
with gr.Row():
|
| 847 |
-
with gr.Accordion("Advanced Settings", open=False):
|
| 848 |
-
with gr.Row():
|
| 849 |
-
input_image = gr.Image(label="Input image", type="filepath")
|
| 850 |
-
image_strength = gr.Slider(label="Denoise Strength", info="Lower means more image influence", minimum=0.1, maximum=1.0, step=0.01, value=0.75)
|
| 851 |
-
with gr.Column():
|
| 852 |
with gr.Row():
|
| 853 |
-
|
| 854 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
| 855 |
with gr.Row():
|
| 856 |
-
|
| 857 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 858 |
with gr.Row():
|
| 859 |
-
|
| 860 |
-
|
| 861 |
-
|
| 862 |
-
|
| 863 |
-
|
| 864 |
-
|
| 865 |
-
|
| 866 |
-
|
| 867 |
-
|
| 868 |
-
|
| 869 |
-
|
| 870 |
-
|
| 871 |
-
|
| 872 |
-
|
| 873 |
-
|
| 874 |
-
|
| 875 |
-
with gr.
|
| 876 |
-
|
| 877 |
-
|
| 878 |
-
|
| 879 |
-
|
| 880 |
-
|
| 881 |
-
|
| 882 |
-
|
|
|
|
|
|
|
|
|
|
| 883 |
lora_scale_1, lora_scale_2, lora_scale_3, width, height,
|
| 884 |
lora_image_1, lora_image_2, lora_image_3]
|
| 885 |
-
|
| 886 |
|
| 887 |
-
|
| 888 |
-
|
| 889 |
-
|
| 890 |
-
|
| 891 |
lora_scale_1, lora_scale_2, lora_scale_3,
|
| 892 |
lora_image_1, lora_image_2, lora_image_3]
|
| 893 |
-
|
| 894 |
|
| 895 |
-
|
| 896 |
-
|
| 897 |
-
|
| 898 |
-
|
| 899 |
lora_scale_1, lora_scale_2, lora_scale_3,
|
| 900 |
lora_image_1, lora_image_2, lora_image_3]
|
| 901 |
-
|
| 902 |
|
| 903 |
-
|
| 904 |
-
|
| 905 |
-
|
| 906 |
-
|
| 907 |
lora_scale_1, lora_scale_2, lora_scale_3,
|
| 908 |
lora_image_1, lora_image_2, lora_image_3]
|
| 909 |
-
|
| 910 |
|
| 911 |
-
|
| 912 |
-
|
| 913 |
-
|
| 914 |
-
|
| 915 |
lora_scale_1, lora_scale_2, lora_scale_3,
|
| 916 |
lora_image_1, lora_image_2, lora_image_3, prompt]
|
| 917 |
-
|
| 918 |
|
| 919 |
-
|
| 920 |
-
|
| 921 |
-
|
| 922 |
-
|
| 923 |
selected_indices, lora_scale_1, lora_scale_2, lora_scale_3,
|
| 924 |
lora_image_1, lora_image_2, lora_image_3]
|
| 925 |
-
|
| 926 |
|
| 927 |
-
|
| 928 |
-
|
| 929 |
-
|
| 930 |
-
|
| 931 |
selected_indices, lora_scale_1, lora_scale_2, lora_scale_3,
|
| 932 |
lora_image_1, lora_image_2, lora_image_3]
|
| 933 |
-
|
| 934 |
-
|
| 935 |
-
|
| 936 |
-
|
| 937 |
-
|
| 938 |
-
|
| 939 |
-
|
| 940 |
-
|
| 941 |
-
|
| 942 |
-
|
| 943 |
-
|
| 944 |
-
|
| 945 |
-
|
| 946 |
-
|
| 947 |
|
| 948 |
if __name__ == "__main__":
|
| 949 |
-
|
| 950 |
-
|
|
|
|
|
|
| 744 |
}
|
| 745 |
'''
|
| 746 |
|
|
|
|
| 747 |
with gr.Blocks(theme=custom_theme, css=css, delete_cache=(60, 3600)) as app:
|
| 748 |
+
loras_state = gr.State(loras)
|
| 749 |
+
selected_indices = gr.State([])
|
| 750 |
+
|
| 751 |
+
gr.Markdown(
|
| 752 |
+
"""
|
| 753 |
+
# MixGen3: ๋ฉํฐ Lora(์ด๋ฏธ์ง ํ์ต) ํตํฉ ์์ฑ ๋ชจ๋ธ
|
| 754 |
+
### ์ฌ์ฉ ์๋ด:
|
| 755 |
+
๊ฐค๋ฌ๋ฆฌ์์ ์ํ๋ ๋ชจ๋ธ์ ์ ํ(์ต๋ 3๊ฐ๊น์ง) < ํ๋กฌํํธ์ ํ๊ธ ๋๋ ์๋ฌธ์ผ๋ก ์ํ๋ ๋ด์ฉ์ ์
๋ ฅ < Generate ๋ฒํผ ์คํ
|
| 756 |
+
"""
|
| 757 |
+
)
|
| 758 |
+
|
| 759 |
+
with gr.Row(elem_id="lora_gallery", equal_height=True):
|
| 760 |
+
gallery = gr.Gallery(
|
| 761 |
+
value=[(item["image"], item["title"]) for item in loras],
|
| 762 |
+
label="LoRA Explorer Gallery",
|
| 763 |
+
columns=11,
|
| 764 |
+
elem_id="gallery",
|
| 765 |
+
height=800,
|
| 766 |
+
object_fit="cover",
|
| 767 |
+
show_label=True,
|
| 768 |
+
allow_preview=False,
|
| 769 |
+
show_share_button=False,
|
| 770 |
+
container=True,
|
| 771 |
+
preview=False
|
| 772 |
+
)
|
| 773 |
+
|
| 774 |
+
with gr.Tab(label="Generate"):
|
| 775 |
+
# Prompt and Generate Button
|
| 776 |
+
with gr.Row():
|
| 777 |
+
with gr.Column(scale=3):
|
| 778 |
+
prompt = gr.Textbox(label="Prompt", lines=1, placeholder="Type a prompt after selecting a LoRA")
|
| 779 |
+
with gr.Column(scale=1):
|
| 780 |
+
generate_button = gr.Button("Generate", variant="primary", elem_classes=["button_total"])
|
| 781 |
+
|
| 782 |
+
# LoRA Selection Area
|
| 783 |
+
with gr.Row(elem_id="loaded_loras"):
|
| 784 |
+
# Randomize Button
|
| 785 |
+
with gr.Column(scale=1, min_width=25):
|
| 786 |
+
randomize_button = gr.Button("๐ฒ", variant="secondary", scale=1, elem_id="random_btn")
|
| 787 |
+
|
| 788 |
+
# LoRA 1
|
| 789 |
+
with gr.Column(scale=8):
|
| 790 |
+
with gr.Row():
|
| 791 |
+
with gr.Column(scale=0, min_width=50):
|
| 792 |
+
lora_image_1 = gr.Image(label="LoRA 1 Image", interactive=False, min_width=50, width=50, show_label=False, show_share_button=False, show_download_button=False, show_fullscreen_button=False, height=50)
|
| 793 |
+
with gr.Column(scale=3, min_width=100):
|
| 794 |
+
selected_info_1 = gr.Markdown("Select a LoRA 1")
|
| 795 |
+
with gr.Column(scale=5, min_width=50):
|
| 796 |
+
lora_scale_1 = gr.Slider(label="LoRA 1 Scale", minimum=0, maximum=3, step=0.01, value=1.15)
|
| 797 |
+
with gr.Row():
|
| 798 |
+
remove_button_1 = gr.Button("Remove", size="sm")
|
| 799 |
|
| 800 |
+
# LoRA 2
|
| 801 |
+
with gr.Column(scale=8):
|
| 802 |
+
with gr.Row():
|
| 803 |
+
with gr.Column(scale=0, min_width=50):
|
| 804 |
+
lora_image_2 = gr.Image(label="LoRA 2 Image", interactive=False, min_width=50, width=50, show_label=False, show_share_button=False, show_download_button=False, show_fullscreen_button=False, height=50)
|
| 805 |
+
with gr.Column(scale=3, min_width=100):
|
| 806 |
+
selected_info_2 = gr.Markdown("Select a LoRA 2")
|
| 807 |
+
with gr.Column(scale=5, min_width=50):
|
| 808 |
+
lora_scale_2 = gr.Slider(label="LoRA 2 Scale", minimum=0, maximum=3, step=0.01, value=1.15)
|
| 809 |
+
with gr.Row():
|
| 810 |
+
remove_button_2 = gr.Button("Remove", size="sm")
|
|
|
|
|
|
|
|
|
|
| 811 |
|
| 812 |
+
# LoRA 3
|
| 813 |
+
with gr.Column(scale=8):
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 814 |
with gr.Row():
|
| 815 |
+
with gr.Column(scale=0, min_width=50):
|
| 816 |
+
lora_image_3 = gr.Image(label="LoRA 3 Image", interactive=False, min_width=50, width=50, show_label=False, show_share_button=False, show_download_button=False, show_fullscreen_button=False, height=50)
|
| 817 |
+
with gr.Column(scale=3, min_width=100):
|
| 818 |
+
selected_info_3 = gr.Markdown("Select a LoRA 3")
|
| 819 |
+
with gr.Column(scale=5, min_width=50):
|
| 820 |
+
lora_scale_3 = gr.Slider(label="LoRA 3 Scale", minimum=0, maximum=3, step=0.01, value=1.15)
|
| 821 |
with gr.Row():
|
| 822 |
+
remove_button_3 = gr.Button("Remove", size="sm")
|
| 823 |
+
|
| 824 |
+
# Result and Progress Area (10% ์ถ์)
|
| 825 |
+
with gr.Column():
|
| 826 |
+
progress_bar = gr.Markdown(elem_id="progress", visible=False)
|
| 827 |
+
result = gr.Image(
|
| 828 |
+
label="Generated Image",
|
| 829 |
+
interactive=False,
|
| 830 |
+
width="90%", # ๋๋น๋ฅผ 90%๋ก ์ค์ ํ์ฌ 10% ์ถ์
|
| 831 |
+
container=True
|
| 832 |
+
)
|
| 833 |
+
with gr.Accordion("History", open=False):
|
| 834 |
+
history_gallery = gr.Gallery(
|
| 835 |
+
label="History",
|
| 836 |
+
columns=6,
|
| 837 |
+
object_fit="contain",
|
| 838 |
+
interactive=False,
|
| 839 |
+
width="90%" # ๋๋น๋ฅผ 90%๋ก ์ค์ ํ์ฌ 10% ์ถ์
|
| 840 |
+
)
|
| 841 |
+
|
| 842 |
+
# Advanced Settings
|
| 843 |
+
with gr.Row():
|
| 844 |
+
with gr.Accordion("Advanced Settings", open=False):
|
| 845 |
with gr.Row():
|
| 846 |
+
input_image = gr.Image(label="Input image", type="filepath")
|
| 847 |
+
image_strength = gr.Slider(label="Denoise Strength", info="Lower means more image influence", minimum=0.1, maximum=1.0, step=0.01, value=0.75)
|
| 848 |
+
with gr.Column():
|
| 849 |
+
with gr.Row():
|
| 850 |
+
cfg_scale = gr.Slider(label="CFG Scale", minimum=1, maximum=20, step=0.5, value=3.5)
|
| 851 |
+
steps = gr.Slider(label="Steps", minimum=1, maximum=50, step=1, value=28)
|
| 852 |
+
with gr.Row():
|
| 853 |
+
width = gr.Slider(label="Width", minimum=256, maximum=1536, step=64, value=1024)
|
| 854 |
+
height = gr.Slider(label="Height", minimum=256, maximum=1536, step=64, value=1024)
|
| 855 |
+
with gr.Row():
|
| 856 |
+
randomize_seed = gr.Checkbox(True, label="Randomize seed")
|
| 857 |
+
seed = gr.Slider(label="Seed", minimum=0, maximum=MAX_SEED, step=1, value=0, randomize=True)
|
| 858 |
+
|
| 859 |
+
# Custom LoRA Section
|
| 860 |
+
with gr.Column():
|
| 861 |
+
with gr.Group():
|
| 862 |
+
with gr.Row(elem_id="custom_lora_structure"):
|
| 863 |
+
custom_lora = gr.Textbox(label="Custom LoRA", info="LoRA Hugging Face path or *.safetensors public URL", placeholder="ginipick/flux-lora-eric-cat", scale=3, min_width=150)
|
| 864 |
+
add_custom_lora_button = gr.Button("Add Custom LoRA", elem_id="custom_lora_btn", scale=2, min_width=150)
|
| 865 |
+
remove_custom_lora_button = gr.Button("Remove Custom LoRA", visible=False)
|
| 866 |
+
gr.Markdown("[Check the list of FLUX LoRAs](https://huggingface.co/models?other=base_model:adapter:black-forest-labs/FLUX.1-dev)", elem_id="lora_list")
|
| 867 |
+
|
| 868 |
+
# Event Handlers
|
| 869 |
+
gallery.select(
|
| 870 |
+
update_selection,
|
| 871 |
+
inputs=[selected_indices, loras_state, width, height],
|
| 872 |
+
outputs=[prompt, selected_info_1, selected_info_2, selected_info_3, selected_indices,
|
| 873 |
lora_scale_1, lora_scale_2, lora_scale_3, width, height,
|
| 874 |
lora_image_1, lora_image_2, lora_image_3]
|
| 875 |
+
)
|
| 876 |
|
| 877 |
+
remove_button_1.click(
|
| 878 |
+
remove_lora_1,
|
| 879 |
+
inputs=[selected_indices, loras_state],
|
| 880 |
+
outputs=[selected_info_1, selected_info_2, selected_info_3, selected_indices,
|
| 881 |
lora_scale_1, lora_scale_2, lora_scale_3,
|
| 882 |
lora_image_1, lora_image_2, lora_image_3]
|
| 883 |
+
)
|
| 884 |
|
| 885 |
+
remove_button_2.click(
|
| 886 |
+
remove_lora_2,
|
| 887 |
+
inputs=[selected_indices, loras_state],
|
| 888 |
+
outputs=[selected_info_1, selected_info_2, selected_info_3, selected_indices,
|
| 889 |
lora_scale_1, lora_scale_2, lora_scale_3,
|
| 890 |
lora_image_1, lora_image_2, lora_image_3]
|
| 891 |
+
)
|
| 892 |
|
| 893 |
+
remove_button_3.click(
|
| 894 |
+
remove_lora_3,
|
| 895 |
+
inputs=[selected_indices, loras_state],
|
| 896 |
+
outputs=[selected_info_1, selected_info_2, selected_info_3, selected_indices,
|
| 897 |
lora_scale_1, lora_scale_2, lora_scale_3,
|
| 898 |
lora_image_1, lora_image_2, lora_image_3]
|
| 899 |
+
)
|
| 900 |
|
| 901 |
+
randomize_button.click(
|
| 902 |
+
randomize_loras,
|
| 903 |
+
inputs=[selected_indices, loras_state],
|
| 904 |
+
outputs=[selected_info_1, selected_info_2, selected_info_3, selected_indices,
|
| 905 |
lora_scale_1, lora_scale_2, lora_scale_3,
|
| 906 |
lora_image_1, lora_image_2, lora_image_3, prompt]
|
| 907 |
+
)
|
| 908 |
|
| 909 |
+
add_custom_lora_button.click(
|
| 910 |
+
add_custom_lora,
|
| 911 |
+
inputs=[custom_lora, selected_indices, loras_state],
|
| 912 |
+
outputs=[loras_state, gallery, selected_info_1, selected_info_2, selected_info_3,
|
| 913 |
selected_indices, lora_scale_1, lora_scale_2, lora_scale_3,
|
| 914 |
lora_image_1, lora_image_2, lora_image_3]
|
| 915 |
+
)
|
| 916 |
|
| 917 |
+
remove_custom_lora_button.click(
|
| 918 |
+
remove_custom_lora,
|
| 919 |
+
inputs=[selected_indices, loras_state],
|
| 920 |
+
outputs=[loras_state, gallery, selected_info_1, selected_info_2, selected_info_3,
|
| 921 |
selected_indices, lora_scale_1, lora_scale_2, lora_scale_3,
|
| 922 |
lora_image_1, lora_image_2, lora_image_3]
|
| 923 |
+
)
|
| 924 |
+
|
| 925 |
+
gr.on(
|
| 926 |
+
triggers=[generate_button.click, prompt.submit],
|
| 927 |
+
fn=run_lora,
|
| 928 |
+
inputs=[prompt, input_image, image_strength, cfg_scale, steps,
|
| 929 |
+
selected_indices, lora_scale_1, lora_scale_2, lora_scale_3,
|
| 930 |
+
randomize_seed, seed, width, height, loras_state],
|
| 931 |
+
outputs=[result, seed, progress_bar]
|
| 932 |
+
).then(
|
| 933 |
+
fn=lambda x, history: update_history(x, history) if x is not None else history,
|
| 934 |
+
inputs=[result, history_gallery],
|
| 935 |
+
outputs=history_gallery
|
| 936 |
+
)
|
| 937 |
|
| 938 |
if __name__ == "__main__":
|
| 939 |
+
app.queue(max_size=20)
|
| 940 |
+
app.launch(debug=True)
|
| 941 |
+
|