Update app.py
Browse files
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 |
-
|
593 |
-
|
594 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
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="๐
|
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 |
# ===== ์ด๋ฒคํธ =====
|