openfree commited on
Commit
0a99393
ยท
verified ยท
1 Parent(s): e25493e

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +64 -57
app.py CHANGED
@@ -715,6 +715,30 @@ input:focus, textarea:focus {
715
  width: 100% !important;
716
  max-width: 100% !important;
717
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
718
  '''
719
 
720
 
@@ -745,65 +769,48 @@ with gr.Blocks(theme=custom_theme, css=css, delete_cache=(60, 3600)) as app:
745
  preview=False
746
  )
747
 
748
-
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
749
 
750
-
751
- with gr.Tab(label="Generate"):
752
- # Prompt and Generate Button
753
- with gr.Row():
754
- with gr.Column(scale=3):
755
- prompt = gr.Textbox(label="Prompt", lines=1, placeholder="Type a prompt after selecting a LoRA")
756
- with gr.Column(scale=1):
757
- generate_button = gr.Button("Generate", variant="primary", elem_classes=["button_total"])
758
-
759
- # LoRA Selection Area
760
- with gr.Row(elem_id="loaded_loras"):
761
- # Randomize Button
762
- with gr.Column(scale=1, min_width=25):
763
- randomize_button = gr.Button("๐ŸŽฒ", variant="secondary", scale=1, elem_id="random_btn")
764
-
765
- # LoRA 1
766
- with gr.Column(scale=8):
767
- with gr.Row():
768
- with gr.Column(scale=0, min_width=50):
769
- 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)
770
- with gr.Column(scale=3, min_width=100):
771
- selected_info_1 = gr.Markdown("Select a LoRA 1")
772
- with gr.Column(scale=5, min_width=50):
773
- lora_scale_1 = gr.Slider(label="LoRA 1 Scale", minimum=0, maximum=3, step=0.01, value=1.15)
774
- with gr.Row():
775
- remove_button_1 = gr.Button("Remove", size="sm")
776
 
777
- # LoRA 2
778
- with gr.Column(scale=8):
779
- with gr.Row():
780
- with gr.Column(scale=0, min_width=50):
781
- 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)
782
- with gr.Column(scale=3, min_width=100):
783
- selected_info_2 = gr.Markdown("Select a LoRA 2")
784
- with gr.Column(scale=5, min_width=50):
785
- lora_scale_2 = gr.Slider(label="LoRA 2 Scale", minimum=0, maximum=3, step=0.01, value=1.15)
786
- with gr.Row():
787
- remove_button_2 = gr.Button("Remove", size="sm")
788
 
789
- # LoRA 3
790
- with gr.Column(scale=8):
791
- with gr.Row():
792
- with gr.Column(scale=0, min_width=50):
793
- 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)
794
- with gr.Column(scale=3, min_width=100):
795
- selected_info_3 = gr.Markdown("Select a LoRA 3")
796
- with gr.Column(scale=5, min_width=50):
797
- lora_scale_3 = gr.Slider(label="LoRA 3 Scale", minimum=0, maximum=3, step=0.01, value=1.15)
798
- with gr.Row():
799
- remove_button_3 = gr.Button("Remove", size="sm")
800
 
801
- # Result and Progress Area
802
- with gr.Column():
803
- progress_bar = gr.Markdown(elem_id="progress", visible=False)
804
- result = gr.Image(label="Generated Image", interactive=False)
805
- with gr.Accordion("History", open=False):
806
- history_gallery = gr.Gallery(label="History", columns=6, object_fit="contain", interactive=False)
807
 
808
  # Advanced Settings
809
  with gr.Row():
@@ -822,8 +829,8 @@ with gr.Blocks(theme=custom_theme, css=css, delete_cache=(60, 3600)) as app:
822
  randomize_seed = gr.Checkbox(True, label="Randomize seed")
823
  seed = gr.Slider(label="Seed", minimum=0, maximum=MAX_SEED, step=1, value=0, randomize=True)
824
 
825
- # Custom LoRA Section
826
- with gr.Column():
827
  with gr.Group():
828
  with gr.Row(elem_id="custom_lora_structure"):
829
  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)
 
715
  width: 100% !important;
716
  max-width: 100% !important;
717
  }
718
+
719
+ /* ํƒญ ์ปจํ…Œ์ด๋„ˆ ์—ฌ๋ฐฑ ์กฐ์ • */
720
+ .tab-content {
721
+ padding: 0 20px !important;
722
+ max-width: 95% !important; /* ์ „์ฒด ๋„ˆ๋น„๋ฅผ 95%๋กœ ์ œํ•œ */
723
+ margin: 0 auto !important;
724
+ }
725
+
726
+ /* ์Šฌ๋ผ์ด๋” ํฌ๊ธฐ ์กฐ์ • */
727
+ .slider-container {
728
+ max-width: 95% !important;
729
+ }
730
+
731
+ /* ๋ฒ„ํŠผ ํฌ๊ธฐ ์กฐ์ • */
732
+ .button_total {
733
+ padding: 8px 15px !important;
734
+ font-size: 0.9em !important;
735
+ }
736
+
737
+ /* ์ž…๋ ฅ ํ•„๋“œ ์—ฌ๋ฐฑ ์กฐ์ • */
738
+ .input-container {
739
+ margin: 5px !important;
740
+ padding: 5px !important;
741
+ }
742
  '''
743
 
744
 
 
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
+ # Result and Progress Area - ์—ฌ๋ฐฑ ์ถ”๊ฐ€
806
+ with gr.Column(scale=1):
807
+ progress_bar = gr.Markdown(elem_id="progress", visible=False)
808
+ result = gr.Image(label="Generated Image", interactive=False)
809
+ with gr.Accordion("History", open=False):
810
+ history_gallery = gr.Gallery(label="History", columns=6, object_fit="contain", interactive=False)
 
 
 
 
 
 
 
 
 
 
 
 
811
 
 
 
 
 
 
 
 
 
 
 
 
812
 
 
 
 
 
 
 
 
 
 
 
 
813
 
 
 
 
 
 
 
814
 
815
  # Advanced Settings
816
  with gr.Row():
 
829
  randomize_seed = gr.Checkbox(True, label="Randomize seed")
830
  seed = gr.Slider(label="Seed", minimum=0, maximum=MAX_SEED, step=1, value=0, randomize=True)
831
 
832
+ # Custom LoRA Section - ์—ฌ๋ฐฑ ์ถ”๊ฐ€
833
+ with gr.Column(scale=1):
834
  with gr.Group():
835
  with gr.Row(elem_id="custom_lora_structure"):
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)