observantdistressed commited on
Commit
103b8ea
·
verified ·
1 Parent(s): e87beaf

UI: glass v2 — glow blobs via fixed divs, no backdrop-filter on .block, all labels uppercase teal, generate btn above accordion, status text, glass panel wrapper

Browse files
Files changed (1) hide show
  1. app.py +138 -109
app.py CHANGED
@@ -676,42 +676,38 @@ GLASS_CSS = """
676
  overflow: hidden; position: absolute; pointer-events: none;
677
  }
678
 
679
- /* ── BACKGROUND — dark navy with ambient glow blobs ── */
680
- .gradio-container {
681
- background: #0a0e1a !important;
682
- min-height: 100vh !important;
683
- position: relative !important;
684
- overflow-x: hidden !important;
685
- }
686
- /* Ambient glow blobs — positioned behind content */
687
- .gradio-container::before,
688
- .gradio-container::after {
689
- content: "" !important;
690
  position: fixed !important;
691
  border-radius: 50% !important;
692
- filter: blur(120px) !important;
693
  pointer-events: none !important;
694
  z-index: 0 !important;
695
  }
696
- .gradio-container::before {
697
- width: 500px !important; height: 500px !important;
698
- left: -100px !important; top: 30% !important;
699
- background: rgba(0, 201, 167, 0.10) !important;
700
- }
701
- .gradio-container::after {
702
  width: 600px !important; height: 600px !important;
703
- right: -150px !important; top: 10% !important;
704
- background: rgba(168, 85, 247, 0.12) !important;
 
 
 
 
 
705
  }
706
 
707
- /* ── GLASS PANELS ── */
708
- .gradio-container .block {
709
- background: rgba(15, 20, 35, 0.60) !important;
710
- backdrop-filter: blur(20px) !important;
711
- -webkit-backdrop-filter: blur(20px) !important;
712
- border: 1px solid rgba(255, 255, 255, 0.08) !important;
 
 
 
 
713
  border-radius: 16px !important;
714
- box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3) !important;
 
715
  }
716
 
717
  /* ── SECTION LABELS — uppercase teal ── */
@@ -720,30 +716,50 @@ GLASS_CSS = """
720
  font-weight: 700 !important;
721
  text-transform: uppercase !important;
722
  letter-spacing: 1.5px !important;
723
- color: rgba(94, 234, 212, 0.8) !important;
724
  margin-bottom: 8px !important;
 
725
  }
726
 
727
- /* ── TITLE / SUBTITLE — outside glass ── */
728
  .glass-title {
729
  font-size: 28px !important;
730
  font-weight: 700 !important;
731
  color: #ffffff !important;
732
  margin-bottom: 6px !important;
 
733
  }
734
  .glass-subtitle {
735
  font-size: 14px !important;
736
- color: rgba(255, 255, 255, 0.50) !important;
737
- margin-bottom: 20px !important;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
738
  }
739
 
740
  /* ── TEXTAREA — dark transparent ── */
741
  textarea {
742
- background: rgba(0, 0, 0, 0.25) !important;
743
  border: 1px solid rgba(255, 255, 255, 0.10) !important;
744
  border-radius: 10px !important;
745
  color: #e2e8f0 !important;
746
  font-size: 15px !important;
 
747
  }
748
  textarea:focus {
749
  border-color: rgba(94, 234, 212, 0.4) !important;
@@ -751,28 +767,17 @@ textarea:focus {
751
  outline: none !important;
752
  }
753
 
754
- /* ── SLIDERS — teal accent via theme + pseudo-elements ── */
755
- input[data-testid="range-input"]::-webkit-slider-thumb {
756
- -webkit-appearance: none !important;
757
- appearance: none !important;
758
- width: 16px !important; height: 16px !important;
759
- border-radius: 50% !important;
760
- background: #5eead4 !important;
761
- border: 2px solid rgba(255, 255, 255, 0.3) !important;
762
- box-shadow: 0 0 8px rgba(94, 234, 212, 0.4) !important;
763
- cursor: pointer !important;
764
- }
765
- input[data-testid="range-input"]::-moz-range-thumb {
766
- width: 16px !important; height: 16px !important;
767
- border-radius: 50% !important;
768
- background: #5eead4 !important;
769
- border: 2px solid rgba(255, 255, 255, 0.3) !important;
770
- box-shadow: 0 0 8px rgba(94, 234, 212, 0.4) !important;
771
- cursor: pointer !important;
772
  }
773
 
774
  /* ── GENERATE BUTTON — gradient ── */
775
- button.primary, #glass-generate-btn button {
776
  background: linear-gradient(135deg, #00b894, #0984e3, #6c5ce7) !important;
777
  background-size: 200% 200% !important;
778
  animation: glass-shimmer 4s ease-in-out infinite !important;
@@ -787,7 +792,7 @@ button.primary, #glass-generate-btn button {
787
  transition: transform 0.25s ease, box-shadow 0.3s ease !important;
788
  cursor: pointer !important;
789
  }
790
- button.primary:hover, #glass-generate-btn button:hover {
791
  transform: translateY(-2px) !important;
792
  box-shadow: 0 8px 32px rgba(0, 184, 148, 0.5), 0 0 60px rgba(108, 92, 231, 0.25) !important;
793
  }
@@ -801,95 +806,113 @@ input[type="checkbox"] {
801
  accent-color: #5eead4 !important;
802
  }
803
 
804
- /* ── LABELS — light on dark ── */
805
- .gradio-container label {
 
 
806
  color: rgba(255, 255, 255, 0.75) !important;
807
- font-size: 13px !important;
808
- }
809
- .gradio-container .prose small,
810
- .gradio-container small {
811
- color: rgba(255, 255, 255, 0.40) !important;
812
  }
813
-
814
- /* ── DROPDOWNS — dark glass ── */
815
- .gradio-container .dropdown {
816
- background: rgba(10, 14, 30, 0.7) !important;
817
- border: 1px solid rgba(255, 255, 255, 0.10) !important;
818
- border-radius: 8px !important;
819
- color: #e2e8f0 !important;
820
  }
821
 
822
  /* ── ACCORDION — glass header ── */
823
  .gradio-container .label-wrap {
824
- background: rgba(255, 255, 255, 0.03) !important;
825
  border: 1px solid rgba(255, 255, 255, 0.08) !important;
826
  border-radius: 12px !important;
827
  color: rgba(255, 255, 255, 0.75) !important;
828
  font-weight: 600 !important;
 
 
 
829
  }
830
  .gradio-container .label-wrap:hover {
831
  color: #5eead4 !important;
832
  }
833
 
834
- /* ── SECONDARY BUTTON — glass ── */
835
- button.secondary {
836
- background: rgba(255, 255, 255, 0.06) !important;
837
- backdrop-filter: blur(8px) !important;
838
- border: 1px solid rgba(255, 255, 255, 0.10) !important;
839
- color: rgba(255, 255, 255, 0.75) !important;
840
- border-radius: 10px !important;
841
  }
842
- button.secondary:hover {
843
- background: rgba(94, 234, 212, 0.10) !important;
844
- border-color: rgba(94, 234, 212, 0.3) !important;
 
 
 
 
 
 
 
 
 
 
 
845
  color: #5eead4 !important;
846
  }
847
 
848
- /* ── PREVIEW PANEL — right column styling ── */
849
- #preview-panel .block {
850
- min-height: 400px !important;
851
- display: flex !important;
852
- flex-direction: column !important;
853
- justify-content: center !important;
 
854
  }
855
 
856
- /* ── IMAGE UPLOAD — dashed glass ── */
857
- [data-testid="image"] {
858
- border: 2px dashed rgba(255, 255, 255, 0.12) !important;
859
- border-radius: 12px !important;
860
- background: rgba(0, 0, 0, 0.15) !important;
 
 
 
 
861
  }
862
 
863
- /* ── HEADER MARKDOWN — transparent bg ── */
864
  .gradio-container .prose {
865
  background: transparent !important;
866
  }
 
 
 
867
  """
868
 
869
 
870
  with gr.Blocks(delete_cache=(3600, 10800)) as demo:
871
- # ── TITLE & SUBTITLE — outside glass ──
 
 
 
872
  gr.HTML("<div class='glass-title'>Wan 2.2 I2V 14B Lightning — NSFW</div>")
873
  gr.HTML("<div class='glass-subtitle'>Run Wan 2.2 in just 4-8 steps, fp8 quantization & AoT compilation — compatible with diffusers and ZeroGPU</div>")
874
 
875
  with gr.Row(equal_height=False):
876
- # ═══════════════ LEFT COLUMN — INPUTS ═══════════════
877
  with gr.Column(scale=4):
878
- with gr.Group():
879
- gr.HTML("<div class='glass-label'>Prompt</div>")
880
- prompt_input = gr.Textbox(
881
- label="", value=default_prompt_i2v, lines=4,
882
- show_label=False, placeholder="Describe the motion you want...",
883
- )
884
- auto_lora_preview = gr.HTML(
885
- value="", elem_id="auto-lora-preview",
886
- )
887
 
888
- with gr.Group():
889
- input_image_component = gr.Image(
890
- type="pil", label="Input Image",
891
- sources=["upload", "clipboard"],
892
- )
 
 
 
 
 
 
 
 
893
 
894
  with gr.Row():
895
  auto_lora_checkbox = gr.Checkbox(
@@ -903,13 +926,16 @@ with gr.Blocks(delete_cache=(3600, 10800)) as demo:
903
 
904
  duration_seconds_input = gr.Slider(
905
  minimum=MIN_DURATION, maximum=MAX_DURATION,
906
- step=0.1, value=3.5, label="Duration (seconds)",
907
  )
908
  frame_multi = gr.Dropdown(
909
  choices=[FIXED_FPS, FIXED_FPS*2, FIXED_FPS*4, FIXED_FPS*8],
910
  value=FIXED_FPS, label="Fluidity (FPS)",
911
  )
912
 
 
 
 
913
  with gr.Accordion("Advanced Settings", open=False):
914
  last_image_component = gr.Image(
915
  type="pil", label="Last Image (Optional)",
@@ -937,17 +963,20 @@ with gr.Blocks(delete_cache=(3600, 10800)) as demo:
937
  )
938
  play_result_video = gr.Checkbox(label="Display result", value=True, interactive=True)
939
 
940
- with gr.Group(elem_id="glass-generate-btn"):
941
- generate_button = gr.Button("Generate Video", variant="primary")
942
 
943
  # ═══════════════ RIGHT COLUMN — PREVIEW ═══════════════
944
- with gr.Column(scale=6, elem_id="preview-panel"):
945
  gr.HTML("<div class='glass-label'>Preview</div>")
 
946
  video_output = gr.Video(
947
  label="", autoplay=True, sources=["upload"],
948
  buttons=["download", "share"], interactive=True,
949
  elem_id="generated-video",
950
  )
 
 
 
951
  with gr.Row():
952
  grab_frame_btn = gr.Button("Use Current Frame as Input", variant="secondary")
953
  timestamp_box = gr.Number(value=0, label="Timestamp", visible=True, elem_id="hidden-timestamp")
 
676
  overflow: hidden; position: absolute; pointer-events: none;
677
  }
678
 
679
+ /* ── AMBIENT GLOW BLOBS — behind everything ── */
680
+ #glow-teal, #glow-purple {
 
 
 
 
 
 
 
 
 
681
  position: fixed !important;
682
  border-radius: 50% !important;
683
+ filter: blur(140px) !important;
684
  pointer-events: none !important;
685
  z-index: 0 !important;
686
  }
687
+ #glow-teal {
 
 
 
 
 
688
  width: 600px !important; height: 600px !important;
689
+ left: -200px !important; top: 20% !important;
690
+ background: rgba(0, 201, 167, 0.18) !important;
691
+ }
692
+ #glow-purple {
693
+ width: 700px !important; height: 700px !important;
694
+ right: -250px !important; top: 5% !important;
695
+ background: rgba(168, 85, 247, 0.15) !important;
696
  }
697
 
698
+ /* ── BACKGROUND — dark navy ── */
699
+ .gradio-container {
700
+ background: #0a0e1a !important;
701
+ min-height: 100vh !important;
702
+ }
703
+
704
+ /* ── GLASS PANELS — NO backdrop-filter (breaks dropdowns) ── */
705
+ .glass-panel {
706
+ background: rgba(15, 20, 35, 0.65) !important;
707
+ border: 1px solid rgba(255, 255, 255, 0.10) !important;
708
  border-radius: 16px !important;
709
+ box-shadow: 0 8px 32px rgba(0, 0, 0, 0.35) !important;
710
+ padding: 24px !important;
711
  }
712
 
713
  /* ── SECTION LABELS — uppercase teal ── */
 
716
  font-weight: 700 !important;
717
  text-transform: uppercase !important;
718
  letter-spacing: 1.5px !important;
719
+ color: #5eead4 !important;
720
  margin-bottom: 8px !important;
721
+ display: block !important;
722
  }
723
 
724
+ /* ── TITLE / SUBTITLE — float freely on background ── */
725
  .glass-title {
726
  font-size: 28px !important;
727
  font-weight: 700 !important;
728
  color: #ffffff !important;
729
  margin-bottom: 6px !important;
730
+ line-height: 1.2 !important;
731
  }
732
  .glass-subtitle {
733
  font-size: 14px !important;
734
+ color: rgba(255, 255, 255, 0.45) !important;
735
+ margin-bottom: 24px !important;
736
+ line-height: 1.5 !important;
737
+ }
738
+
739
+ /* ── ALL Gradio labels — uppercase teal ── */
740
+ .gradio-container label {
741
+ font-size: 11px !important;
742
+ font-weight: 700 !important;
743
+ text-transform: uppercase !important;
744
+ letter-spacing: 1px !important;
745
+ color: rgba(94, 234, 212, 0.8) !important;
746
+ margin-bottom: 6px !important;
747
+ }
748
+ .gradio-container .prose small,
749
+ .gradio-container small,
750
+ .gradio-container .prose p {
751
+ color: rgba(255, 255, 255, 0.35) !important;
752
+ font-size: 12px !important;
753
  }
754
 
755
  /* ── TEXTAREA — dark transparent ── */
756
  textarea {
757
+ background: rgba(0, 0, 0, 0.30) !important;
758
  border: 1px solid rgba(255, 255, 255, 0.10) !important;
759
  border-radius: 10px !important;
760
  color: #e2e8f0 !important;
761
  font-size: 15px !important;
762
+ padding: 16px !important;
763
  }
764
  textarea:focus {
765
  border-color: rgba(94, 234, 212, 0.4) !important;
 
767
  outline: none !important;
768
  }
769
 
770
+ /* ── NUMBER INPUTS — dark glass ── */
771
+ input[type="number"],
772
+ input[data-testid="number-input"] {
773
+ background: rgba(0, 0, 0, 0.30) !important;
774
+ border: 1px solid rgba(255, 255, 255, 0.10) !important;
775
+ border-radius: 8px !important;
776
+ color: #e2e8f0 !important;
 
 
 
 
 
 
 
 
 
 
 
777
  }
778
 
779
  /* ── GENERATE BUTTON — gradient ── */
780
+ button.primary {
781
  background: linear-gradient(135deg, #00b894, #0984e3, #6c5ce7) !important;
782
  background-size: 200% 200% !important;
783
  animation: glass-shimmer 4s ease-in-out infinite !important;
 
792
  transition: transform 0.25s ease, box-shadow 0.3s ease !important;
793
  cursor: pointer !important;
794
  }
795
+ button.primary:hover {
796
  transform: translateY(-2px) !important;
797
  box-shadow: 0 8px 32px rgba(0, 184, 148, 0.5), 0 0 60px rgba(108, 92, 231, 0.25) !important;
798
  }
 
806
  accent-color: #5eead4 !important;
807
  }
808
 
809
+ /* ── SECONDARY BUTTON — glass ── */
810
+ button.secondary {
811
+ background: rgba(255, 255, 255, 0.06) !important;
812
+ border: 1px solid rgba(255, 255, 255, 0.10) !important;
813
  color: rgba(255, 255, 255, 0.75) !important;
814
+ border-radius: 10px !important;
 
 
 
 
815
  }
816
+ button.secondary:hover {
817
+ background: rgba(94, 234, 212, 0.10) !important;
818
+ border-color: rgba(94, 234, 212, 0.3) !important;
819
+ color: #5eead4 !important;
 
 
 
820
  }
821
 
822
  /* ── ACCORDION — glass header ── */
823
  .gradio-container .label-wrap {
824
+ background: rgba(255, 255, 255, 0.04) !important;
825
  border: 1px solid rgba(255, 255, 255, 0.08) !important;
826
  border-radius: 12px !important;
827
  color: rgba(255, 255, 255, 0.75) !important;
828
  font-weight: 600 !important;
829
+ text-transform: uppercase !important;
830
+ letter-spacing: 1px !important;
831
+ font-size: 12px !important;
832
  }
833
  .gradio-container .label-wrap:hover {
834
  color: #5eead4 !important;
835
  }
836
 
837
+ /* ── IMAGE UPLOAD — dashed glass ── */
838
+ [data-testid="image"] {
839
+ border: 2px dashed rgba(255, 255, 255, 0.12) !important;
840
+ border-radius: 12px !important;
841
+ background: rgba(0, 0, 0, 0.15) !important;
 
 
842
  }
843
+
844
+ /* ── VIDEO / FILE OUTPUT — glass ── */
845
+ [data-testid="video"],
846
+ [data-testid="file"] {
847
+ background: rgba(10, 14, 30, 0.5) !important;
848
+ border: 1px solid rgba(255, 255, 255, 0.08) !important;
849
+ border-radius: 12px !important;
850
+ }
851
+
852
+ /* ── LORA PREVIEW ── */
853
+ #auto-lora-preview {
854
+ color: rgba(255, 255, 255, 0.5) !important;
855
+ }
856
+ #auto-lora-preview b {
857
  color: #5eead4 !important;
858
  }
859
 
860
+ /* ── GLASS CONTAINER for input column ── */
861
+ #input-panel {
862
+ background: rgba(15, 20, 35, 0.65) !important;
863
+ border: 1px solid rgba(255, 255, 255, 0.10) !important;
864
+ border-radius: 16px !important;
865
+ box-shadow: 0 8px 32px rgba(0, 0, 0, 0.35) !important;
866
+ padding: 28px !important;
867
  }
868
 
869
+ /* ── STATUS TEXT under video ── */
870
+ .glass-status {
871
+ color: rgba(255, 255, 255, 0.40) !important;
872
+ font-size: 13px !important;
873
+ text-align: center !important;
874
+ margin-top: 12px !important;
875
+ }
876
+ .glass-status strong {
877
+ color: rgba(255, 255, 255, 0.70) !important;
878
  }
879
 
880
+ /* ── HIDE Gradio defaults we don't need ── */
881
  .gradio-container .prose {
882
  background: transparent !important;
883
  }
884
+ .gradio-container footer {
885
+ display: none !important;
886
+ }
887
  """
888
 
889
 
890
  with gr.Blocks(delete_cache=(3600, 10800)) as demo:
891
+ # ── AMBIENT GLOW BLOBS — fixed behind everything ──
892
+ gr.HTML("<div id='glow-teal'></div><div id='glow-purple'></div>", visible=False)
893
+
894
+ # ── TITLE & SUBTITLE — float freely ──
895
  gr.HTML("<div class='glass-title'>Wan 2.2 I2V 14B Lightning — NSFW</div>")
896
  gr.HTML("<div class='glass-subtitle'>Run Wan 2.2 in just 4-8 steps, fp8 quantization & AoT compilation — compatible with diffusers and ZeroGPU</div>")
897
 
898
  with gr.Row(equal_height=False):
899
+ # ═══════════════ LEFT COLUMN — GLASS INPUT PANEL ═══════════════
900
  with gr.Column(scale=4):
901
+ gr.HTML("<div id='input-panel'><div class='glass-label'>Prompt</div>")
 
 
 
 
 
 
 
 
902
 
903
+ prompt_input = gr.Textbox(
904
+ label="", value=default_prompt_i2v, lines=4,
905
+ show_label=False, placeholder="Describe the motion you want...",
906
+ )
907
+ auto_lora_preview = gr.HTML(
908
+ value="", elem_id="auto-lora-preview",
909
+ )
910
+
911
+ gr.HTML("<div class='glass-label'>Input Image</div>")
912
+ input_image_component = gr.Image(
913
+ type="pil", label="",
914
+ sources=["upload", "clipboard"], show_label=False,
915
+ )
916
 
917
  with gr.Row():
918
  auto_lora_checkbox = gr.Checkbox(
 
926
 
927
  duration_seconds_input = gr.Slider(
928
  minimum=MIN_DURATION, maximum=MAX_DURATION,
929
+ step=0.1, value=3.5, label="Duration",
930
  )
931
  frame_multi = gr.Dropdown(
932
  choices=[FIXED_FPS, FIXED_FPS*2, FIXED_FPS*4, FIXED_FPS*8],
933
  value=FIXED_FPS, label="Fluidity (FPS)",
934
  )
935
 
936
+ # Generate button — above accordion, inside glass panel
937
+ generate_button = gr.Button("Generate Video", variant="primary")
938
+
939
  with gr.Accordion("Advanced Settings", open=False):
940
  last_image_component = gr.Image(
941
  type="pil", label="Last Image (Optional)",
 
963
  )
964
  play_result_video = gr.Checkbox(label="Display result", value=True, interactive=True)
965
 
966
+ gr.HTML("</div>") # close #input-panel
 
967
 
968
  # ═══════════════ RIGHT COLUMN — PREVIEW ═══════════════
969
+ with gr.Column(scale=6):
970
  gr.HTML("<div class='glass-label'>Preview</div>")
971
+
972
  video_output = gr.Video(
973
  label="", autoplay=True, sources=["upload"],
974
  buttons=["download", "share"], interactive=True,
975
  elem_id="generated-video",
976
  )
977
+
978
+ gr.HTML("<div class='glass-status'><strong>Ready to create</strong><br>Upload an image and click Generate</div>")
979
+
980
  with gr.Row():
981
  grab_frame_btn = gr.Button("Use Current Frame as Input", variant="secondary")
982
  timestamp_box = gr.Number(value=0, label="Timestamp", visible=True, elem_id="hidden-timestamp")