Spaces:
Sleeping
Sleeping
github-actions[bot]
commited on
Commit
·
4264fdb
1
Parent(s):
bd97d92
Deploy from GitHub - 2026-01-21 20:22:15
Browse files
app.py
CHANGED
|
@@ -1842,22 +1842,17 @@ else:
|
|
| 1842 |
|
| 1843 |
custom_css = """
|
| 1844 |
/* ============================================
|
| 1845 |
-
|
| 1846 |
-
Clean, modern, refined
|
| 1847 |
Gradio 5.x Compatible
|
| 1848 |
============================================ */
|
| 1849 |
|
| 1850 |
-
/* Import fonts - Inter for UI, plus a distinctive display font */
|
| 1851 |
-
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&family=Space+Grotesk:wght@500;600;700&display=swap');
|
| 1852 |
-
|
| 1853 |
/* Animated gradient background */
|
| 1854 |
body {
|
| 1855 |
background: linear-gradient(-45deg, #ee7752, #e73c7e, #23a6d5, #23d5ab);
|
| 1856 |
background-size: 400% 400%;
|
| 1857 |
animation: gradientBG 15s ease infinite;
|
| 1858 |
-
font-family:
|
| 1859 |
min-height: 100vh;
|
| 1860 |
-
color: #09090B;
|
| 1861 |
}
|
| 1862 |
|
| 1863 |
@keyframes gradientBG {
|
|
@@ -1868,118 +1863,181 @@ body {
|
|
| 1868 |
|
| 1869 |
/* Universal font application */
|
| 1870 |
* {
|
| 1871 |
-
font-family:
|
| 1872 |
}
|
| 1873 |
|
| 1874 |
-
/*
|
| 1875 |
-
h1, h2, h3,
|
| 1876 |
-
|
| 1877 |
}
|
| 1878 |
|
| 1879 |
-
/* Main app container -
|
| 1880 |
.gradio-container {
|
| 1881 |
-
|
| 1882 |
-
|
| 1883 |
-
|
| 1884 |
-
|
|
|
|
|
|
|
| 1885 |
max-width: 1400px;
|
| 1886 |
-
margin:
|
| 1887 |
-
padding:
|
| 1888 |
}
|
| 1889 |
|
| 1890 |
-
/* Primary button -
|
| 1891 |
button.primary,
|
| 1892 |
.gr-button-primary,
|
| 1893 |
[class*="primary"] {
|
| 1894 |
-
background:
|
| 1895 |
-
|
| 1896 |
-
|
| 1897 |
-
|
| 1898 |
-
|
| 1899 |
-
|
| 1900 |
-
|
| 1901 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1902 |
position: relative;
|
| 1903 |
overflow: hidden;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1904 |
}
|
| 1905 |
|
| 1906 |
button.primary:hover,
|
| 1907 |
.gr-button-primary:hover,
|
| 1908 |
[class*="primary"]:hover {
|
| 1909 |
-
background: #000000 !important;
|
| 1910 |
-
border-color: #000000 !important;
|
| 1911 |
transform: translateY(-2px);
|
| 1912 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1913 |
}
|
| 1914 |
|
| 1915 |
button.primary:active,
|
| 1916 |
.gr-button-primary:active,
|
| 1917 |
[class*="primary"]:active {
|
| 1918 |
-
transform: translateY(0)
|
|
|
|
|
|
|
|
|
|
| 1919 |
}
|
| 1920 |
|
| 1921 |
-
/* Secondary button -
|
| 1922 |
button.secondary,
|
| 1923 |
.gr-button-secondary,
|
| 1924 |
.download,
|
| 1925 |
[class*="secondary"] {
|
| 1926 |
-
background:
|
| 1927 |
-
|
| 1928 |
-
|
| 1929 |
-
|
| 1930 |
-
|
| 1931 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1932 |
font-weight: 600 !important;
|
| 1933 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1934 |
}
|
| 1935 |
|
| 1936 |
button.secondary:hover,
|
| 1937 |
.gr-button-secondary:hover,
|
| 1938 |
.download:hover,
|
| 1939 |
[class*="secondary"]:hover {
|
| 1940 |
-
background:
|
| 1941 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1942 |
transform: translateY(-1px);
|
| 1943 |
-
box-shadow: 0 4px 15px rgba(0, 0, 0, 0.08) !important;
|
| 1944 |
}
|
| 1945 |
|
| 1946 |
-
/* All buttons -
|
| 1947 |
-
button
|
| 1948 |
-
|
| 1949 |
-
|
| 1950 |
-
|
| 1951 |
-
|
| 1952 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1953 |
}
|
| 1954 |
|
| 1955 |
-
/* Tabs -
|
| 1956 |
.tabs {
|
| 1957 |
-
background:
|
| 1958 |
-
|
| 1959 |
-
|
| 1960 |
-
|
|
|
|
| 1961 |
}
|
| 1962 |
|
| 1963 |
/* Tab buttons */
|
| 1964 |
button.tab-item {
|
| 1965 |
background: transparent !important;
|
| 1966 |
-
border-radius:
|
| 1967 |
-
color: #
|
| 1968 |
-
|
| 1969 |
-
font-weight: 500 !important;
|
| 1970 |
-
transition: all 0.15s ease !important;
|
| 1971 |
-
padding: 8px 14px !important;
|
| 1972 |
}
|
| 1973 |
|
| 1974 |
button.tab-item:hover {
|
| 1975 |
-
background: rgba(
|
| 1976 |
}
|
| 1977 |
|
| 1978 |
button.tab-item.selected {
|
| 1979 |
-
background:
|
| 1980 |
-
color: #
|
| 1981 |
-
font-weight:
|
| 1982 |
-
box-shadow: 0
|
| 1983 |
}
|
| 1984 |
|
| 1985 |
/* Input boxes and text areas */
|
|
@@ -1987,106 +2045,99 @@ input[type="text"],
|
|
| 1987 |
input[type="number"],
|
| 1988 |
textarea,
|
| 1989 |
select {
|
| 1990 |
-
background:
|
| 1991 |
-
|
| 1992 |
-
border
|
| 1993 |
-
|
| 1994 |
-
|
| 1995 |
}
|
| 1996 |
|
| 1997 |
input[type="text"]:focus,
|
| 1998 |
input[type="number"]:focus,
|
| 1999 |
textarea:focus,
|
| 2000 |
select:focus {
|
| 2001 |
-
background:
|
| 2002 |
-
border-color: #
|
|
|
|
| 2003 |
outline: none !important;
|
| 2004 |
-
box-shadow: 0 0 0 2px rgba(0, 0, 0, 0.05) !important;
|
| 2005 |
}
|
| 2006 |
|
| 2007 |
-
/* Image containers -
|
| 2008 |
.image-container,
|
| 2009 |
[class*="image"] {
|
| 2010 |
-
border-radius:
|
| 2011 |
-
border: 1px solid
|
| 2012 |
overflow: hidden !important;
|
| 2013 |
-
background:
|
| 2014 |
}
|
| 2015 |
|
| 2016 |
-
/* Slider styling
|
| 2017 |
input[type="range"] {
|
| 2018 |
-webkit-appearance: none;
|
| 2019 |
-
background:
|
| 2020 |
-
|
| 2021 |
-
|
| 2022 |
-
|
|
|
|
| 2023 |
}
|
| 2024 |
|
| 2025 |
input[type="range"]::-webkit-slider-thumb {
|
| 2026 |
-webkit-appearance: none;
|
| 2027 |
-
width:
|
| 2028 |
-
height:
|
| 2029 |
-
background: #
|
| 2030 |
-
border: 3px solid
|
| 2031 |
border-radius: 50%;
|
| 2032 |
cursor: pointer;
|
| 2033 |
-
box-shadow: 0 2px
|
| 2034 |
-
transition: transform 0.2s ease;
|
| 2035 |
-
}
|
| 2036 |
-
|
| 2037 |
-
input[type="range"]::-webkit-slider-thumb:hover {
|
| 2038 |
-
transform: scale(1.1);
|
| 2039 |
}
|
| 2040 |
|
| 2041 |
input[type="range"]::-moz-range-thumb {
|
| 2042 |
-
width:
|
| 2043 |
-
height:
|
| 2044 |
-
background: #
|
| 2045 |
-
border: 3px solid
|
| 2046 |
border-radius: 50%;
|
| 2047 |
cursor: pointer;
|
| 2048 |
-
box-shadow: 0 2px
|
| 2049 |
-
transition: transform 0.2s ease;
|
| 2050 |
-
}
|
| 2051 |
-
|
| 2052 |
-
input[type="range"]::-moz-range-thumb:hover {
|
| 2053 |
-
transform: scale(1.1);
|
| 2054 |
}
|
| 2055 |
|
| 2056 |
-
/* Checkbox and radio styling
|
| 2057 |
input[type="checkbox"],
|
| 2058 |
input[type="radio"] {
|
| 2059 |
-
accent-color: #
|
| 2060 |
-
width:
|
| 2061 |
-
height:
|
| 2062 |
}
|
| 2063 |
|
| 2064 |
-
/* Badge styles
|
| 2065 |
.live-badge {
|
| 2066 |
display: inline-block;
|
| 2067 |
-
padding:
|
| 2068 |
-
background:
|
|
|
|
| 2069 |
color: #92400E;
|
| 2070 |
-
border-radius:
|
| 2071 |
-
font-size:
|
| 2072 |
-
font-weight:
|
| 2073 |
-
border: 1px solid
|
| 2074 |
}
|
| 2075 |
|
| 2076 |
.backend-badge {
|
| 2077 |
display: inline-block;
|
| 2078 |
-
padding:
|
| 2079 |
-
background:
|
|
|
|
| 2080 |
color: #065F46;
|
| 2081 |
-
border-radius:
|
| 2082 |
-
font-size:
|
| 2083 |
-
font-weight:
|
| 2084 |
-
border: 1px solid
|
| 2085 |
}
|
| 2086 |
|
| 2087 |
/* Markdown content */
|
| 2088 |
.markdown {
|
| 2089 |
-
color: #
|
| 2090 |
}
|
| 2091 |
|
| 2092 |
/* Text visibility fixes */
|
|
@@ -2101,7 +2152,7 @@ input[type="radio"] {
|
|
| 2101 |
.gradio-container p,
|
| 2102 |
.gradio-container span,
|
| 2103 |
.gradio-container label {
|
| 2104 |
-
color: #
|
| 2105 |
}
|
| 2106 |
|
| 2107 |
/* Button text colors */
|
|
@@ -2114,22 +2165,14 @@ button,
|
|
| 2114 |
input,
|
| 2115 |
textarea,
|
| 2116 |
select {
|
| 2117 |
-
color: #
|
| 2118 |
}
|
| 2119 |
|
| 2120 |
-
/* Label colors
|
| 2121 |
label,
|
| 2122 |
[class*="label"] {
|
| 2123 |
-
color: #
|
| 2124 |
-
font-weight:
|
| 2125 |
-
font-size: 15px !important;
|
| 2126 |
-
}
|
| 2127 |
-
|
| 2128 |
-
/* General text size increase */
|
| 2129 |
-
.gradio-container p,
|
| 2130 |
-
.gradio-container span,
|
| 2131 |
-
.gradio-container div {
|
| 2132 |
-
font-size: 15px !important;
|
| 2133 |
}
|
| 2134 |
|
| 2135 |
/* Gradio 5.x specific text elements */
|
|
@@ -2141,76 +2184,79 @@ label,
|
|
| 2141 |
.group,
|
| 2142 |
.row,
|
| 2143 |
.column {
|
| 2144 |
-
background:
|
| 2145 |
-
border-radius:
|
| 2146 |
-
padding:
|
| 2147 |
}
|
| 2148 |
|
| 2149 |
-
/* Accordion
|
| 2150 |
.details {
|
| 2151 |
-
background:
|
| 2152 |
-
|
| 2153 |
-
border:
|
|
|
|
| 2154 |
}
|
| 2155 |
|
| 2156 |
-
/* Scrollbar -
|
| 2157 |
::-webkit-scrollbar {
|
| 2158 |
-
width:
|
| 2159 |
-
height:
|
| 2160 |
}
|
| 2161 |
|
| 2162 |
::-webkit-scrollbar-track {
|
| 2163 |
-
background:
|
|
|
|
| 2164 |
}
|
| 2165 |
|
| 2166 |
::-webkit-scrollbar-thumb {
|
| 2167 |
-
background:
|
| 2168 |
-
border-radius:
|
|
|
|
| 2169 |
}
|
| 2170 |
|
| 2171 |
::-webkit-scrollbar-thumb:hover {
|
| 2172 |
-
background:
|
| 2173 |
}
|
| 2174 |
|
| 2175 |
-
/* Progress bar
|
| 2176 |
progress {
|
| 2177 |
-
background:
|
| 2178 |
-
border-radius:
|
| 2179 |
-
height:
|
| 2180 |
}
|
| 2181 |
|
| 2182 |
progress::-webkit-progress-bar {
|
| 2183 |
-
background:
|
| 2184 |
-
border-radius:
|
| 2185 |
}
|
| 2186 |
|
| 2187 |
progress::-webkit-progress-value {
|
| 2188 |
-
background: #
|
| 2189 |
-
border-radius:
|
| 2190 |
}
|
| 2191 |
|
| 2192 |
/* Mobile responsive */
|
| 2193 |
@media (max-width: 768px) {
|
| 2194 |
.gradio-container {
|
| 2195 |
-
margin:
|
| 2196 |
-
padding:
|
| 2197 |
-
border-radius:
|
| 2198 |
}
|
| 2199 |
|
| 2200 |
button.primary,
|
| 2201 |
.gr-button-primary,
|
| 2202 |
[class*="primary"] {
|
| 2203 |
-
padding:
|
| 2204 |
font-size: 14px !important;
|
| 2205 |
}
|
| 2206 |
}
|
| 2207 |
|
| 2208 |
-
/* Loading spinner
|
| 2209 |
.spinner {
|
| 2210 |
-
border:
|
| 2211 |
-
border-top:
|
| 2212 |
border-radius: 50%;
|
| 2213 |
-
animation: spin
|
| 2214 |
}
|
| 2215 |
|
| 2216 |
@keyframes spin {
|
|
@@ -2222,18 +2268,19 @@ progress::-webkit-progress-value {
|
|
| 2222 |
.gradio-button.primary,
|
| 2223 |
button[class*="Primary"],
|
| 2224 |
[type="button"].primary {
|
| 2225 |
-
background:
|
| 2226 |
-
border: 1px solid
|
| 2227 |
-
color:
|
| 2228 |
-
font-weight:
|
| 2229 |
-
border-radius:
|
|
|
|
| 2230 |
}
|
| 2231 |
|
| 2232 |
/* Block containers */
|
| 2233 |
.block {
|
| 2234 |
-
background:
|
| 2235 |
-
border-radius:
|
| 2236 |
-
padding:
|
| 2237 |
}
|
| 2238 |
|
| 2239 |
/* Form elements */
|
|
@@ -2245,24 +2292,29 @@ button[class*="Primary"],
|
|
| 2245 |
|
| 2246 |
with gr.Blocks(
|
| 2247 |
title="StyleForge: Neural Style Transfer",
|
| 2248 |
-
theme=gr.themes.
|
|
|
|
|
|
|
| 2249 |
font=gr.themes.GoogleFont("Inter"),
|
| 2250 |
-
radius_size="
|
| 2251 |
),
|
| 2252 |
css=custom_css,
|
| 2253 |
) as demo:
|
| 2254 |
|
| 2255 |
-
# Header
|
| 2256 |
cuda_badge = f"<span class='backend-badge'>CUDA Accelerated</span>" if CUDA_KERNELS_AVAILABLE else ""
|
| 2257 |
gr.Markdown(f"""
|
| 2258 |
-
<div style="text-align: center; padding:
|
| 2259 |
-
<h1 style="font-size:
|
| 2260 |
StyleForge
|
| 2261 |
</h1>
|
| 2262 |
-
<p style="color: #
|
| 2263 |
Neural Style Transfer with Custom CUDA Kernels
|
| 2264 |
</p>
|
| 2265 |
{cuda_badge}
|
|
|
|
|
|
|
|
|
|
| 2266 |
</div>
|
| 2267 |
""")
|
| 2268 |
|
|
|
|
| 1842 |
|
| 1843 |
custom_css = """
|
| 1844 |
/* ============================================
|
| 1845 |
+
LIQUID GLASS / GLASSMORPHISM THEME
|
|
|
|
| 1846 |
Gradio 5.x Compatible
|
| 1847 |
============================================ */
|
| 1848 |
|
|
|
|
|
|
|
|
|
|
| 1849 |
/* Animated gradient background */
|
| 1850 |
body {
|
| 1851 |
background: linear-gradient(-45deg, #ee7752, #e73c7e, #23a6d5, #23d5ab);
|
| 1852 |
background-size: 400% 400%;
|
| 1853 |
animation: gradientBG 15s ease infinite;
|
| 1854 |
+
font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Helvetica Neue', Arial, sans-serif;
|
| 1855 |
min-height: 100vh;
|
|
|
|
| 1856 |
}
|
| 1857 |
|
| 1858 |
@keyframes gradientBG {
|
|
|
|
| 1863 |
|
| 1864 |
/* Universal font application */
|
| 1865 |
* {
|
| 1866 |
+
font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Helvetica Neue', Arial, sans-serif;
|
| 1867 |
}
|
| 1868 |
|
| 1869 |
+
/* Ensure text elements are visible */
|
| 1870 |
+
h1, h2, h3, h4, h5, h6, p, span, div, label, button, input, textarea, select {
|
| 1871 |
+
color: inherit;
|
| 1872 |
}
|
| 1873 |
|
| 1874 |
+
/* Main app container - glass effect */
|
| 1875 |
.gradio-container {
|
| 1876 |
+
backdrop-filter: blur(20px) saturate(180%);
|
| 1877 |
+
-webkit-backdrop-filter: blur(20px) saturate(180%);
|
| 1878 |
+
background: rgba(255, 255, 255, 0.75) !important;
|
| 1879 |
+
border-radius: 24px;
|
| 1880 |
+
border: 1px solid rgba(255, 255, 255, 0.3);
|
| 1881 |
+
box-shadow: 0 8px 32px 0 rgba(31, 38, 135, 0.15);
|
| 1882 |
max-width: 1400px;
|
| 1883 |
+
margin: 20px auto;
|
| 1884 |
+
padding: 24px !important;
|
| 1885 |
}
|
| 1886 |
|
| 1887 |
+
/* Primary button - enhanced glass effect with full width */
|
| 1888 |
button.primary,
|
| 1889 |
.gr-button-primary,
|
| 1890 |
[class*="primary"] {
|
| 1891 |
+
background: linear-gradient(135deg,
|
| 1892 |
+
rgba(255, 255, 255, 0.25) 0%,
|
| 1893 |
+
rgba(255, 255, 255, 0.1) 50%,
|
| 1894 |
+
rgba(255, 255, 255, 0.05) 100%) !important;
|
| 1895 |
+
backdrop-filter: blur(20px) saturate(180%);
|
| 1896 |
+
-webkit-backdrop-filter: blur(20px) saturate(180%);
|
| 1897 |
+
border: 1px solid rgba(255, 255, 255, 0.4) !important;
|
| 1898 |
+
color: #4F46E5 !important;
|
| 1899 |
+
font-weight: 700 !important;
|
| 1900 |
+
border-radius: 20px !important;
|
| 1901 |
+
padding: 16px 32px !important;
|
| 1902 |
+
transition: all 0.3s ease !important;
|
| 1903 |
+
box-shadow:
|
| 1904 |
+
0 8px 32px rgba(31, 38, 135, 0.15),
|
| 1905 |
+
inset 0 1px 0 rgba(255, 255, 255, 0.5),
|
| 1906 |
+
inset 0 -1px 0 rgba(0, 0, 0, 0.05) !important;
|
| 1907 |
position: relative;
|
| 1908 |
overflow: hidden;
|
| 1909 |
+
width: 100% !important;
|
| 1910 |
+
min-height: 56px !important;
|
| 1911 |
+
}
|
| 1912 |
+
|
| 1913 |
+
button.primary::before,
|
| 1914 |
+
.gr-button-primary::before,
|
| 1915 |
+
[class*="primary"]::before {
|
| 1916 |
+
content: '';
|
| 1917 |
+
position: absolute;
|
| 1918 |
+
top: 0;
|
| 1919 |
+
left: -100%;
|
| 1920 |
+
width: 100%;
|
| 1921 |
+
height: 100%;
|
| 1922 |
+
background: linear-gradient(90deg,
|
| 1923 |
+
transparent,
|
| 1924 |
+
rgba(255, 255, 255, 0.4),
|
| 1925 |
+
transparent);
|
| 1926 |
+
transition: left 0.5s ease;
|
| 1927 |
+
}
|
| 1928 |
+
|
| 1929 |
+
button.primary:hover::before,
|
| 1930 |
+
.gr-button-primary:hover::before,
|
| 1931 |
+
[class*="primary"]:hover::before {
|
| 1932 |
+
left: 100%;
|
| 1933 |
}
|
| 1934 |
|
| 1935 |
button.primary:hover,
|
| 1936 |
.gr-button-primary:hover,
|
| 1937 |
[class*="primary"]:hover {
|
|
|
|
|
|
|
| 1938 |
transform: translateY(-2px);
|
| 1939 |
+
background: linear-gradient(135deg,
|
| 1940 |
+
rgba(255, 255, 255, 0.35) 0%,
|
| 1941 |
+
rgba(255, 255, 255, 0.15) 50%,
|
| 1942 |
+
rgba(255, 255, 255, 0.1) 100%) !important;
|
| 1943 |
+
border-color: rgba(255, 255, 255, 0.6) !important;
|
| 1944 |
+
box-shadow:
|
| 1945 |
+
0 12px 40px rgba(31, 38, 135, 0.25),
|
| 1946 |
+
inset 0 1px 0 rgba(255, 255, 255, 0.6),
|
| 1947 |
+
inset 0 -1px 0 rgba(0, 0, 0, 0.05) !important;
|
| 1948 |
}
|
| 1949 |
|
| 1950 |
button.primary:active,
|
| 1951 |
.gr-button-primary:active,
|
| 1952 |
[class*="primary"]:active {
|
| 1953 |
+
transform: translateY(0);
|
| 1954 |
+
box-shadow:
|
| 1955 |
+
0 4px 20px rgba(31, 38, 135, 0.15),
|
| 1956 |
+
inset 0 1px 0 rgba(255, 255, 255, 0.3) !important;
|
| 1957 |
}
|
| 1958 |
|
| 1959 |
+
/* Secondary button - enhanced glass style */
|
| 1960 |
button.secondary,
|
| 1961 |
.gr-button-secondary,
|
| 1962 |
.download,
|
| 1963 |
[class*="secondary"] {
|
| 1964 |
+
background: linear-gradient(135deg,
|
| 1965 |
+
rgba(255, 255, 255, 0.4) 0%,
|
| 1966 |
+
rgba(255, 255, 255, 0.2) 100%) !important;
|
| 1967 |
+
backdrop-filter: blur(20px) saturate(180%);
|
| 1968 |
+
-webkit-backdrop-filter: blur(20px) saturate(180%);
|
| 1969 |
+
border: 1px solid rgba(255, 255, 255, 0.5) !important;
|
| 1970 |
+
color: #374151 !important;
|
| 1971 |
+
border-radius: 20px !important;
|
| 1972 |
+
padding: 14px 28px !important;
|
| 1973 |
+
transition: all 0.3s ease !important;
|
| 1974 |
font-weight: 600 !important;
|
| 1975 |
+
box-shadow:
|
| 1976 |
+
0 8px 32px rgba(31, 38, 135, 0.12),
|
| 1977 |
+
inset 0 1px 0 rgba(255, 255, 255, 0.6),
|
| 1978 |
+
inset 0 -1px 0 rgba(0, 0, 0, 0.03) !important;
|
| 1979 |
+
width: 100% !important;
|
| 1980 |
+
min-height: 52px !important;
|
| 1981 |
}
|
| 1982 |
|
| 1983 |
button.secondary:hover,
|
| 1984 |
.gr-button-secondary:hover,
|
| 1985 |
.download:hover,
|
| 1986 |
[class*="secondary"]:hover {
|
| 1987 |
+
background: linear-gradient(135deg,
|
| 1988 |
+
rgba(255, 255, 255, 0.6) 0%,
|
| 1989 |
+
rgba(255, 255, 255, 0.3) 100%) !important;
|
| 1990 |
+
border-color: rgba(255, 255, 255, 0.7) !important;
|
| 1991 |
+
box-shadow:
|
| 1992 |
+
0 12px 40px rgba(31, 38, 135, 0.18),
|
| 1993 |
+
inset 0 1px 0 rgba(255, 255, 255, 0.7) !important;
|
| 1994 |
transform: translateY(-1px);
|
|
|
|
| 1995 |
}
|
| 1996 |
|
| 1997 |
+
/* All buttons - full width in containers */
|
| 1998 |
+
button,
|
| 1999 |
+
.gr-button {
|
| 2000 |
+
border-radius: 20px !important;
|
| 2001 |
+
transition: all 0.3s ease !important;
|
| 2002 |
+
width: 100% !important;
|
| 2003 |
+
}
|
| 2004 |
+
|
| 2005 |
+
/* Button containers - ensure buttons fill row */
|
| 2006 |
+
.gradio-container button,
|
| 2007 |
+
#quick_stylize button,
|
| 2008 |
+
#style_blending button,
|
| 2009 |
+
#region_transfer button,
|
| 2010 |
+
#custom_training button,
|
| 2011 |
+
#benchmarking button {
|
| 2012 |
+
width: 100% !important;
|
| 2013 |
}
|
| 2014 |
|
| 2015 |
+
/* Tabs - glass style */
|
| 2016 |
.tabs {
|
| 2017 |
+
background: rgba(255, 255, 255, 0.4) !important;
|
| 2018 |
+
backdrop-filter: blur(10px);
|
| 2019 |
+
border-radius: 16px !important;
|
| 2020 |
+
padding: 8px !important;
|
| 2021 |
+
border: 1px solid rgba(255, 255, 255, 0.3) !important;
|
| 2022 |
}
|
| 2023 |
|
| 2024 |
/* Tab buttons */
|
| 2025 |
button.tab-item {
|
| 2026 |
background: transparent !important;
|
| 2027 |
+
border-radius: 12px !important;
|
| 2028 |
+
color: #6B7280 !important;
|
| 2029 |
+
transition: all 0.3s ease !important;
|
|
|
|
|
|
|
|
|
|
| 2030 |
}
|
| 2031 |
|
| 2032 |
button.tab-item:hover {
|
| 2033 |
+
background: rgba(255, 255, 255, 0.5) !important;
|
| 2034 |
}
|
| 2035 |
|
| 2036 |
button.tab-item.selected {
|
| 2037 |
+
background: rgba(255, 255, 255, 0.8) !important;
|
| 2038 |
+
color: #6366F1 !important;
|
| 2039 |
+
font-weight: 600 !important;
|
| 2040 |
+
box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1) !important;
|
| 2041 |
}
|
| 2042 |
|
| 2043 |
/* Input boxes and text areas */
|
|
|
|
| 2045 |
input[type="number"],
|
| 2046 |
textarea,
|
| 2047 |
select {
|
| 2048 |
+
background: rgba(255, 255, 255, 0.7) !important;
|
| 2049 |
+
backdrop-filter: blur(10px);
|
| 2050 |
+
border: 1px solid rgba(255, 255, 255, 0.5) !important;
|
| 2051 |
+
border-radius: 12px !important;
|
| 2052 |
+
transition: all 0.3s ease !important;
|
| 2053 |
}
|
| 2054 |
|
| 2055 |
input[type="text"]:focus,
|
| 2056 |
input[type="number"]:focus,
|
| 2057 |
textarea:focus,
|
| 2058 |
select:focus {
|
| 2059 |
+
background: rgba(255, 255, 255, 0.9) !important;
|
| 2060 |
+
border-color: #6366F1 !important;
|
| 2061 |
+
box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1) !important;
|
| 2062 |
outline: none !important;
|
|
|
|
| 2063 |
}
|
| 2064 |
|
| 2065 |
+
/* Image containers - glass frame */
|
| 2066 |
.image-container,
|
| 2067 |
[class*="image"] {
|
| 2068 |
+
border-radius: 16px !important;
|
| 2069 |
+
border: 1px solid rgba(255, 255, 255, 0.3) !important;
|
| 2070 |
overflow: hidden !important;
|
| 2071 |
+
background: rgba(255, 255, 255, 0.3) !important;
|
| 2072 |
}
|
| 2073 |
|
| 2074 |
+
/* Slider styling */
|
| 2075 |
input[type="range"] {
|
| 2076 |
-webkit-appearance: none;
|
| 2077 |
+
background: rgba(229, 231, 235, 0.6);
|
| 2078 |
+
backdrop-filter: blur(10px);
|
| 2079 |
+
border-radius: 8px;
|
| 2080 |
+
height: 8px;
|
| 2081 |
+
border: 1px solid rgba(255, 255, 255, 0.3);
|
| 2082 |
}
|
| 2083 |
|
| 2084 |
input[type="range"]::-webkit-slider-thumb {
|
| 2085 |
-webkit-appearance: none;
|
| 2086 |
+
width: 22px;
|
| 2087 |
+
height: 22px;
|
| 2088 |
+
background: linear-gradient(135deg, #6366F1 0%, #8B5CF6 100%);
|
| 2089 |
+
border: 3px solid white;
|
| 2090 |
border-radius: 50%;
|
| 2091 |
cursor: pointer;
|
| 2092 |
+
box-shadow: 0 2px 8px rgba(99, 102, 241, 0.4);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 2093 |
}
|
| 2094 |
|
| 2095 |
input[type="range"]::-moz-range-thumb {
|
| 2096 |
+
width: 22px;
|
| 2097 |
+
height: 22px;
|
| 2098 |
+
background: linear-gradient(135deg, #6366F1 0%, #8B5CF6 100%);
|
| 2099 |
+
border: 3px solid white;
|
| 2100 |
border-radius: 50%;
|
| 2101 |
cursor: pointer;
|
| 2102 |
+
box-shadow: 0 2px 8px rgba(99, 102, 241, 0.4);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 2103 |
}
|
| 2104 |
|
| 2105 |
+
/* Checkbox and radio styling */
|
| 2106 |
input[type="checkbox"],
|
| 2107 |
input[type="radio"] {
|
| 2108 |
+
accent-color: #6366F1 !important;
|
| 2109 |
+
width: 18px !important;
|
| 2110 |
+
height: 18px !important;
|
| 2111 |
}
|
| 2112 |
|
| 2113 |
+
/* Badge styles */
|
| 2114 |
.live-badge {
|
| 2115 |
display: inline-block;
|
| 2116 |
+
padding: 6px 16px;
|
| 2117 |
+
background: rgba(254, 243, 199, 0.8);
|
| 2118 |
+
backdrop-filter: blur(10px);
|
| 2119 |
color: #92400E;
|
| 2120 |
+
border-radius: 24px;
|
| 2121 |
+
font-size: 13px;
|
| 2122 |
+
font-weight: 600;
|
| 2123 |
+
border: 1px solid rgba(255, 255, 255, 0.3);
|
| 2124 |
}
|
| 2125 |
|
| 2126 |
.backend-badge {
|
| 2127 |
display: inline-block;
|
| 2128 |
+
padding: 6px 16px;
|
| 2129 |
+
background: rgba(209, 250, 229, 0.8);
|
| 2130 |
+
backdrop-filter: blur(10px);
|
| 2131 |
color: #065F46;
|
| 2132 |
+
border-radius: 24px;
|
| 2133 |
+
font-size: 13px;
|
| 2134 |
+
font-weight: 600;
|
| 2135 |
+
border: 1px solid rgba(255, 255, 255, 0.3);
|
| 2136 |
}
|
| 2137 |
|
| 2138 |
/* Markdown content */
|
| 2139 |
.markdown {
|
| 2140 |
+
color: #374151 !important;
|
| 2141 |
}
|
| 2142 |
|
| 2143 |
/* Text visibility fixes */
|
|
|
|
| 2152 |
.gradio-container p,
|
| 2153 |
.gradio-container span,
|
| 2154 |
.gradio-container label {
|
| 2155 |
+
color: #1F2937 !important;
|
| 2156 |
}
|
| 2157 |
|
| 2158 |
/* Button text colors */
|
|
|
|
| 2165 |
input,
|
| 2166 |
textarea,
|
| 2167 |
select {
|
| 2168 |
+
color: #1F2937 !important;
|
| 2169 |
}
|
| 2170 |
|
| 2171 |
+
/* Label colors */
|
| 2172 |
label,
|
| 2173 |
[class*="label"] {
|
| 2174 |
+
color: #374151 !important;
|
| 2175 |
+
font-weight: 500 !important;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 2176 |
}
|
| 2177 |
|
| 2178 |
/* Gradio 5.x specific text elements */
|
|
|
|
| 2184 |
.group,
|
| 2185 |
.row,
|
| 2186 |
.column {
|
| 2187 |
+
background: rgba(255, 255, 255, 0.3) !important;
|
| 2188 |
+
border-radius: 16px !important;
|
| 2189 |
+
padding: 16px !important;
|
| 2190 |
}
|
| 2191 |
|
| 2192 |
+
/* Accordion */
|
| 2193 |
.details {
|
| 2194 |
+
background: rgba(255, 255, 255, 0.4) !important;
|
| 2195 |
+
backdrop-filter: blur(10px);
|
| 2196 |
+
border-radius: 16px !important;
|
| 2197 |
+
border: 1px solid rgba(255, 255, 255, 0.3) !important;
|
| 2198 |
}
|
| 2199 |
|
| 2200 |
+
/* Scrollbar - glass style */
|
| 2201 |
::-webkit-scrollbar {
|
| 2202 |
+
width: 10px;
|
| 2203 |
+
height: 10px;
|
| 2204 |
}
|
| 2205 |
|
| 2206 |
::-webkit-scrollbar-track {
|
| 2207 |
+
background: rgba(229, 231, 235, 0.3);
|
| 2208 |
+
border-radius: 8px;
|
| 2209 |
}
|
| 2210 |
|
| 2211 |
::-webkit-scrollbar-thumb {
|
| 2212 |
+
background: rgba(167, 139, 250, 0.5);
|
| 2213 |
+
border-radius: 8px;
|
| 2214 |
+
border: 2px solid rgba(255, 255, 255, 0.3);
|
| 2215 |
}
|
| 2216 |
|
| 2217 |
::-webkit-scrollbar-thumb:hover {
|
| 2218 |
+
background: rgba(139, 92, 246, 0.7);
|
| 2219 |
}
|
| 2220 |
|
| 2221 |
+
/* Progress bar */
|
| 2222 |
progress {
|
| 2223 |
+
background: rgba(229, 231, 235, 0.5) !important;
|
| 2224 |
+
border-radius: 8px !important;
|
| 2225 |
+
height: 8px !important;
|
| 2226 |
}
|
| 2227 |
|
| 2228 |
progress::-webkit-progress-bar {
|
| 2229 |
+
background: rgba(229, 231, 235, 0.5);
|
| 2230 |
+
border-radius: 8px;
|
| 2231 |
}
|
| 2232 |
|
| 2233 |
progress::-webkit-progress-value {
|
| 2234 |
+
background: linear-gradient(90deg, #6366F1, #8B5CF6) !important;
|
| 2235 |
+
border-radius: 8px;
|
| 2236 |
}
|
| 2237 |
|
| 2238 |
/* Mobile responsive */
|
| 2239 |
@media (max-width: 768px) {
|
| 2240 |
.gradio-container {
|
| 2241 |
+
margin: 10px !important;
|
| 2242 |
+
padding: 16px !important;
|
| 2243 |
+
border-radius: 20px !important;
|
| 2244 |
}
|
| 2245 |
|
| 2246 |
button.primary,
|
| 2247 |
.gr-button-primary,
|
| 2248 |
[class*="primary"] {
|
| 2249 |
+
padding: 10px 18px !important;
|
| 2250 |
font-size: 14px !important;
|
| 2251 |
}
|
| 2252 |
}
|
| 2253 |
|
| 2254 |
+
/* Loading spinner */
|
| 2255 |
.spinner {
|
| 2256 |
+
border: 3px solid rgba(99, 102, 241, 0.2);
|
| 2257 |
+
border-top: 3px solid #6366F1;
|
| 2258 |
border-radius: 50%;
|
| 2259 |
+
animation: spin 1s linear infinite;
|
| 2260 |
}
|
| 2261 |
|
| 2262 |
@keyframes spin {
|
|
|
|
| 2268 |
.gradio-button.primary,
|
| 2269 |
button[class*="Primary"],
|
| 2270 |
[type="button"].primary {
|
| 2271 |
+
background: linear-gradient(135deg, rgba(99, 102, 241, 0.9) 0%, rgba(139, 92, 246, 0.9) 100%) !important;
|
| 2272 |
+
border: 1px solid rgba(255, 255, 255, 0.2) !important;
|
| 2273 |
+
color: white !important;
|
| 2274 |
+
font-weight: 600 !important;
|
| 2275 |
+
border-radius: 16px !important;
|
| 2276 |
+
box-shadow: 0 4px 15px rgba(99, 102, 241, 0.25) !important;
|
| 2277 |
}
|
| 2278 |
|
| 2279 |
/* Block containers */
|
| 2280 |
.block {
|
| 2281 |
+
background: rgba(255, 255, 255, 0.25) !important;
|
| 2282 |
+
border-radius: 16px !important;
|
| 2283 |
+
padding: 12px !important;
|
| 2284 |
}
|
| 2285 |
|
| 2286 |
/* Form elements */
|
|
|
|
| 2292 |
|
| 2293 |
with gr.Blocks(
|
| 2294 |
title="StyleForge: Neural Style Transfer",
|
| 2295 |
+
theme=gr.themes.Glass(
|
| 2296 |
+
primary_hue="indigo",
|
| 2297 |
+
secondary_hue="purple",
|
| 2298 |
font=gr.themes.GoogleFont("Inter"),
|
| 2299 |
+
radius_size="lg",
|
| 2300 |
),
|
| 2301 |
css=custom_css,
|
| 2302 |
) as demo:
|
| 2303 |
|
| 2304 |
+
# Header with Portal-style hero section
|
| 2305 |
cuda_badge = f"<span class='backend-badge'>CUDA Accelerated</span>" if CUDA_KERNELS_AVAILABLE else ""
|
| 2306 |
gr.Markdown(f"""
|
| 2307 |
+
<div style="text-align: center; padding: 3rem 0 2rem 0;">
|
| 2308 |
+
<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;">
|
| 2309 |
StyleForge
|
| 2310 |
</h1>
|
| 2311 |
+
<p style="color: #6B7280; font-size: 1.1rem; margin-bottom: 1rem;">
|
| 2312 |
Neural Style Transfer with Custom CUDA Kernels
|
| 2313 |
</p>
|
| 2314 |
{cuda_badge}
|
| 2315 |
+
<p style="color: #9CA3AF; margin-top: 1rem; font-size: 0.9rem;">
|
| 2316 |
+
Custom Styles • Region Transfer • Style Blending • Real-time Processing
|
| 2317 |
+
</p>
|
| 2318 |
</div>
|
| 2319 |
""")
|
| 2320 |
|