Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
|
@@ -768,75 +768,88 @@ with gr.Blocks(theme=custom_theme, css=css, delete_cache=(60, 3600)) as app:
|
|
| 768 |
container=True,
|
| 769 |
preview=False
|
| 770 |
)
|
| 771 |
-
|
| 772 |
-
with gr.Tab(label="Generate"):
|
| 773 |
-
# Prompt and Generate Button - 비율 조정
|
| 774 |
-
with gr.Row():
|
| 775 |
-
with gr.Column(scale=4): # 3에서 4로 증가
|
| 776 |
-
prompt = gr.Textbox(label="Prompt", lines=1, placeholder="Type a prompt after selecting a LoRA")
|
| 777 |
-
with gr.Column(scale=1):
|
| 778 |
-
generate_button = gr.Button("Generate", variant="primary", elem_classes=["button_total"])
|
| 779 |
-
|
| 780 |
-
# LoRA Selection Area - 비율 조정
|
| 781 |
-
with gr.Row(elem_id="loaded_loras"):
|
| 782 |
-
with gr.Column(scale=1, min_width=20): # min_width 감소
|
| 783 |
-
randomize_button = gr.Button("🎲", variant="secondary", scale=1, elem_id="random_btn")
|
| 784 |
-
|
| 785 |
-
# LoRA 1 - 비율 조정
|
| 786 |
-
with gr.Column(scale=6): # 8에서 6으로 감소
|
| 787 |
-
with gr.Row():
|
| 788 |
-
with gr.Column(scale=0, min_width=40): # min_width 감소
|
| 789 |
-
lora_image_1 = gr.Image(label="LoRA 1 Image", interactive=False, min_width=40, width=40, show_label=False, show_share_button=False, show_download_button=False, show_fullscreen_button=False, height=40)
|
| 790 |
-
with gr.Column(scale=3, min_width=80): # min_width 감소
|
| 791 |
-
selected_info_1 = gr.Markdown("Select a LoRA 1")
|
| 792 |
-
with gr.Column(scale=4, min_width=40): # min_width 감소
|
| 793 |
-
lora_scale_1 = gr.Slider(label="LoRA 1 Scale", minimum=0, maximum=3, step=0.01, value=1.15)
|
| 794 |
-
with gr.Row():
|
| 795 |
-
remove_button_1 = gr.Button("Remove", size="sm")
|
| 796 |
-
|
| 797 |
-
# LoRA 2 - 비율 조정
|
| 798 |
-
with gr.Column(scale=6): # 8에서 6으로 감소
|
| 799 |
-
# (LoRA 2의 내부 구조도 LoRA 1과 동일하게 조정)
|
| 800 |
-
|
| 801 |
-
# LoRA 3 - 비율 조정
|
| 802 |
-
with gr.Column(scale=6): # 8에서 6으로 감소
|
| 803 |
-
# (LoRA 3의 내부 구조도 LoRA 1과 동일하게 조정)
|
| 804 |
|
| 805 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
| 806 |
with gr.Column(scale=1):
|
| 807 |
-
|
| 808 |
-
|
| 809 |
-
|
| 810 |
-
|
| 811 |
-
|
| 812 |
-
|
| 813 |
-
|
| 814 |
-
|
| 815 |
-
|
| 816 |
-
|
| 817 |
-
|
| 818 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 819 |
input_image = gr.Image(label="Input image", type="filepath")
|
| 820 |
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)
|
| 821 |
-
|
| 822 |
with gr.Row():
|
| 823 |
-
|
| 824 |
-
|
| 825 |
with gr.Row():
|
| 826 |
-
|
| 827 |
-
|
| 828 |
with gr.Row():
|
| 829 |
-
|
| 830 |
-
|
| 831 |
|
| 832 |
-
|
| 833 |
-
|
| 834 |
-
|
| 835 |
-
|
| 836 |
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)
|
| 837 |
add_custom_lora_button = gr.Button("Add Custom LoRA", elem_id="custom_lora_btn", scale=2, min_width=150)
|
| 838 |
-
|
| 839 |
-
|
| 840 |
|
| 841 |
|
| 842 |
# Event Handlers
|
|
|
|
| 768 |
container=True,
|
| 769 |
preview=False
|
| 770 |
)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 771 |
|
| 772 |
+
with gr.Tab(label="Generate"):
|
| 773 |
+
# Prompt and Generate Button - 비율 조정
|
| 774 |
+
with gr.Row():
|
| 775 |
+
with gr.Column(scale=4):
|
| 776 |
+
prompt = gr.Textbox(label="Prompt", lines=1, placeholder="Type a prompt after selecting a LoRA")
|
| 777 |
with gr.Column(scale=1):
|
| 778 |
+
generate_button = gr.Button("Generate", variant="primary", elem_classes=["button_total"])
|
| 779 |
+
|
| 780 |
+
# LoRA Selection Area - 비율 조정
|
| 781 |
+
with gr.Row(elem_id="loaded_loras"):
|
| 782 |
+
with gr.Column(scale=1, min_width=20):
|
| 783 |
+
randomize_button = gr.Button("🎲", variant="secondary", scale=1, elem_id="random_btn")
|
| 784 |
+
|
| 785 |
+
# LoRA 1 - 비율 조정
|
| 786 |
+
with gr.Column(scale=6):
|
| 787 |
+
with gr.Row():
|
| 788 |
+
with gr.Column(scale=0, min_width=40):
|
| 789 |
+
lora_image_1 = gr.Image(label="LoRA 1 Image", interactive=False, min_width=40, width=40, show_label=False, show_share_button=False, show_download_button=False, show_fullscreen_button=False, height=40)
|
| 790 |
+
with gr.Column(scale=3, min_width=80):
|
| 791 |
+
selected_info_1 = gr.Markdown("Select a LoRA 1")
|
| 792 |
+
with gr.Column(scale=4, min_width=40):
|
| 793 |
+
lora_scale_1 = gr.Slider(label="LoRA 1 Scale", minimum=0, maximum=3, step=0.01, value=1.15)
|
| 794 |
+
with gr.Row():
|
| 795 |
+
remove_button_1 = gr.Button("Remove", size="sm")
|
| 796 |
+
|
| 797 |
+
# LoRA 2 - 비율 조정
|
| 798 |
+
with gr.Column(scale=6):
|
| 799 |
+
with gr.Row():
|
| 800 |
+
with gr.Column(scale=0, min_width=40):
|
| 801 |
+
lora_image_2 = gr.Image(label="LoRA 2 Image", interactive=False, min_width=40, width=40, show_label=False, show_share_button=False, show_download_button=False, show_fullscreen_button=False, height=40)
|
| 802 |
+
with gr.Column(scale=3, min_width=80):
|
| 803 |
+
selected_info_2 = gr.Markdown("Select a LoRA 2")
|
| 804 |
+
with gr.Column(scale=4, min_width=40):
|
| 805 |
+
lora_scale_2 = gr.Slider(label="LoRA 2 Scale", minimum=0, maximum=3, step=0.01, value=1.15)
|
| 806 |
+
with gr.Row():
|
| 807 |
+
remove_button_2 = gr.Button("Remove", size="sm")
|
| 808 |
+
|
| 809 |
+
# LoRA 3 - 비율 조정
|
| 810 |
+
with gr.Column(scale=6):
|
| 811 |
+
with gr.Row():
|
| 812 |
+
with gr.Column(scale=0, min_width=40):
|
| 813 |
+
lora_image_3 = gr.Image(label="LoRA 3 Image", interactive=False, min_width=40, width=40, show_label=False, show_share_button=False, show_download_button=False, show_fullscreen_button=False, height=40)
|
| 814 |
+
with gr.Column(scale=3, min_width=80):
|
| 815 |
+
selected_info_3 = gr.Markdown("Select a LoRA 3")
|
| 816 |
+
with gr.Column(scale=4, min_width=40):
|
| 817 |
+
lora_scale_3 = gr.Slider(label="LoRA 3 Scale", minimum=0, maximum=3, step=0.01, value=1.15)
|
| 818 |
+
with gr.Row():
|
| 819 |
+
remove_button_3 = gr.Button("Remove", size="sm")
|
| 820 |
+
|
| 821 |
+
# Result and Progress Area
|
| 822 |
+
with gr.Column(scale=1):
|
| 823 |
+
progress_bar = gr.Markdown(elem_id="progress", visible=False)
|
| 824 |
+
result = gr.Image(label="Generated Image", interactive=False)
|
| 825 |
+
with gr.Accordion("History", open=False):
|
| 826 |
+
history_gallery = gr.Gallery(label="History", columns=6, object_fit="contain", interactive=False)
|
| 827 |
+
|
| 828 |
+
# Advanced Settings
|
| 829 |
+
with gr.Row():
|
| 830 |
+
with gr.Accordion("Advanced Settings", open=False):
|
| 831 |
+
with gr.Row():
|
| 832 |
input_image = gr.Image(label="Input image", type="filepath")
|
| 833 |
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)
|
| 834 |
+
with gr.Column():
|
| 835 |
with gr.Row():
|
| 836 |
+
cfg_scale = gr.Slider(label="CFG Scale", minimum=1, maximum=20, step=0.5, value=3.5)
|
| 837 |
+
steps = gr.Slider(label="Steps", minimum=1, maximum=50, step=1, value=28)
|
| 838 |
with gr.Row():
|
| 839 |
+
width = gr.Slider(label="Width", minimum=256, maximum=1536, step=64, value=1024)
|
| 840 |
+
height = gr.Slider(label="Height", minimum=256, maximum=1536, step=64, value=1024)
|
| 841 |
with gr.Row():
|
| 842 |
+
randomize_seed = gr.Checkbox(True, label="Randomize seed")
|
| 843 |
+
seed = gr.Slider(label="Seed", minimum=0, maximum=MAX_SEED, step=1, value=0, randomize=True)
|
| 844 |
|
| 845 |
+
# Custom LoRA Section
|
| 846 |
+
with gr.Column(scale=1):
|
| 847 |
+
with gr.Group():
|
| 848 |
+
with gr.Row(elem_id="custom_lora_structure"):
|
| 849 |
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)
|
| 850 |
add_custom_lora_button = gr.Button("Add Custom LoRA", elem_id="custom_lora_btn", scale=2, min_width=150)
|
| 851 |
+
remove_custom_lora_button = gr.Button("Remove Custom LoRA", visible=False)
|
| 852 |
+
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")
|
| 853 |
|
| 854 |
|
| 855 |
# Event Handlers
|