seawolf2357 commited on
Commit
af31053
ยท
verified ยท
1 Parent(s): cbdb263

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +76 -22
app.py CHANGED
@@ -532,13 +532,58 @@ button.primary:hover {
532
  box-shadow: var(--shadow-secondary);
533
  }
534
 
535
- /* ๋ผ๋ฒจ ํ…์ŠคํŠธ ์ƒ‰์ƒ */
536
  label {
537
  color: #F9FAFB !important;
538
  font-weight: 600 !important;
539
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.5) !important;
540
  }
541
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
542
  /* ๋ผ๋””์˜ค ๋ฒ„ํŠผ ๋ฐ ์ฒดํฌ๋ฐ•์Šค ์Šคํƒ€์ผ */
543
  input[type="radio"], input[type="checkbox"] {
544
  accent-color: var(--color-gold) !important;
@@ -584,14 +629,22 @@ input[type="range"] {
584
  def create_interface():
585
  with gr.Blocks(css=custom_css, analytics_enabled=False) as demo:
586
  gr.HTML('<div class="title">Mr. KIM in KOREA</div>')
587
- gr.HTML('<div class="collection-link"><a href="https://huggingface.co/collections/openfree/painting-art-ai-681453484ec15ef5978bbeb1" target="_blank">Visit the LoRA Model Collection</a></div>')
588
 
589
  with gr.Group(elem_classes="model-description"):
590
  gr.HTML("""
591
  <p>
592
- ๋ณธ ๋ชจ๋ธ์€ ์—ฐ๊ตฌ ๋ชฉ์ ์œผ๋กœ ํŠน์ •์ธ์˜ ์–ผ๊ตด๊ณผ ์™ธ๋ชจ๋ฅผ ํ•™์Šตํ•œ LoRA ๋ชจ๋ธ์ž…๋‹ˆ๋‹ค.<br>
593
- ๋ชฉ์ ์™ธ์˜ ์šฉ๋„๋กœ ๋ฌด๋‹จ ์‚ฌ์šฉ ์•Š๋„๋ก ์œ ์˜ํ•ด ์ฃผ์„ธ์š”.<br>
594
- (์˜ˆ์‹œ prompt ์‚ฌ์šฉ ์‹œ ๋ฐ˜๋“œ์‹œ 'kim'์„ ํฌํ•จํ•˜์—ฌ์•ผ ์ตœ์ ์˜ ๊ฒฐ๊ณผ๋ฅผ ์–ป์„ ์ˆ˜ ์žˆ์Šต๋‹ˆ๋‹ค.)
 
 
 
 
 
 
 
 
595
  </p>
596
  """)
597
 
@@ -600,14 +653,15 @@ def create_interface():
600
  with gr.Row(elem_classes="input-container"):
601
  with gr.Column(scale=4):
602
  user_prompt = gr.Text(
603
- label="Prompt",
604
  max_lines=5,
605
  value=examples[0],
606
- elem_classes="large-prompt"
 
607
  )
608
  with gr.Column(scale=1):
609
  run_button = gr.Button(
610
- "์ƒ์„ฑ",
611
  variant="primary",
612
  elem_classes="small-generate-btn"
613
  )
@@ -615,38 +669,38 @@ def create_interface():
615
  # ํ”„๋กฌํ”„ํŠธ ์ฆ๊ฐ• ์˜ต์…˜ (์ƒ์„ฑ ๋ฒ„ํŠผ ์•„๋ž˜)
616
  with gr.Group(elem_classes="prompt-enhance-section"):
617
  enhance_prompt_checkbox = gr.Checkbox(
618
- label="๐Ÿš€ ํ”„๋กฌํ”„ํŠธ ์ฆ๊ฐ• (AI๋กœ ํ”„๋กฌํ”„ํŠธ๋ฅผ ์ž๏ฟฝ๏ฟฝ๏ฟฝ์œผ๋กœ ๊ฐœ์„ ํ•˜์—ฌ ๊ณ ํ’ˆ์งˆ ์ด๋ฏธ์ง€ ์ƒ์„ฑ)",
619
  value=False,
620
- info="OpenAI API๋ฅผ ์‚ฌ์šฉํ•˜์—ฌ ์ž…๋ ฅํ•œ ํ”„๋กฌํ”„ํŠธ๋ฅผ ๋”์šฑ ์ƒ์„ธํ•˜๊ณ  ๊ณ ํ’ˆ์งˆ์˜ ์ด๋ฏธ์ง€๋ฅผ ์ƒ์„ฑํ•  ์ˆ˜ ์žˆ๋„๋ก ์ž๋™์œผ๋กœ ์ฆ๊ฐ•ํ•ฉ๋‹ˆ๋‹ค."
621
  )
622
 
623
  # ์Šคํƒ€์ผ ํ”„๋ฆฌ์…‹ ์„น์…˜
624
  with gr.Group(elem_classes="style-preset-section"):
625
  style_select = gr.Radio(
626
- label="๐ŸŽจ Style Preset",
627
  choices=list(STYLE_PRESETS.keys()),
628
  value="None",
629
  interactive=True
630
  )
631
 
632
- result_image = gr.Image(label="Generated Image")
633
- seed_output = gr.Number(label="Seed")
634
 
635
  # ===== ๊ณ ๊ธ‰ ์„ค์ • =====
636
- with gr.Accordion("Advanced Settings", open=False, elem_classes="advanced-settings"):
637
- seed = gr.Slider(label="Seed", minimum=0, maximum=MAX_SEED, step=1, value=42)
638
- randomize_seed = gr.Checkbox(label="Randomize seed", value=True)
639
  with gr.Row():
640
- width = gr.Slider(label="Width", minimum=256, maximum=MAX_IMAGE_SIZE, step=32, value=1024)
641
- height = gr.Slider(label="Height", minimum=256, maximum=MAX_IMAGE_SIZE, step=32, value=768)
642
  with gr.Row():
643
- guidance_scale = gr.Slider(label="Guidance scale", minimum=0.0, maximum=10.0, step=0.1, value=3.5)
644
- num_inference_steps = gr.Slider(label="Inference steps", minimum=1, maximum=50, step=1, value=30)
645
- lora_scale = gr.Slider(label="LoRA scale", minimum=0.0, maximum=1.0, step=0.1, value=1.0)
646
 
647
  # ===== ์˜ˆ์‹œ ์˜์—ญ =====
648
  with gr.Group(elem_classes="example-region"):
649
- gr.Markdown("### Examples")
650
  gr.Examples(examples=examples, inputs=user_prompt, cache_examples=False)
651
 
652
  # ===== ์ด๋ฒคํŠธ =====
 
532
  box-shadow: var(--shadow-secondary);
533
  }
534
 
535
+ /* ๋ผ๋ฒจ ํ…์ŠคํŠธ ์ƒ‰์ƒ ๋ฐ ํ•œ๊ธ€ ์ž‘์€ ๊ธ€์ž ์Šคํƒ€์ผ */
536
  label {
537
  color: #F9FAFB !important;
538
  font-weight: 600 !important;
539
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.5) !important;
540
  }
541
 
542
+ /* ํ•œ๊ธ€ ๋ถ€๋ถ„์„ ์ž‘๊ฒŒ ํ‘œ์‹œํ•˜๋Š” ์Šคํƒ€์ผ */
543
+ label::after {
544
+ font-size: 0.8em !important;
545
+ opacity: 0.8 !important;
546
+ font-weight: 400 !important;
547
+ }
548
+
549
+ /* ์ฒดํฌ๋ฐ•์Šค์™€ ๋ผ๋””์˜ค ๋ฒ„ํŠผ ๋ผ๋ฒจ์˜ ํ•œ๊ธ€ ๋ถ€๋ถ„ ์ž‘๊ฒŒ */
550
+ .gradio-checkbox label,
551
+ .gradio-radio label {
552
+ font-size: 1rem !important;
553
+ }
554
+
555
+ /* ์ •๋ณด ํ…์ŠคํŠธ ์Šคํƒ€์ผ */
556
+ .gr-info, .gr-textbox-info {
557
+ color: rgba(255, 255, 255, 0.8) !important;
558
+ font-size: 0.85rem !important;
559
+ font-style: italic !important;
560
+ text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3) !important;
561
+ line-height: 1.4 !important;
562
+ }
563
+
564
+ /* placeholder ํ…์ŠคํŠธ ์Šคํƒ€์ผ */
565
+ .large-prompt textarea::placeholder {
566
+ color: rgba(255, 255, 255, 0.5) !important;
567
+ font-style: italic !important;
568
+ }
569
+
570
+ /* ์Šฌ๋ผ์ด๋” ๋ผ๋ฒจ์˜ ํ•œ๊ธ€ ๋ถ€๋ถ„ ์Šคํƒ€์ผ๋ง */
571
+ .gr-block.gr-box .gr-form .gr-form-gap .gr-form-gap label {
572
+ font-size: 0.95rem !important;
573
+ }
574
+
575
+ /* ์•„์ฝ”๋””์–ธ ํ—ค๋”์˜ ํ•œ๊ธ€ ๋ถ€๋ถ„ ์ž‘๊ฒŒ */
576
+ .gr-accordion .gr-accordion-header {
577
+ font-size: 1.1rem !important;
578
+ }
579
+
580
+ /* ์˜ˆ์‹œ ๋งˆํฌ๋‹ค์šด์˜ ํ•œ๊ธ€ ๋ถ€๋ถ„ ์ž‘๊ฒŒ */
581
+ .example-region h3 {
582
+ color: #F9FAFB !important;
583
+ font-weight: 600 !important;
584
+ text-shadow: 0 1px 2px rgba(0, 0, 0, 0.5) !important;
585
+ }
586
+
587
  /* ๋ผ๋””์˜ค ๋ฒ„ํŠผ ๋ฐ ์ฒดํฌ๋ฐ•์Šค ์Šคํƒ€์ผ */
588
  input[type="radio"], input[type="checkbox"] {
589
  accent-color: var(--color-gold) !important;
 
629
  def create_interface():
630
  with gr.Blocks(css=custom_css, analytics_enabled=False) as demo:
631
  gr.HTML('<div class="title">Mr. KIM in KOREA</div>')
632
+ gr.HTML('<div class="collection-link"><a href="https://huggingface.co/collections/openfree/painting-art-ai-681453484ec15ef5978bbeb1" target="_blank">Visit the LoRA Model Collection (LoRA ๋ชจ๋ธ ์ปฌ๋ ‰์…˜ ๋ฐฉ๋ฌธ)</a></div>')
633
 
634
  with gr.Group(elem_classes="model-description"):
635
  gr.HTML("""
636
  <p>
637
+ <strong>Research Purpose Model (์—ฐ๊ตฌ ๋ชฉ์  ๋ชจ๋ธ)</strong><br>
638
+ This model is trained on specific person's facial features and appearance using LoRA technology for research purposes.<br>
639
+ <small style="opacity: 0.8;">๋ณธ ๋ชจ๋ธ์€ ์—ฐ๊ตฌ ๋ชฉ์ ์œผ๋กœ ํŠน์ •์ธ์˜ ์–ผ๊ตด๊ณผ ์™ธ๋ชจ๋ฅผ LoRA ๊ธฐ์ˆ ๋กœ ํ•™์Šตํ•œ ๋ชจ๋ธ์ž…๋‹ˆ๋‹ค.</small><br><br>
640
+
641
+ <strong>Usage Guidelines (์‚ฌ์šฉ ๊ฐ€์ด๋“œ๋ผ์ธ)</strong><br>
642
+ Please ensure appropriate use and avoid unauthorized usage beyond research purposes.<br>
643
+ <small style="opacity: 0.8;">๋ชฉ์  ์™ธ์˜ ์šฉ๋„๋กœ ๋ฌด๋‹จ ์‚ฌ์šฉํ•˜์ง€ ์•Š๋„๋ก ์œ ์˜ํ•ด ์ฃผ์„ธ์š”.</small><br><br>
644
+
645
+ <strong>Optimal Results (์ตœ์  ๊ฒฐ๊ณผ๋ฅผ ์œ„ํ•œ ํŒ)</strong><br>
646
+ For best results, make sure to include 'kim' in your example prompts.<br>
647
+ <small style="opacity: 0.8;">์ตœ์ ์˜ ๊ฒฐ๊ณผ๋ฅผ ์–ป๊ธฐ ์œ„ํ•ด ์˜ˆ์‹œ ํ”„๋กฌํ”„ํŠธ ์‚ฌ์šฉ ์‹œ ๋ฐ˜๋“œ์‹œ 'kim'์„ ํฌํ•จํ•˜์—ฌ ์ฃผ์„ธ์š”.</small>
648
  </p>
649
  """)
650
 
 
653
  with gr.Row(elem_classes="input-container"):
654
  with gr.Column(scale=4):
655
  user_prompt = gr.Text(
656
+ label="Prompt (ํ”„๋กฌํ”„ํŠธ)",
657
  max_lines=5,
658
  value=examples[0],
659
+ elem_classes="large-prompt",
660
+ placeholder="Enter your image description here... (์ด๋ฏธ์ง€ ์„ค๋ช…์„ ์ž…๋ ฅํ•˜์„ธ์š”...)"
661
  )
662
  with gr.Column(scale=1):
663
  run_button = gr.Button(
664
+ "Generate (์ƒ์„ฑ)",
665
  variant="primary",
666
  elem_classes="small-generate-btn"
667
  )
 
669
  # ํ”„๋กฌํ”„ํŠธ ์ฆ๊ฐ• ์˜ต์…˜ (์ƒ์„ฑ ๋ฒ„ํŠผ ์•„๋ž˜)
670
  with gr.Group(elem_classes="prompt-enhance-section"):
671
  enhance_prompt_checkbox = gr.Checkbox(
672
+ label="๐Ÿš€ Prompt Enhancement (ํ”„๋กฌํ”„ํŠธ ์ฆ๊ฐ•)",
673
  value=False,
674
+ info="Automatically improve your prompt using OpenAI API for high-quality image generation (OpenAI API๋ฅผ ์‚ฌ์šฉํ•˜์—ฌ ๊ณ ํ’ˆ์งˆ ์ด๋ฏธ์ง€ ์ƒ์„ฑ์„ ์œ„ํ•ด ํ”„๋กฌํ”„ํŠธ๋ฅผ ์ž๋™์œผ๋กœ ๊ฐœ์„ ํ•ฉ๋‹ˆ๋‹ค)"
675
  )
676
 
677
  # ์Šคํƒ€์ผ ํ”„๋ฆฌ์…‹ ์„น์…˜
678
  with gr.Group(elem_classes="style-preset-section"):
679
  style_select = gr.Radio(
680
+ label="๐ŸŽจ Style Preset (์Šคํƒ€์ผ ํ”„๋ฆฌ์…‹)",
681
  choices=list(STYLE_PRESETS.keys()),
682
  value="None",
683
  interactive=True
684
  )
685
 
686
+ result_image = gr.Image(label="Generated Image (์ƒ์„ฑ๋œ ์ด๋ฏธ์ง€)")
687
+ seed_output = gr.Number(label="Seed (์‹œ๋“œ๊ฐ’)")
688
 
689
  # ===== ๊ณ ๊ธ‰ ์„ค์ • =====
690
+ with gr.Accordion("Advanced Settings (๊ณ ๊ธ‰ ์„ค์ •)", open=False, elem_classes="advanced-settings"):
691
+ seed = gr.Slider(label="Seed (์‹œ๋“œ๊ฐ’)", minimum=0, maximum=MAX_SEED, step=1, value=42)
692
+ randomize_seed = gr.Checkbox(label="Randomize seed (์‹œ๋“œ๊ฐ’ ๋ฌด์ž‘์œ„)", value=True)
693
  with gr.Row():
694
+ width = gr.Slider(label="Width (๊ฐ€๋กœ)", minimum=256, maximum=MAX_IMAGE_SIZE, step=32, value=1024)
695
+ height = gr.Slider(label="Height (์„ธ๋กœ)", minimum=256, maximum=MAX_IMAGE_SIZE, step=32, value=768)
696
  with gr.Row():
697
+ guidance_scale = gr.Slider(label="Guidance scale (๊ฐ€์ด๋˜์Šค ์Šค์ผ€์ผ)", minimum=0.0, maximum=10.0, step=0.1, value=3.5)
698
+ num_inference_steps = gr.Slider(label="Inference steps (์ถ”๋ก  ๋‹จ๊ณ„)", minimum=1, maximum=50, step=1, value=30)
699
+ lora_scale = gr.Slider(label="LoRA scale (LoRA ์Šค์ผ€์ผ)", minimum=0.0, maximum=1.0, step=0.1, value=1.0)
700
 
701
  # ===== ์˜ˆ์‹œ ์˜์—ญ =====
702
  with gr.Group(elem_classes="example-region"):
703
+ gr.Markdown("### Examples (์˜ˆ์‹œ)")
704
  gr.Examples(examples=examples, inputs=user_prompt, cache_examples=False)
705
 
706
  # ===== ์ด๋ฒคํŠธ =====