Spaces:
Running
Running
#!/usr/bin/env python3 | |
# -*- coding: utf-8 -*- | |
""" | |
TRELLIS 维护通知界面(正式版) | |
依赖:Python 3.8+、gradio 4.* | |
""" | |
import gradio as gr | |
def create_notice_interface(): | |
"""创建维护通知界面""" | |
# 正式风格的 CSS(无动画) | |
custom_css = """ | |
.notice-container { | |
background-color: #3B82F6; | |
padding: 1.5rem; | |
border-radius: 12px; | |
box-shadow: 0 6px 16px rgba(0, 0, 0, 0.15); | |
text-align: center; | |
margin: 2rem auto; | |
max-width: 600px; | |
} | |
.notice-title { | |
color: #fff; | |
font-size: 1.8rem; | |
font-weight: 700; | |
margin-bottom: 0.6rem; | |
} | |
.notice-subtitle { | |
color: #f0f0f0; | |
font-size: 1rem; | |
line-height: 1.6; | |
margin-bottom: 1.5rem; | |
} | |
.maintenance-icon { | |
font-size: 2.5rem; | |
margin-bottom: 0.5rem; | |
display: block; | |
} | |
.redirect-button, .redirect-button-blue { | |
background-color: #2563EB; | |
color: white; | |
padding: 10px 24px; | |
border: none; | |
border-radius: 6px; | |
font-size: 1rem; | |
font-weight: 600; | |
cursor: pointer; | |
text-decoration: none; | |
display: inline-block; | |
margin: 0.5rem auto; | |
} | |
.redirect-button:hover, .redirect-button-blue:hover { | |
background-color: #1D4ED8; | |
} | |
.status-card { | |
background: #ffffff; | |
border-radius: 12px; | |
padding: 1.5rem; | |
margin: 2rem auto; | |
max-width: 700px; | |
box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1); | |
} | |
.status-text { | |
color: #333; | |
font-size: 1rem; | |
line-height: 1.6; | |
margin-bottom: 1rem; | |
} | |
.highlight-text { | |
color: #2563EB; | |
font-weight: bold; | |
} | |
.footer-text { | |
color: #888; | |
font-size: 0.85rem; | |
text-align: center; | |
margin-top: 2rem; | |
} | |
""" | |
# 构建界面 | |
with gr.Blocks(css=custom_css, | |
theme=gr.themes.Soft(), | |
title="TRELLIS - Service Temporarily Unavailable") as demo: | |
gr.HTML(""" | |
<div class="notice-container"> | |
<div class="maintenance-icon">🔧</div> | |
<h1 class="notice-title">Service Under Maintenance</h1> | |
<p class="notice-subtitle"> | |
We apologize for the inconvenience. The TRELLIS space is currently undergoing maintenance and upgrades.<br> | |
We are working hard to improve our service and will be back soon. | |
</p> | |
<a href="https://image-to-3d.wingetgui.com/" target="_blank" | |
class="redirect-button"> | |
Visit Alternative Service Now | |
</a> | |
</div> | |
""") | |
gr.HTML(""" | |
<div class="status-card"> | |
<div class="status-text"> | |
🚀 <span class="highlight-text">Good News!</span><br><br> | |
We have prepared a fully functional alternative service for you:<br> | |
<strong>Image to 3D Online Service</strong> | |
</div> | |
<div class="status-text"> | |
✨ <strong>Key Features:</strong><br> | |
• 🖼️ Image to 3D model conversion<br> | |
• ⚡ Fast processing, no GPU required<br> | |
• 🎨 High-quality output<br> | |
• 💻 No installation needed, use online | |
</div> | |
<div style="text-align: center;"> | |
<a href="https://image-to-3d.wingetgui.com/" target="_blank" | |
class="redirect-button-blue"> | |
Visit Alternative Service Now | |
</a> | |
</div> | |
</div> | |
""") | |
gr.HTML(""" | |
<div class="footer-text"> | |
Thank you for choosing TRELLIS | We are committed to providing you with the best 3D generation experience | |
</div> | |
""") | |
return demo | |
if __name__ == "__main__": | |
app = create_notice_interface() | |
app.launch( | |
server_name="0.0.0.0", | |
server_port=7860, | |
share=False, | |
show_error=True, | |
quiet=False | |
) | |