Spaces:
Running on Zero
Running on Zero
UI: minimal gradient theme — elem_id selectors only, no dropdown overrides
Browse files
app.py
CHANGED
|
@@ -670,6 +670,7 @@ def _update_auto_lora_preview(prompt, auto_lora_enabled):
|
|
| 670 |
|
| 671 |
|
| 672 |
CSS = """
|
|
|
|
| 673 |
#hidden-timestamp {
|
| 674 |
opacity: 0;
|
| 675 |
height: 0px;
|
|
@@ -680,6 +681,95 @@ CSS = """
|
|
| 680 |
position: absolute;
|
| 681 |
pointer-events: none;
|
| 682 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 683 |
"""
|
| 684 |
|
| 685 |
|
|
@@ -689,30 +779,33 @@ with gr.Blocks(delete_cache=(3600, 10800)) as demo:
|
|
| 689 |
|
| 690 |
with gr.Row():
|
| 691 |
with gr.Column():
|
| 692 |
-
input_image_component = gr.Image(type="pil", label="Input Image", sources=["upload", "clipboard"])
|
| 693 |
-
prompt_input = gr.Textbox(label="Prompt", value=default_prompt_i2v)
|
| 694 |
auto_lora_checkbox = gr.Checkbox(
|
| 695 |
label="Auto-activate LoRAs from prompt",
|
| 696 |
value=True,
|
| 697 |
interactive=True,
|
| 698 |
info="Automatically detect matching LoRAs from your prompt text (deduplicated by concept).",
|
|
|
|
| 699 |
)
|
| 700 |
auto_lora_preview = gr.HTML(
|
| 701 |
label="Auto-detected LoRAs",
|
| 702 |
value="",
|
| 703 |
elem_id="auto-lora-preview",
|
| 704 |
)
|
| 705 |
-
duration_seconds_input = gr.Slider(minimum=MIN_DURATION, maximum=MAX_DURATION, step=0.1, value=3.5, label="Duration (seconds)", info=f"Clamped to model's {MIN_FRAMES_MODEL}-{MAX_FRAMES_MODEL} frames at {FIXED_FPS}fps.")
|
| 706 |
frame_multi = gr.Dropdown(
|
| 707 |
choices=[FIXED_FPS, FIXED_FPS*2, FIXED_FPS*4, FIXED_FPS*8],
|
| 708 |
value=FIXED_FPS,
|
| 709 |
label="Video Fluidity (Frames per Second)",
|
| 710 |
-
info="Extra frames will be generated using flow estimation, which estimates motion between frames to make the video smoother."
|
|
|
|
| 711 |
)
|
| 712 |
safe_mode_checkbox = gr.Checkbox(
|
| 713 |
label="🛠️ Safe Mode",
|
| 714 |
value=True,
|
| 715 |
-
info="Requests 30% extra processing time to try to prevent unfinished tasks when the server is busy."
|
|
|
|
| 716 |
)
|
| 717 |
with gr.Accordion("Advanced Settings", open=False):
|
| 718 |
last_image_component = gr.Image(type="pil", label="Last Image (Optional)", sources=["upload", "clipboard"])
|
|
@@ -733,7 +826,7 @@ with gr.Blocks(delete_cache=(3600, 10800)) as demo:
|
|
| 733 |
lora_dropdown = gr.Dropdown(choices=lora_loader.get_lora_choices(), label="LoRA (NSFW)", multiselect=True, info="Select scenario LoRAs")
|
| 734 |
play_result_video = gr.Checkbox(label="Display result", value=True, interactive=True)
|
| 735 |
|
| 736 |
-
generate_button = gr.Button("Generate Video", variant="primary")
|
| 737 |
|
| 738 |
with gr.Column():
|
| 739 |
# ASSIGNED elem_id="generated-video" so JS can find it
|
|
|
|
| 670 |
|
| 671 |
|
| 672 |
CSS = """
|
| 673 |
+
/* ── Hidden timestamp (preserved) ── */
|
| 674 |
#hidden-timestamp {
|
| 675 |
opacity: 0;
|
| 676 |
height: 0px;
|
|
|
|
| 681 |
position: absolute;
|
| 682 |
pointer-events: none;
|
| 683 |
}
|
| 684 |
+
|
| 685 |
+
/* ── BACKGROUND — blue→green→purple gradient ── */
|
| 686 |
+
.gradio-container {
|
| 687 |
+
background: linear-gradient(135deg,
|
| 688 |
+
#060a1c 0%, #0e1d5c 12%, #14408f 25%,
|
| 689 |
+
#0a7a4e 40%, #12b367 55%, #1f4fa8 65%,
|
| 690 |
+
#5b2bd0 80%, #33107a 100%) !important;
|
| 691 |
+
background-attachment: fixed !important;
|
| 692 |
+
min-height: 100vh !important;
|
| 693 |
+
}
|
| 694 |
+
|
| 695 |
+
/* ── HEADER — gradient text ── */
|
| 696 |
+
.gradio-container .prose h1,
|
| 697 |
+
.gradio-container .prose h2 {
|
| 698 |
+
background: linear-gradient(90deg, #00e5c8, #6c5ce7, #a855f7) !important;
|
| 699 |
+
-webkit-background-clip: text !important;
|
| 700 |
+
-webkit-text-fill-color: transparent !important;
|
| 701 |
+
background-clip: text !important;
|
| 702 |
+
font-weight: 800 !important;
|
| 703 |
+
}
|
| 704 |
+
|
| 705 |
+
/* ── PROMPT INPUT — glass textarea ── */
|
| 706 |
+
#prompt-input textarea {
|
| 707 |
+
background: rgba(12, 18, 50, 0.8) !important;
|
| 708 |
+
border: 1px solid rgba(100, 180, 255, 0.3) !important;
|
| 709 |
+
border-radius: 10px !important;
|
| 710 |
+
color: #e8ecf4 !important;
|
| 711 |
+
}
|
| 712 |
+
#prompt-input textarea:focus {
|
| 713 |
+
border-color: rgba(108, 92, 231, 0.7) !important;
|
| 714 |
+
box-shadow: 0 0 16px rgba(108, 92, 231, 0.25) !important;
|
| 715 |
+
outline: none !important;
|
| 716 |
+
}
|
| 717 |
+
|
| 718 |
+
/* ── DURATION SLIDER — gradient track ── */
|
| 719 |
+
#duration-slider input[type="range"] {
|
| 720 |
+
accent-color: #00d4aa !important;
|
| 721 |
+
}
|
| 722 |
+
#duration-slider input[type="range"]::-webkit-slider-runnable-track {
|
| 723 |
+
background: linear-gradient(90deg, #00d4aa, #6c5ce7) !important;
|
| 724 |
+
height: 6px !important;
|
| 725 |
+
border-radius: 3px !important;
|
| 726 |
+
}
|
| 727 |
+
#duration-slider input[type="range"]::-webkit-slider-thumb {
|
| 728 |
+
-webkit-appearance: none !important;
|
| 729 |
+
width: 16px !important;
|
| 730 |
+
height: 16px !important;
|
| 731 |
+
border-radius: 50% !important;
|
| 732 |
+
background: linear-gradient(135deg, #00e5c8, #6c5ce7) !important;
|
| 733 |
+
border: 2px solid rgba(255, 255, 255, 0.3) !important;
|
| 734 |
+
box-shadow: 0 0 8px rgba(0, 229, 200, 0.5) !important;
|
| 735 |
+
margin-top: -5px !important;
|
| 736 |
+
cursor: pointer !important;
|
| 737 |
+
}
|
| 738 |
+
|
| 739 |
+
/* ── GENERATE BUTTON — gradient ── */
|
| 740 |
+
#generate-btn button {
|
| 741 |
+
background: linear-gradient(135deg, #00b894, #0984e3, #6c5ce7) !important;
|
| 742 |
+
background-size: 200% 200% !important;
|
| 743 |
+
animation: btn-shimmer 4s ease-in-out infinite !important;
|
| 744 |
+
color: #ffffff !important;
|
| 745 |
+
font-weight: 700 !important;
|
| 746 |
+
border: none !important;
|
| 747 |
+
border-radius: 12px !important;
|
| 748 |
+
padding: 14px 32px !important;
|
| 749 |
+
box-shadow: 0 4px 20px rgba(0, 184, 148, 0.35), 0 0 40px rgba(108, 92, 231, 0.15) !important;
|
| 750 |
+
transition: transform 0.25s ease, box-shadow 0.3s ease !important;
|
| 751 |
+
cursor: pointer !important;
|
| 752 |
+
}
|
| 753 |
+
#generate-btn button:hover {
|
| 754 |
+
transform: translateY(-2px) !important;
|
| 755 |
+
box-shadow: 0 8px 32px rgba(0, 184, 148, 0.5), 0 0 60px rgba(108, 92, 231, 0.25) !important;
|
| 756 |
+
}
|
| 757 |
+
|
| 758 |
+
@keyframes btn-shimmer {
|
| 759 |
+
0%, 100% { background-position: 0% 50%; }
|
| 760 |
+
50% { background-position: 100% 50%; }
|
| 761 |
+
}
|
| 762 |
+
|
| 763 |
+
/* ── CHECKBOXES — teal accent ── */
|
| 764 |
+
#auto-lora-checkbox input[type="checkbox"],
|
| 765 |
+
#safe-mode-checkbox input[type="checkbox"] {
|
| 766 |
+
accent-color: #00d4aa !important;
|
| 767 |
+
}
|
| 768 |
+
|
| 769 |
+
/* ── CARDS — subtle glass ── */
|
| 770 |
+
.gradio-container .block {
|
| 771 |
+
border-radius: 14px !important;
|
| 772 |
+
}
|
| 773 |
"""
|
| 774 |
|
| 775 |
|
|
|
|
| 779 |
|
| 780 |
with gr.Row():
|
| 781 |
with gr.Column():
|
| 782 |
+
input_image_component = gr.Image(type="pil", label="Input Image", sources=["upload", "clipboard"], elem_id="input-image")
|
| 783 |
+
prompt_input = gr.Textbox(label="Prompt", value=default_prompt_i2v, elem_id="prompt-input")
|
| 784 |
auto_lora_checkbox = gr.Checkbox(
|
| 785 |
label="Auto-activate LoRAs from prompt",
|
| 786 |
value=True,
|
| 787 |
interactive=True,
|
| 788 |
info="Automatically detect matching LoRAs from your prompt text (deduplicated by concept).",
|
| 789 |
+
elem_id="auto-lora-checkbox",
|
| 790 |
)
|
| 791 |
auto_lora_preview = gr.HTML(
|
| 792 |
label="Auto-detected LoRAs",
|
| 793 |
value="",
|
| 794 |
elem_id="auto-lora-preview",
|
| 795 |
)
|
| 796 |
+
duration_seconds_input = gr.Slider(minimum=MIN_DURATION, maximum=MAX_DURATION, step=0.1, value=3.5, label="Duration (seconds)", info=f"Clamped to model's {MIN_FRAMES_MODEL}-{MAX_FRAMES_MODEL} frames at {FIXED_FPS}fps.", elem_id="duration-slider")
|
| 797 |
frame_multi = gr.Dropdown(
|
| 798 |
choices=[FIXED_FPS, FIXED_FPS*2, FIXED_FPS*4, FIXED_FPS*8],
|
| 799 |
value=FIXED_FPS,
|
| 800 |
label="Video Fluidity (Frames per Second)",
|
| 801 |
+
info="Extra frames will be generated using flow estimation, which estimates motion between frames to make the video smoother.",
|
| 802 |
+
elem_id="frame-multi",
|
| 803 |
)
|
| 804 |
safe_mode_checkbox = gr.Checkbox(
|
| 805 |
label="🛠️ Safe Mode",
|
| 806 |
value=True,
|
| 807 |
+
info="Requests 30% extra processing time to try to prevent unfinished tasks when the server is busy.",
|
| 808 |
+
elem_id="safe-mode-checkbox",
|
| 809 |
)
|
| 810 |
with gr.Accordion("Advanced Settings", open=False):
|
| 811 |
last_image_component = gr.Image(type="pil", label="Last Image (Optional)", sources=["upload", "clipboard"])
|
|
|
|
| 826 |
lora_dropdown = gr.Dropdown(choices=lora_loader.get_lora_choices(), label="LoRA (NSFW)", multiselect=True, info="Select scenario LoRAs")
|
| 827 |
play_result_video = gr.Checkbox(label="Display result", value=True, interactive=True)
|
| 828 |
|
| 829 |
+
generate_button = gr.Button("Generate Video", variant="primary", elem_id="generate-btn")
|
| 830 |
|
| 831 |
with gr.Column():
|
| 832 |
# ASSIGNED elem_id="generated-video" so JS can find it
|