github-actions[bot] commited on
Commit
1644d98
·
1 Parent(s): 9ffa510

Deploy from GitHub - 2026-01-21 04:24:03

Browse files
Files changed (1) hide show
  1. app.py +26 -347
app.py CHANGED
@@ -1733,123 +1733,52 @@ def create_style_blend_output(
1733
 
1734
  custom_css = """
1735
  /* ============================================
1736
- PORTAL-INSPIRED CLEAN LIGHT THEME
1737
  ============================================ */
1738
 
1739
- /* Root variables for clean light theme */
1740
- :root {
1741
- --bg-primary: #FAFAFA;
1742
- --bg-secondary: #FFFFFF;
1743
- --bg-tertiary: #F5F5F5;
1744
- --text-primary: #1A1A1A;
1745
- --text-secondary: #6B7280;
1746
- --text-tertiary: #9CA3AF;
1747
- --border-color: #E5E7EB;
1748
- --border-light: #F3F4F6;
1749
- --accent-primary: #6366F1;
1750
- --accent-secondary: #8B5CF6;
1751
- --accent-gradient: linear-gradient(135deg, #6366F1 0%, #8B5CF6 100%);
1752
- --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
1753
- --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
1754
- --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
1755
- --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
1756
- --radius-sm: 8px;
1757
- --radius-md: 12px;
1758
- --radius-lg: 16px;
1759
- --radius-xl: 24px;
1760
- }
1761
-
1762
  /* Clean light background */
1763
  body {
1764
- background: var(--bg-primary);
1765
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
1766
- min-height: 100vh;
1767
- color: var(--text-primary);
1768
  }
1769
 
1770
- /* Main container - clean and minimal */
1771
  .gradio-container {
1772
  max-width: 1200px;
1773
  margin: 0 auto;
1774
- background: transparent !important;
1775
- border: none !important;
1776
- box-shadow: none !important;
1777
- padding: 2rem 1.5rem !important;
1778
- }
1779
-
1780
- /* Clean card style for components */
1781
- .gr-box {
1782
- background: var(--bg-secondary) !important;
1783
- border: 1px solid var(--border-color) !important;
1784
- border-radius: var(--radius-lg) !important;
1785
- box-shadow: var(--shadow-sm) !important;
1786
- }
1787
-
1788
- .gr-image-container {
1789
- border-radius: var(--radius-md) !important;
1790
- overflow: hidden;
1791
- border: 1px solid var(--border-color) !important;
1792
- background: var(--bg-secondary) !important;
1793
  }
1794
 
1795
- /* Primary button - clean, modern style */
1796
  .gr-button-primary {
1797
- background: var(--accent-gradient) !important;
1798
  border: none !important;
1799
  color: white !important;
1800
  font-weight: 600 !important;
1801
- font-size: 14px !important;
1802
- border-radius: var(--radius-md) !important;
1803
- padding: 12px 24px !important;
1804
  transition: all 0.2s ease !important;
1805
- box-shadow: var(--shadow-md) !important;
1806
  }
1807
 
1808
  .gr-button-primary:hover {
1809
  transform: translateY(-1px);
1810
- box-shadow: var(--shadow-lg) !important;
1811
- filter: brightness(1.05);
1812
  }
1813
 
1814
- .gr-button-primary:active {
1815
- transform: translateY(0);
1816
- }
1817
-
1818
- /* Secondary button - clean outline style */
1819
  .gr-button-secondary {
1820
- background: var(--bg-secondary) !important;
1821
- border: 1px solid var(--border-color) !important;
1822
- color: var(--text-primary) !important;
1823
- font-weight: 500 !important;
1824
- border-radius: var(--radius-md) !important;
1825
- transition: all 0.2s ease !important;
1826
- box-shadow: var(--shadow-sm) !important;
1827
  }
1828
 
1829
  .gr-button-secondary:hover {
1830
- background: var(--bg-tertiary) !important;
1831
- border-color: var(--border-color) !important;
1832
  }
1833
 
1834
- /* Dropdown styling - clean and minimal */
1835
- .gr-dropdown {
1836
- background: var(--bg-secondary) !important;
1837
- border: 1px solid var(--border-color) !important;
1838
- border-radius: var(--radius-md) !important;
1839
- color: var(--text-primary) !important;
1840
- }
1841
-
1842
- .gr-dropdown-options {
1843
- background: var(--bg-secondary) !important;
1844
- border: 1px solid var(--border-color) !important;
1845
- border-radius: var(--radius-md) !important;
1846
- box-shadow: var(--shadow-lg) !important;
1847
- }
1848
-
1849
- /* Slider styling - clean modern look */
1850
  input[type="range"] {
1851
  -webkit-appearance: none;
1852
- background: var(--bg-tertiary);
1853
  border-radius: 4px;
1854
  height: 6px;
1855
  }
@@ -1858,114 +1787,13 @@ input[type="range"]::-webkit-slider-thumb {
1858
  -webkit-appearance: none;
1859
  width: 18px;
1860
  height: 18px;
1861
- background: var(--bg-secondary);
1862
- border: 3px solid var(--accent-primary);
1863
  border-radius: 50%;
1864
  cursor: pointer;
1865
- box-shadow: var(--shadow-md);
1866
- transition: all 0.2s ease;
1867
- }
1868
-
1869
- input[type="range"]::-webkit-slider-thumb:hover {
1870
- transform: scale(1.1);
1871
- box-shadow: var(--shadow-lg);
1872
- }
1873
-
1874
- /* Radio buttons - clean style */
1875
- .gr-radio {
1876
- background: var(--bg-secondary) !important;
1877
- border: 1px solid var(--border-color) !important;
1878
- border-radius: var(--radius-md) !important;
1879
- padding: 12px !important;
1880
- }
1881
-
1882
- .gr-radio:hover {
1883
- background: var(--bg-tertiary) !important;
1884
- }
1885
-
1886
- /* Tab styling - minimal pill style */
1887
- .tabs {
1888
- background: var(--bg-tertiary) !important;
1889
- border-radius: var(--radius-lg) !important;
1890
- border: none !important;
1891
- padding: 6px !important;
1892
- gap: 4px !important;
1893
  }
1894
 
1895
- .tab-item {
1896
- background: transparent !important;
1897
- border-radius: var(--radius-md) !important;
1898
- transition: all 0.2s ease !important;
1899
- color: var(--text-secondary) !important;
1900
- font-weight: 500 !important;
1901
- padding: 10px 18px !important;
1902
- }
1903
-
1904
- .tab-item:hover {
1905
- background: var(--bg-secondary) !important;
1906
- color: var(--text-primary) !important;
1907
- }
1908
-
1909
- .tab-item.selected {
1910
- background: var(--bg-secondary) !important;
1911
- color: var(--text-primary) !important;
1912
- box-shadow: var(--shadow-sm) !important;
1913
- font-weight: 600 !important;
1914
- }
1915
-
1916
- /* Accordion styling - clean */
1917
- details {
1918
- background: var(--bg-secondary) !important;
1919
- border: 1px solid var(--border-color) !important;
1920
- border-radius: var(--radius-md) !important;
1921
- overflow: hidden;
1922
- }
1923
-
1924
- summary {
1925
- background: transparent !important;
1926
- border-radius: var(--radius-md) !important;
1927
- padding: 16px !important;
1928
- cursor: pointer;
1929
- transition: all 0.2s ease;
1930
- color: var(--text-primary) !important;
1931
- font-weight: 500 !important;
1932
- }
1933
-
1934
- summary:hover {
1935
- background: var(--bg-tertiary) !important;
1936
- }
1937
-
1938
- /* Headings - clean typography */
1939
- h1 {
1940
- text-align: center;
1941
- color: var(--text-primary) !important;
1942
- background: var(--accent-gradient);
1943
- -webkit-background-clip: text;
1944
- -webkit-text-fill-color: transparent;
1945
- background-clip: text;
1946
- font-weight: 700;
1947
- font-size: 2.5rem;
1948
- letter-spacing: -0.03em;
1949
- margin-bottom: 0.5rem;
1950
- }
1951
-
1952
- h2, h3 {
1953
- color: var(--text-primary) !important;
1954
- font-weight: 600 !important;
1955
- letter-spacing: -0.02em;
1956
- }
1957
-
1958
- /* Markdown text color */
1959
- .markdown {
1960
- color: var(--text-secondary) !important;
1961
- }
1962
-
1963
- .markdown strong {
1964
- color: var(--text-primary) !important;
1965
- font-weight: 600;
1966
- }
1967
-
1968
- /* Badge styles - clean pill design */
1969
  .live-badge {
1970
  display: inline-block;
1971
  padding: 4px 12px;
@@ -1974,7 +1802,6 @@ h2, h3 {
1974
  border-radius: 20px;
1975
  font-size: 12px;
1976
  font-weight: 600;
1977
- border: 1px solid #FDE68A;
1978
  }
1979
 
1980
  .backend-badge {
@@ -1985,171 +1812,23 @@ h2, h3 {
1985
  border-radius: 20px;
1986
  font-size: 12px;
1987
  font-weight: 600;
1988
- border: 1px solid #A7F3D0;
1989
- }
1990
-
1991
- /* Checkbox styling */
1992
- .gr-checkbox {
1993
- background: var(--bg-secondary) !important;
1994
- border: 1px solid var(--border-color) !important;
1995
- border-radius: 6px !important;
1996
- }
1997
-
1998
- /* Text input / Textbox */
1999
- .gr-textbox, .gr-text-input {
2000
- background: var(--bg-secondary) !important;
2001
- border: 1px solid var(--border-color) !important;
2002
- border-radius: var(--radius-md) !important;
2003
- color: var(--text-primary) !important;
2004
- }
2005
-
2006
- .gr-textbox:focus, .gr-text-input:focus {
2007
- border-color: var(--accent-primary) !important;
2008
- box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1) !important;
2009
- outline: none;
2010
- }
2011
-
2012
- /* Footer - clean minimal */
2013
- .footer {
2014
- text-align: center;
2015
- margin-top: 3rem;
2016
- padding: 2rem;
2017
- background: transparent;
2018
- border-top: 1px solid var(--border-color);
2019
- color: var(--text-secondary);
2020
- }
2021
-
2022
- .footer a {
2023
- color: var(--accent-primary) !important;
2024
- text-decoration: none;
2025
- font-weight: 500;
2026
- transition: color 0.2s ease;
2027
- }
2028
-
2029
- .footer a:hover {
2030
- color: var(--accent-secondary) !important;
2031
- }
2032
-
2033
- /* Info/Stats boxes */
2034
- .gr-markdown {
2035
- background: var(--bg-secondary) !important;
2036
- border: 1px solid var(--border-color) !important;
2037
- border-radius: var(--radius-md) !important;
2038
- padding: 16px 20px !important;
2039
  }
2040
 
2041
- .gr-markdown blockquote {
2042
- border-left: 3px solid var(--accent-primary) !important;
2043
- background: var(--bg-tertiary) !important;
2044
- padding: 12px 16px !important;
2045
- border-radius: var(--radius-sm) !important;
2046
- color: var(--text-secondary) !important;
2047
- }
2048
-
2049
- /* Scrollbar styling - subtle */
2050
  ::-webkit-scrollbar {
2051
  width: 8px;
2052
- height: 8px;
2053
- }
2054
-
2055
- ::-webkit-scrollbar-track {
2056
- background: transparent;
2057
  }
2058
 
2059
  ::-webkit-scrollbar-thumb {
2060
- background: var(--border-color);
2061
  border-radius: 4px;
2062
  }
2063
 
2064
- ::-webkit-scrollbar-thumb:hover {
2065
- background: var(--text-tertiary);
2066
- }
2067
-
2068
- /* Example cards - clean hover effect */
2069
- .gr-example {
2070
- background: var(--bg-secondary) !important;
2071
- border: 1px solid var(--border-color) !important;
2072
- border-radius: var(--radius-md) !important;
2073
- transition: all 0.2s ease !important;
2074
- }
2075
-
2076
- .gr-example:hover {
2077
- border-color: var(--accent-primary) !important;
2078
- box-shadow: var(--shadow-md) !important;
2079
- }
2080
-
2081
- /* Remove floating orbs - cleaner look */
2082
- .gradio-container::before,
2083
- .gradio-container::after {
2084
- display: none;
2085
- }
2086
-
2087
- /* Label styling */
2088
- label {
2089
- color: var(--text-secondary) !important;
2090
- font-weight: 500 !important;
2091
- font-size: 14px !important;
2092
- }
2093
-
2094
- /* Progress bar */
2095
- .prog {
2096
- background: var(--bg-tertiary) !important;
2097
- border-radius: 4px !important;
2098
- }
2099
-
2100
- .prog .prog-bar {
2101
- background: var(--accent-gradient) !important;
2102
- border-radius: 4px !important;
2103
- }
2104
-
2105
- /* Gallery/output styling */
2106
- .output {
2107
- border: 1px solid var(--border-color) !important;
2108
- border-radius: var(--radius-md) !important;
2109
- background: var(--bg-secondary) !important;
2110
- }
2111
-
2112
- /* Form container styling */
2113
- .form {
2114
- background: transparent !important;
2115
- border: none !important;
2116
- gap: 1rem !important;
2117
- }
2118
-
2119
- /* Group styling */
2120
- .group {
2121
- background: var(--bg-secondary) !important;
2122
- border: 1px solid var(--border-color) !important;
2123
- border-radius: var(--radius-lg) !important;
2124
- padding: 1.5rem !important;
2125
- }
2126
-
2127
- /* Mobile optimization */
2128
  @media (max-width: 768px) {
2129
  .gradio-container {
2130
  padding: 1rem !important;
2131
  }
2132
-
2133
- .gr-row {
2134
- flex-direction: column !important;
2135
- gap: 1rem !important;
2136
- }
2137
-
2138
- .gr-column {
2139
- width: 100% !important;
2140
- }
2141
-
2142
- h1 {
2143
- font-size: 2rem;
2144
- }
2145
-
2146
- .gr-button-primary {
2147
- padding: 10px 20px !important;
2148
- }
2149
-
2150
- .tabs {
2151
- flex-wrap: wrap !important;
2152
- }
2153
  }
2154
  """
2155
 
@@ -2168,14 +1847,14 @@ with gr.Blocks(
2168
  cuda_badge = f"<span class='backend-badge'>CUDA Accelerated</span>" if CUDA_KERNELS_AVAILABLE else ""
2169
  gr.Markdown(f"""
2170
  <div style="text-align: center; padding: 3rem 0 2rem 0;">
2171
- <h1 style="font-size: 3.5rem; margin-bottom: 0.75rem; letter-spacing: -0.04em; line-height: 1.1;">
2172
- Your beautiful neural style transfer toolkit
2173
  </h1>
2174
- <p style="color: var(--text-secondary); font-size: 1.25rem; margin-bottom: 1.5rem; max-width: 600px; margin-left: auto; margin-right: auto; line-height: 1.6;">
2175
- Transform images with stunning artistic styles. From classic masterpieces to modern abstract art.
2176
  </p>
2177
  {cuda_badge}
2178
- <p style="color: var(--text-tertiary); margin-top: 1.5rem; font-size: 0.9rem;">
2179
  Custom Styles • Region Transfer • Style Blending • Real-time Processing
2180
  </p>
2181
  </div>
 
1733
 
1734
  custom_css = """
1735
  /* ============================================
1736
+ CLEAN LIGHT THEME
1737
  ============================================ */
1738
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1739
  /* Clean light background */
1740
  body {
1741
+ background: #FAFAFA;
1742
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
 
 
1743
  }
1744
 
1745
+ /* Main container */
1746
  .gradio-container {
1747
  max-width: 1200px;
1748
  margin: 0 auto;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1749
  }
1750
 
1751
+ /* Primary button - clean gradient */
1752
  .gr-button-primary {
1753
+ background: linear-gradient(135deg, #6366F1 0%, #8B5CF6 100%) !important;
1754
  border: none !important;
1755
  color: white !important;
1756
  font-weight: 600 !important;
1757
+ border-radius: 12px !important;
 
 
1758
  transition: all 0.2s ease !important;
 
1759
  }
1760
 
1761
  .gr-button-primary:hover {
1762
  transform: translateY(-1px);
1763
+ box-shadow: 0 4px 12px rgba(99, 102, 241, 0.3) !important;
 
1764
  }
1765
 
1766
+ /* Secondary button */
 
 
 
 
1767
  .gr-button-secondary {
1768
+ background: white !important;
1769
+ border: 1px solid #E5E7EB !important;
1770
+ color: #1A1A1A !important;
1771
+ border-radius: 12px !important;
 
 
 
1772
  }
1773
 
1774
  .gr-button-secondary:hover {
1775
+ background: #F5F5F5 !important;
 
1776
  }
1777
 
1778
+ /* Slider styling */
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1779
  input[type="range"] {
1780
  -webkit-appearance: none;
1781
+ background: #E5E7EB;
1782
  border-radius: 4px;
1783
  height: 6px;
1784
  }
 
1787
  -webkit-appearance: none;
1788
  width: 18px;
1789
  height: 18px;
1790
+ background: white;
1791
+ border: 3px solid #6366F1;
1792
  border-radius: 50%;
1793
  cursor: pointer;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1794
  }
1795
 
1796
+ /* Badge styles */
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1797
  .live-badge {
1798
  display: inline-block;
1799
  padding: 4px 12px;
 
1802
  border-radius: 20px;
1803
  font-size: 12px;
1804
  font-weight: 600;
 
1805
  }
1806
 
1807
  .backend-badge {
 
1812
  border-radius: 20px;
1813
  font-size: 12px;
1814
  font-weight: 600;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1815
  }
1816
 
1817
+ /* Scrollbar */
 
 
 
 
 
 
 
 
1818
  ::-webkit-scrollbar {
1819
  width: 8px;
 
 
 
 
 
1820
  }
1821
 
1822
  ::-webkit-scrollbar-thumb {
1823
+ background: #E5E7EB;
1824
  border-radius: 4px;
1825
  }
1826
 
1827
+ /* Mobile */
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1828
  @media (max-width: 768px) {
1829
  .gradio-container {
1830
  padding: 1rem !important;
1831
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1832
  }
1833
  """
1834
 
 
1847
  cuda_badge = f"<span class='backend-badge'>CUDA Accelerated</span>" if CUDA_KERNELS_AVAILABLE else ""
1848
  gr.Markdown(f"""
1849
  <div style="text-align: center; padding: 3rem 0 2rem 0;">
1850
+ <h1 style="font-size: 3rem; margin-bottom: 0.5rem; background: linear-gradient(135deg, #6366F1, #8B5CF6); -webkit-background-clip: text; -webkit-text-fill-color: transparent; font-weight: 700;">
1851
+ StyleForge
1852
  </h1>
1853
+ <p style="color: #6B7280; font-size: 1.1rem; margin-bottom: 1rem;">
1854
+ Neural Style Transfer with Custom CUDA Kernels
1855
  </p>
1856
  {cuda_badge}
1857
+ <p style="color: #9CA3AF; margin-top: 1rem; font-size: 0.9rem;">
1858
  Custom Styles • Region Transfer • Style Blending • Real-time Processing
1859
  </p>
1860
  </div>