github-actions[bot] commited on
Commit
41138fa
·
1 Parent(s): 182ae9b

Deploy from GitHub - 2026-01-21 08:08:53

Browse files
Files changed (1) hide show
  1. app.py +272 -42
app.py CHANGED
@@ -1801,108 +1801,338 @@ def create_style_blend_output(
1801
 
1802
  custom_css = """
1803
  /* ============================================
1804
- CLEAN LIGHT THEME
 
1805
  ============================================ */
1806
 
1807
- /* Clean light background */
1808
  body {
1809
- background: #FAFAFA;
 
 
1810
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
 
1811
  }
1812
 
1813
- /* Main container */
 
 
 
 
 
 
1814
  .gradio-container {
1815
- max-width: 1200px;
1816
- margin: 0 auto;
 
 
 
 
 
 
 
1817
  }
1818
 
1819
- /* Primary button - clean gradient */
1820
- .gr-button-primary {
1821
- background: linear-gradient(135deg, #6366F1 0%, #8B5CF6 100%) !important;
1822
- border: none !important;
 
 
 
1823
  color: white !important;
1824
  font-weight: 600 !important;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1825
  border-radius: 12px !important;
1826
  transition: all 0.2s ease !important;
1827
  }
1828
 
1829
- .gr-button-primary:hover {
1830
- transform: translateY(-1px);
1831
- box-shadow: 0 4px 12px rgba(99, 102, 241, 0.3) !important;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1832
  }
1833
 
1834
- /* Secondary button */
1835
- .gr-button-secondary {
1836
- background: white !important;
1837
- border: 1px solid #E5E7EB !important;
1838
- color: #1A1A1A !important;
 
 
 
1839
  border-radius: 12px !important;
 
 
 
 
 
 
 
 
 
 
 
1840
  }
1841
 
1842
- .gr-button-secondary:hover {
1843
- background: #F5F5F5 !important;
 
 
 
 
 
1844
  }
1845
 
1846
  /* Slider styling */
1847
  input[type="range"] {
1848
  -webkit-appearance: none;
1849
- background: #E5E7EB;
1850
- border-radius: 4px;
1851
- height: 6px;
 
 
1852
  }
1853
 
1854
  input[type="range"]::-webkit-slider-thumb {
1855
  -webkit-appearance: none;
1856
- width: 18px;
1857
- height: 18px;
1858
- background: white;
1859
- border: 3px solid #6366F1;
1860
  border-radius: 50%;
1861
  cursor: pointer;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1862
  }
1863
 
1864
  /* Badge styles */
1865
  .live-badge {
1866
  display: inline-block;
1867
- padding: 4px 12px;
1868
- background: #FEF3C7;
 
1869
  color: #92400E;
1870
- border-radius: 20px;
1871
- font-size: 12px;
1872
  font-weight: 600;
 
1873
  }
1874
 
1875
  .backend-badge {
1876
  display: inline-block;
1877
- padding: 4px 12px;
1878
- background: #D1FAE5;
 
1879
  color: #065F46;
1880
- border-radius: 20px;
1881
- font-size: 12px;
1882
  font-weight: 600;
 
 
 
 
 
 
1883
  }
1884
 
1885
- /* Scrollbar */
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1886
  ::-webkit-scrollbar {
1887
- width: 8px;
 
 
 
 
 
 
1888
  }
1889
 
1890
  ::-webkit-scrollbar-thumb {
1891
- background: #E5E7EB;
1892
- border-radius: 4px;
 
 
 
 
 
1893
  }
1894
 
1895
- /* Mobile */
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1896
  @media (max-width: 768px) {
1897
  .gradio-container {
1898
- padding: 1rem !important;
 
 
1899
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1900
  }
1901
  """
1902
 
1903
  with gr.Blocks(
1904
  title="StyleForge: Neural Style Transfer",
1905
- theme=gr.themes.Base(
1906
  primary_hue="indigo",
1907
  secondary_hue="purple",
1908
  font=gr.themes.GoogleFont("Inter"),
 
1801
 
1802
  custom_css = """
1803
  /* ============================================
1804
+ LIQUID GLASS / GLASSMORPHISM THEME
1805
+ Gradio 5.x Compatible
1806
  ============================================ */
1807
 
1808
+ /* Animated gradient background */
1809
  body {
1810
+ background: linear-gradient(-45deg, #ee7752, #e73c7e, #23a6d5, #23d5ab);
1811
+ background-size: 400% 400%;
1812
+ animation: gradientBG 15s ease infinite;
1813
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
1814
+ min-height: 100vh;
1815
  }
1816
 
1817
+ @keyframes gradientBG {
1818
+ 0% { background-position: 0% 50%; }
1819
+ 50% { background-position: 100% 50%; }
1820
+ 100% { background-position: 0% 50%; }
1821
+ }
1822
+
1823
+ /* Main app container - glass effect */
1824
  .gradio-container {
1825
+ backdrop-filter: blur(20px) saturate(180%);
1826
+ -webkit-backdrop-filter: blur(20px) saturate(180%);
1827
+ background: rgba(255, 255, 255, 0.75) !important;
1828
+ border-radius: 24px;
1829
+ border: 1px solid rgba(255, 255, 255, 0.3);
1830
+ box-shadow: 0 8px 32px 0 rgba(31, 38, 135, 0.15);
1831
+ max-width: 1400px;
1832
+ margin: 20px auto;
1833
+ padding: 24px !important;
1834
  }
1835
 
1836
+ /* Primary button - gradient with glass shimmer */
1837
+ button.primary,
1838
+ .gr-button-primary,
1839
+ [class*="primary"] {
1840
+ background: linear-gradient(135deg, rgba(99, 102, 241, 0.9) 0%, rgba(139, 92, 246, 0.9) 100%) !important;
1841
+ backdrop-filter: blur(10px);
1842
+ border: 1px solid rgba(255, 255, 255, 0.2) !important;
1843
  color: white !important;
1844
  font-weight: 600 !important;
1845
+ border-radius: 16px !important;
1846
+ padding: 12px 24px !important;
1847
+ transition: all 0.3s ease !important;
1848
+ box-shadow: 0 4px 15px rgba(99, 102, 241, 0.25) !important;
1849
+ position: relative;
1850
+ overflow: hidden;
1851
+ }
1852
+
1853
+ button.primary:hover,
1854
+ .gr-button-primary:hover,
1855
+ [class*="primary"]:hover {
1856
+ transform: translateY(-2px);
1857
+ box-shadow: 0 8px 25px rgba(99, 102, 241, 0.4) !important;
1858
+ }
1859
+
1860
+ button.primary:active,
1861
+ .gr-button-primary:active,
1862
+ [class*="primary"]:active {
1863
+ transform: translateY(0);
1864
+ }
1865
+
1866
+ /* Secondary button - glass style */
1867
+ button.secondary,
1868
+ .gr-button-secondary,
1869
+ .download,
1870
+ [class*="secondary"] {
1871
+ background: rgba(255, 255, 255, 0.6) !important;
1872
+ backdrop-filter: blur(10px);
1873
+ border: 1px solid rgba(255, 255, 255, 0.4) !important;
1874
+ color: #374151 !important;
1875
+ border-radius: 16px !important;
1876
+ padding: 10px 20px !important;
1877
+ transition: all 0.3s ease !important;
1878
+ font-weight: 500 !important;
1879
+ }
1880
+
1881
+ button.secondary:hover,
1882
+ .gr-button-secondary:hover,
1883
+ .download:hover,
1884
+ [class*="secondary"]:hover {
1885
+ background: rgba(255, 255, 255, 0.8) !important;
1886
+ box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1) !important;
1887
+ }
1888
+
1889
+ /* All buttons */
1890
+ button {
1891
  border-radius: 12px !important;
1892
  transition: all 0.2s ease !important;
1893
  }
1894
 
1895
+ /* Tabs - glass style */
1896
+ .tabs {
1897
+ background: rgba(255, 255, 255, 0.4) !important;
1898
+ backdrop-filter: blur(10px);
1899
+ border-radius: 16px !important;
1900
+ padding: 8px !important;
1901
+ border: 1px solid rgba(255, 255, 255, 0.3) !important;
1902
+ }
1903
+
1904
+ /* Tab buttons */
1905
+ button.tab-item {
1906
+ background: transparent !important;
1907
+ border-radius: 12px !important;
1908
+ color: #6B7280 !important;
1909
+ transition: all 0.3s ease !important;
1910
+ }
1911
+
1912
+ button.tab-item:hover {
1913
+ background: rgba(255, 255, 255, 0.5) !important;
1914
+ }
1915
+
1916
+ button.tab-item.selected {
1917
+ background: rgba(255, 255, 255, 0.8) !important;
1918
+ color: #6366F1 !important;
1919
+ font-weight: 600 !important;
1920
+ box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1) !important;
1921
  }
1922
 
1923
+ /* Input boxes and text areas */
1924
+ input[type="text"],
1925
+ input[type="number"],
1926
+ textarea,
1927
+ select {
1928
+ background: rgba(255, 255, 255, 0.7) !important;
1929
+ backdrop-filter: blur(10px);
1930
+ border: 1px solid rgba(255, 255, 255, 0.5) !important;
1931
  border-radius: 12px !important;
1932
+ transition: all 0.3s ease !important;
1933
+ }
1934
+
1935
+ input[type="text"]:focus,
1936
+ input[type="number"]:focus,
1937
+ textarea:focus,
1938
+ select:focus {
1939
+ background: rgba(255, 255, 255, 0.9) !important;
1940
+ border-color: #6366F1 !important;
1941
+ box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1) !important;
1942
+ outline: none !important;
1943
  }
1944
 
1945
+ /* Image containers - glass frame */
1946
+ .image-container,
1947
+ [class*="image"] {
1948
+ border-radius: 16px !important;
1949
+ border: 1px solid rgba(255, 255, 255, 0.3) !important;
1950
+ overflow: hidden !important;
1951
+ background: rgba(255, 255, 255, 0.3) !important;
1952
  }
1953
 
1954
  /* Slider styling */
1955
  input[type="range"] {
1956
  -webkit-appearance: none;
1957
+ background: rgba(229, 231, 235, 0.6);
1958
+ backdrop-filter: blur(10px);
1959
+ border-radius: 8px;
1960
+ height: 8px;
1961
+ border: 1px solid rgba(255, 255, 255, 0.3);
1962
  }
1963
 
1964
  input[type="range"]::-webkit-slider-thumb {
1965
  -webkit-appearance: none;
1966
+ width: 22px;
1967
+ height: 22px;
1968
+ background: linear-gradient(135deg, #6366F1 0%, #8B5CF6 100%);
1969
+ border: 3px solid white;
1970
  border-radius: 50%;
1971
  cursor: pointer;
1972
+ box-shadow: 0 2px 8px rgba(99, 102, 241, 0.4);
1973
+ }
1974
+
1975
+ input[type="range"]::-moz-range-thumb {
1976
+ width: 22px;
1977
+ height: 22px;
1978
+ background: linear-gradient(135deg, #6366F1 0%, #8B5CF6 100%);
1979
+ border: 3px solid white;
1980
+ border-radius: 50%;
1981
+ cursor: pointer;
1982
+ box-shadow: 0 2px 8px rgba(99, 102, 241, 0.4);
1983
+ }
1984
+
1985
+ /* Checkbox and radio styling */
1986
+ input[type="checkbox"],
1987
+ input[type="radio"] {
1988
+ accent-color: #6366F1 !important;
1989
+ width: 18px !important;
1990
+ height: 18px !important;
1991
  }
1992
 
1993
  /* Badge styles */
1994
  .live-badge {
1995
  display: inline-block;
1996
+ padding: 6px 16px;
1997
+ background: rgba(254, 243, 199, 0.8);
1998
+ backdrop-filter: blur(10px);
1999
  color: #92400E;
2000
+ border-radius: 24px;
2001
+ font-size: 13px;
2002
  font-weight: 600;
2003
+ border: 1px solid rgba(255, 255, 255, 0.3);
2004
  }
2005
 
2006
  .backend-badge {
2007
  display: inline-block;
2008
+ padding: 6px 16px;
2009
+ background: rgba(209, 250, 229, 0.8);
2010
+ backdrop-filter: blur(10px);
2011
  color: #065F46;
2012
+ border-radius: 24px;
2013
+ font-size: 13px;
2014
  font-weight: 600;
2015
+ border: 1px solid rgba(255, 255, 255, 0.3);
2016
+ }
2017
+
2018
+ /* Markdown content */
2019
+ .markdown {
2020
+ color: #374151 !important;
2021
  }
2022
 
2023
+ /* Group/Row/Column containers */
2024
+ .group,
2025
+ .row,
2026
+ .column {
2027
+ background: rgba(255, 255, 255, 0.3) !important;
2028
+ border-radius: 16px !important;
2029
+ padding: 16px !important;
2030
+ }
2031
+
2032
+ /* Accordion */
2033
+ .details {
2034
+ background: rgba(255, 255, 255, 0.4) !important;
2035
+ backdrop-filter: blur(10px);
2036
+ border-radius: 16px !important;
2037
+ border: 1px solid rgba(255, 255, 255, 0.3) !important;
2038
+ }
2039
+
2040
+ /* Scrollbar - glass style */
2041
  ::-webkit-scrollbar {
2042
+ width: 10px;
2043
+ height: 10px;
2044
+ }
2045
+
2046
+ ::-webkit-scrollbar-track {
2047
+ background: rgba(229, 231, 235, 0.3);
2048
+ border-radius: 8px;
2049
  }
2050
 
2051
  ::-webkit-scrollbar-thumb {
2052
+ background: rgba(167, 139, 250, 0.5);
2053
+ border-radius: 8px;
2054
+ border: 2px solid rgba(255, 255, 255, 0.3);
2055
+ }
2056
+
2057
+ ::-webkit-scrollbar-thumb:hover {
2058
+ background: rgba(139, 92, 246, 0.7);
2059
  }
2060
 
2061
+ /* Progress bar */
2062
+ progress {
2063
+ background: rgba(229, 231, 235, 0.5) !important;
2064
+ border-radius: 8px !important;
2065
+ height: 8px !important;
2066
+ }
2067
+
2068
+ progress::-webkit-progress-bar {
2069
+ background: rgba(229, 231, 235, 0.5);
2070
+ border-radius: 8px;
2071
+ }
2072
+
2073
+ progress::-webkit-progress-value {
2074
+ background: linear-gradient(90deg, #6366F1, #8B5CF6) !important;
2075
+ border-radius: 8px;
2076
+ }
2077
+
2078
+ /* Mobile responsive */
2079
  @media (max-width: 768px) {
2080
  .gradio-container {
2081
+ margin: 10px !important;
2082
+ padding: 16px !important;
2083
+ border-radius: 20px !important;
2084
  }
2085
+
2086
+ button.primary,
2087
+ .gr-button-primary,
2088
+ [class*="primary"] {
2089
+ padding: 10px 18px !important;
2090
+ font-size: 14px !important;
2091
+ }
2092
+ }
2093
+
2094
+ /* Loading spinner */
2095
+ .spinner {
2096
+ border: 3px solid rgba(99, 102, 241, 0.2);
2097
+ border-top: 3px solid #6366F1;
2098
+ border-radius: 50%;
2099
+ animation: spin 1s linear infinite;
2100
+ }
2101
+
2102
+ @keyframes spin {
2103
+ 0% { transform: rotate(0deg); }
2104
+ 100% { transform: rotate(360deg); }
2105
+ }
2106
+
2107
+ /* Additional Gradio 5.x specific selectors */
2108
+ .gradio-button.primary,
2109
+ button[class*="Primary"],
2110
+ [type="button"].primary {
2111
+ background: linear-gradient(135deg, rgba(99, 102, 241, 0.9) 0%, rgba(139, 92, 246, 0.9) 100%) !important;
2112
+ border: 1px solid rgba(255, 255, 255, 0.2) !important;
2113
+ color: white !important;
2114
+ font-weight: 600 !important;
2115
+ border-radius: 16px !important;
2116
+ box-shadow: 0 4px 15px rgba(99, 102, 241, 0.25) !important;
2117
+ }
2118
+
2119
+ /* Block containers */
2120
+ .block {
2121
+ background: rgba(255, 255, 255, 0.25) !important;
2122
+ border-radius: 16px !important;
2123
+ padding: 12px !important;
2124
+ }
2125
+
2126
+ /* Form elements */
2127
+ .form,
2128
+ .form-group {
2129
+ background: transparent !important;
2130
  }
2131
  """
2132
 
2133
  with gr.Blocks(
2134
  title="StyleForge: Neural Style Transfer",
2135
+ theme=gr.themes.Glass(
2136
  primary_hue="indigo",
2137
  secondary_hue="purple",
2138
  font=gr.themes.GoogleFont("Inter"),