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|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 182 |
gr.Markdown("""
|
| 183 |
-
##
|
| 184 |
Convert images into high-quality 3D assets for your VFX projects.
|
| 185 |
|
| 186 |
**Instructions:**
|
|
@@ -277,6 +481,9 @@ with gr.Blocks(delete_cache=(600, 600)) as demo:
|
|
| 277 |
outputs=[download_glb],
|
| 278 |
)
|
| 279 |
|
|
|
|
|
|
|
|
|
|
| 280 |
|
| 281 |
# Launch the Gradio app
|
| 282 |
if __name__ == "__main__":
|
|
|
|
| 178 |
|
| 179 |
|
| 180 |
|
| 181 |
+
# Custom CSS for dark theme matching the image reference
|
| 182 |
+
custom_css = """
|
| 183 |
+
/* Dark theme styling */
|
| 184 |
+
.gradio-container {
|
| 185 |
+
background: #1A1A1A !important;
|
| 186 |
+
color: #CCCCCC !important;
|
| 187 |
+
font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif !important;
|
| 188 |
+
}
|
| 189 |
+
|
| 190 |
+
/* Main title styling */
|
| 191 |
+
.main-title {
|
| 192 |
+
text-align: center;
|
| 193 |
+
margin-bottom: 2rem;
|
| 194 |
+
}
|
| 195 |
+
|
| 196 |
+
.main-title h1 {
|
| 197 |
+
font-size: 3rem;
|
| 198 |
+
font-weight: bold;
|
| 199 |
+
margin: 0;
|
| 200 |
+
line-height: 1.2;
|
| 201 |
+
}
|
| 202 |
+
|
| 203 |
+
.title-welcome {
|
| 204 |
+
color: #FFFFFF;
|
| 205 |
+
display: block;
|
| 206 |
+
}
|
| 207 |
+
|
| 208 |
+
.title-project {
|
| 209 |
+
color: #FF8C00;
|
| 210 |
+
display: block;
|
| 211 |
+
}
|
| 212 |
+
|
| 213 |
+
.subtitle {
|
| 214 |
+
text-align: center;
|
| 215 |
+
color: #CCCCCC;
|
| 216 |
+
font-size: 1.2rem;
|
| 217 |
+
margin: 1rem 0;
|
| 218 |
+
}
|
| 219 |
+
|
| 220 |
+
.description {
|
| 221 |
+
text-align: center;
|
| 222 |
+
color: #CCCCCC;
|
| 223 |
+
font-size: 1rem;
|
| 224 |
+
margin-bottom: 3rem;
|
| 225 |
+
}
|
| 226 |
+
|
| 227 |
+
/* Card styling */
|
| 228 |
+
.feature-card {
|
| 229 |
+
background: #2C2C2C !important;
|
| 230 |
+
border-radius: 12px;
|
| 231 |
+
padding: 1.5rem;
|
| 232 |
+
margin: 1rem;
|
| 233 |
+
border: none;
|
| 234 |
+
box-shadow: 0 4px 6px rgba(0, 0, 0, 0.3);
|
| 235 |
+
transition: transform 0.2s ease;
|
| 236 |
+
}
|
| 237 |
+
|
| 238 |
+
.feature-card:hover {
|
| 239 |
+
transform: translateY(-2px);
|
| 240 |
+
}
|
| 241 |
+
|
| 242 |
+
.card-title {
|
| 243 |
+
color: #FFFFFF;
|
| 244 |
+
font-size: 1.3rem;
|
| 245 |
+
font-weight: bold;
|
| 246 |
+
margin-bottom: 0.8rem;
|
| 247 |
+
}
|
| 248 |
+
|
| 249 |
+
.card-description {
|
| 250 |
+
color: #CCCCCC;
|
| 251 |
+
font-size: 0.95rem;
|
| 252 |
+
line-height: 1.4;
|
| 253 |
+
margin-bottom: 1rem;
|
| 254 |
+
}
|
| 255 |
+
|
| 256 |
+
.card-arrow {
|
| 257 |
+
color: #FF8C00;
|
| 258 |
+
font-size: 1.2rem;
|
| 259 |
+
font-weight: bold;
|
| 260 |
+
}
|
| 261 |
+
|
| 262 |
+
/* Footer styling */
|
| 263 |
+
.footer {
|
| 264 |
+
text-align: center;
|
| 265 |
+
margin-top: 3rem;
|
| 266 |
+
padding: 2rem 0;
|
| 267 |
+
color: #CCCCCC;
|
| 268 |
+
font-size: 0.9rem;
|
| 269 |
+
}
|
| 270 |
+
|
| 271 |
+
.footer-brand {
|
| 272 |
+
color: #FF8C00;
|
| 273 |
+
font-weight: bold;
|
| 274 |
+
}
|
| 275 |
+
|
| 276 |
+
/* Input components styling */
|
| 277 |
+
.gradio-container .gr-form {
|
| 278 |
+
background: #2C2C2C !important;
|
| 279 |
+
border-radius: 8px;
|
| 280 |
+
padding: 1rem;
|
| 281 |
+
margin: 1rem 0;
|
| 282 |
+
}
|
| 283 |
+
|
| 284 |
+
.gradio-container .gr-button {
|
| 285 |
+
background: #FF8C00 !important;
|
| 286 |
+
color: #FFFFFF !important;
|
| 287 |
+
border: none !important;
|
| 288 |
+
border-radius: 8px !important;
|
| 289 |
+
font-weight: bold !important;
|
| 290 |
+
}
|
| 291 |
+
|
| 292 |
+
.gradio-container .gr-button:hover {
|
| 293 |
+
background: #E67E00 !important;
|
| 294 |
+
}
|
| 295 |
+
|
| 296 |
+
/* Input styling */
|
| 297 |
+
.gradio-container input, .gradio-container textarea, .gradio-container select {
|
| 298 |
+
background: #1A1A1A !important;
|
| 299 |
+
color: #CCCCCC !important;
|
| 300 |
+
border: 1px solid #444444 !important;
|
| 301 |
+
border-radius: 6px !important;
|
| 302 |
+
}
|
| 303 |
+
|
| 304 |
+
.gradio-container input:focus, .gradio-container textarea:focus, .gradio-container select:focus {
|
| 305 |
+
border-color: #FF8C00 !important;
|
| 306 |
+
box-shadow: 0 0 0 2px rgba(255, 140, 0, 0.2) !important;
|
| 307 |
+
}
|
| 308 |
+
|
| 309 |
+
/* Tab styling */
|
| 310 |
+
.gradio-container .gr-tabs {
|
| 311 |
+
background: #2C2C2C !important;
|
| 312 |
+
border-radius: 8px;
|
| 313 |
+
}
|
| 314 |
+
|
| 315 |
+
.gradio-container .gr-tab {
|
| 316 |
+
color: #CCCCCC !important;
|
| 317 |
+
background: transparent !important;
|
| 318 |
+
}
|
| 319 |
+
|
| 320 |
+
.gradio-container .gr-tab.selected {
|
| 321 |
+
background: #FF8C00 !important;
|
| 322 |
+
color: #FFFFFF !important;
|
| 323 |
+
}
|
| 324 |
+
|
| 325 |
+
/* Accordion styling */
|
| 326 |
+
.gradio-container .gr-accordion {
|
| 327 |
+
background: #2C2C2C !important;
|
| 328 |
+
border: 1px solid #444444 !important;
|
| 329 |
+
border-radius: 8px;
|
| 330 |
+
}
|
| 331 |
+
|
| 332 |
+
.gradio-container .gr-accordion-header {
|
| 333 |
+
color: #FFFFFF !important;
|
| 334 |
+
background: #2C2C2C !important;
|
| 335 |
+
}
|
| 336 |
+
|
| 337 |
+
/* Video and model output styling */
|
| 338 |
+
.gradio-container .gr-video, .gradio-container .gr-model3d {
|
| 339 |
+
border-radius: 8px;
|
| 340 |
+
border: 1px solid #444444;
|
| 341 |
+
}
|
| 342 |
+
|
| 343 |
+
/* Gallery styling */
|
| 344 |
+
.gradio-container .gr-gallery {
|
| 345 |
+
background: #1A1A1A !important;
|
| 346 |
+
border: 1px solid #444444 !important;
|
| 347 |
+
border-radius: 8px;
|
| 348 |
+
}
|
| 349 |
+
"""
|
| 350 |
+
|
| 351 |
+
with gr.Blocks(css=custom_css, delete_cache=(600, 600)) as demo:
|
| 352 |
+
# Header section
|
| 353 |
+
with gr.Column(elem_classes="main-title"):
|
| 354 |
+
gr.HTML("""
|
| 355 |
+
<h1>
|
| 356 |
+
<span class="title-welcome">Welcome to</span>
|
| 357 |
+
<span class="title-project">Project Neural Lynx</span>
|
| 358 |
+
</h1>
|
| 359 |
+
""")
|
| 360 |
+
gr.HTML('<p class="subtitle">AI-powered tools for VFX made for and by creators.</p>')
|
| 361 |
+
gr.HTML('<p class="description">Discover our suite of AI tools catered to VFX workflows.</p>')
|
| 362 |
+
|
| 363 |
+
# Feature cards section
|
| 364 |
+
with gr.Row():
|
| 365 |
+
with gr.Column(elem_classes="feature-card"):
|
| 366 |
+
gr.HTML('<h3 class="card-title">3D Model Generation</h3>')
|
| 367 |
+
gr.HTML('<p class="card-description">Generate 3D models and textures from image or text using AI technology.</p>')
|
| 368 |
+
gr.HTML('<span class="card-arrow">→</span>')
|
| 369 |
+
|
| 370 |
+
with gr.Column(elem_classes="feature-card"):
|
| 371 |
+
gr.HTML('<h3 class="card-title">Depth Map Generation</h3>')
|
| 372 |
+
gr.HTML('<p class="card-description">Create depth maps from video content for compositing and 3D effects.</p>')
|
| 373 |
+
gr.HTML('<span class="card-arrow">→</span>')
|
| 374 |
+
|
| 375 |
+
with gr.Column(elem_classes="feature-card"):
|
| 376 |
+
gr.HTML('<h3 class="card-title">Auto Rotoscope</h3>')
|
| 377 |
+
gr.HTML('<p class="card-description">Remove backgrounds from video content using AI algorithms.</p>')
|
| 378 |
+
gr.HTML('<span class="card-arrow">→</span>')
|
| 379 |
+
|
| 380 |
+
with gr.Column(elem_classes="feature-card"):
|
| 381 |
+
gr.HTML('<h3 class="card-title">Audio Captioning</h3>')
|
| 382 |
+
gr.HTML('<p class="card-description">Generate captions and transcriptions from audio file content.</p>')
|
| 383 |
+
gr.HTML('<span class="card-arrow">→</span>')
|
| 384 |
+
|
| 385 |
+
# Main application interface
|
| 386 |
gr.Markdown("""
|
| 387 |
+
## 3D Asset Generator
|
| 388 |
Convert images into high-quality 3D assets for your VFX projects.
|
| 389 |
|
| 390 |
**Instructions:**
|
|
|
|
| 481 |
outputs=[download_glb],
|
| 482 |
)
|
| 483 |
|
| 484 |
+
# Footer section
|
| 485 |
+
with gr.Column(elem_classes="footer"):
|
| 486 |
+
gr.HTML('<p>Powered by <span class="footer-brand">Mean Cat Entertainment</span> • Built for the future of VFX</p>')
|
| 487 |
|
| 488 |
# Launch the Gradio app
|
| 489 |
if __name__ == "__main__":
|