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|
|
|
|
|
|
|
|
| 1 |
+
#!/usr/bin/env python3
|
| 2 |
+
# -*- coding: utf-8 -*-
|
| 3 |
+
"""
|
| 4 |
+
TRELLIS 维护通知界面(精简版)
|
| 5 |
+
依赖:Python 3.8+、gradio 4.*
|
| 6 |
+
"""
|
| 7 |
+
|
| 8 |
+
import gradio as gr
|
| 9 |
+
|
| 10 |
+
def create_notice_interface():
|
| 11 |
+
"""创建用户维护通知界面"""
|
| 12 |
+
|
| 13 |
+
# 自定义 CSS
|
| 14 |
+
custom_css = """
|
| 15 |
+
.notice-container {
|
| 16 |
+
background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
|
| 17 |
+
padding: 1.5rem; /* 缩小内边距 */
|
| 18 |
+
border-radius: 20px;
|
| 19 |
+
box-shadow: 0 6px 18px rgba(0, 0, 0, 0.18);
|
| 20 |
+
text-align: center;
|
| 21 |
+
margin: 2rem auto;
|
| 22 |
+
max-width: 600px; /* 缩小宽度 */
|
| 23 |
+
}
|
| 24 |
+
|
| 25 |
+
.notice-title {
|
| 26 |
+
color: #fff;
|
| 27 |
+
font-size: 2rem; /* 调小标题字号 */
|
| 28 |
+
font-weight: bold;
|
| 29 |
+
margin-bottom: 0.8rem;
|
| 30 |
+
text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.3);
|
| 31 |
+
}
|
| 32 |
+
|
| 33 |
+
.notice-subtitle {
|
| 34 |
+
color: #f5f5f5;
|
| 35 |
+
font-size: 1rem;
|
| 36 |
+
margin-bottom: 1.5rem;
|
| 37 |
+
line-height: 1.5;
|
| 38 |
+
}
|
| 39 |
+
|
| 40 |
+
.maintenance-icon {
|
| 41 |
+
font-size: 3rem; /* 调小图标 */
|
| 42 |
+
margin-bottom: 0.8rem;
|
| 43 |
+
display: block;
|
| 44 |
+
}
|
| 45 |
+
|
| 46 |
+
.redirect-button {
|
| 47 |
+
background: linear-gradient(45deg, #FF6B6B, #FF8E8E);
|
| 48 |
+
color: #fff;
|
| 49 |
+
padding: 12px 28px;
|
| 50 |
+
border: none;
|
| 51 |
+
border-radius: 40px;
|
| 52 |
+
font-size: 1rem;
|
| 53 |
+
font-weight: bold;
|
| 54 |
+
cursor: pointer;
|
| 55 |
+
transition: all 0.3s ease;
|
| 56 |
+
text-decoration: none;
|
| 57 |
+
display: inline-block;
|
| 58 |
+
margin: 0.5rem;
|
| 59 |
+
box-shadow: 0 5px 15px rgba(255, 107, 107, 0.3);
|
| 60 |
+
}
|
| 61 |
+
|
| 62 |
+
.redirect-button:hover {
|
| 63 |
+
transform: translateY(-3px);
|
| 64 |
+
box-shadow: 0 8px 25px rgba(255, 107, 107, 0.4);
|
| 65 |
+
}
|
| 66 |
+
|
| 67 |
+
.status-card {
|
| 68 |
+
background: rgba(255, 255, 255, 0.95);
|
| 69 |
+
border-radius: 15px;
|
| 70 |
+
padding: 2rem;
|
| 71 |
+
margin: 2rem 0;
|
| 72 |
+
box-shadow: 0 4px 18px rgba(0, 0, 0, 0.1);
|
| 73 |
+
}
|
| 74 |
+
|
| 75 |
+
.status-text {
|
| 76 |
+
color: #333;
|
| 77 |
+
font-size: 1rem;
|
| 78 |
+
line-height: 1.7;
|
| 79 |
+
margin-bottom: 1rem;
|
| 80 |
+
}
|
| 81 |
+
|
| 82 |
+
.highlight-text {
|
| 83 |
+
color: #667eea;
|
| 84 |
+
font-weight: bold;
|
| 85 |
+
}
|
| 86 |
+
|
| 87 |
+
.footer-text {
|
| 88 |
+
color: rgba(255, 255, 255, 0.8);
|
| 89 |
+
font-size: 0.85rem;
|
| 90 |
+
margin-top: 2rem;
|
| 91 |
+
}
|
| 92 |
+
|
| 93 |
+
.pulse {
|
| 94 |
+
animation: pulse 2s infinite;
|
| 95 |
+
}
|
| 96 |
+
@keyframes pulse {
|
| 97 |
+
0% { transform: scale(1); }
|
| 98 |
+
50% { transform: scale(1.05); }
|
| 99 |
+
100% { transform: scale(1); }
|
| 100 |
+
}
|
| 101 |
+
"""
|
| 102 |
+
|
| 103 |
+
# 构建界面
|
| 104 |
+
with gr.Blocks(css=custom_css,
|
| 105 |
+
theme=gr.themes.Soft(),
|
| 106 |
+
title="TRELLIS - Service Temporarily Unavailable") as demo:
|
| 107 |
+
|
| 108 |
+
# Service Under Maintenance 卡片(含按钮)
|
| 109 |
+
gr.HTML("""
|
| 110 |
+
<div class="notice-container">
|
| 111 |
+
<div class="maintenance-icon">🔧</div>
|
| 112 |
+
<h1 class="notice-title">Service Under Maintenance</h1>
|
| 113 |
+
<p class="notice-subtitle">
|
| 114 |
+
We apologize for the inconvenience. The TRELLIS space is currently undergoing maintenance and upgrades.<br>
|
| 115 |
+
We are working hard to improve our service and will be back soon.
|
| 116 |
+
</p>
|
| 117 |
+
<a href="https://image-to-3d.wingetgui.com/" target="_blank"
|
| 118 |
+
class="redirect-button pulse">
|
| 119 |
+
🌟 Visit Alternative Service Now 🌟
|
| 120 |
+
</a>
|
| 121 |
+
</div>
|
| 122 |
+
""")
|
| 123 |
+
|
| 124 |
+
# 功能展示卡片
|
| 125 |
+
gr.HTML("""
|
| 126 |
+
<div class="status-card">
|
| 127 |
+
<div class="status-text">
|
| 128 |
+
🚀 <span class="highlight-text">Good News!</span><br><br>
|
| 129 |
+
We have prepared a fully functional alternative service for you:<br>
|
| 130 |
+
<strong>Image to 3D Online Service</strong>
|
| 131 |
+
</div>
|
| 132 |
+
<div class="status-text">
|
| 133 |
+
✨ <strong>Key Features:</strong><br>
|
| 134 |
+
• 🖼️ Image to 3D model conversion<br>
|
| 135 |
+
• ⚡ Fast processing, no GPU required<br>
|
| 136 |
+
• 🎨 High‑quality output<br>
|
| 137 |
+
• 💻 No installation needed, use online
|
| 138 |
+
</div>
|
| 139 |
+
</div>
|
| 140 |
+
""")
|
| 141 |
+
|
| 142 |
+
# 页脚
|
| 143 |
+
gr.HTML("""
|
| 144 |
+
<div style="text-align: center;">
|
| 145 |
+
<p class="footer-text">
|
| 146 |
+
Thank you for choosing TRELLIS | We are committed to providing you with the best 3D generation experience
|
| 147 |
+
</p>
|
| 148 |
+
</div>
|
| 149 |
+
""")
|
| 150 |
+
|
| 151 |
+
return demo
|
| 152 |
+
|
| 153 |
+
|
| 154 |
+
if __name__ == "__main__":
|
| 155 |
+
# 创建并启动程序
|
| 156 |
+
demo_app = create_notice_interface()
|
| 157 |
+
demo_app.launch(
|
| 158 |
+
server_name="0.0.0.0",
|
| 159 |
+
server_port=7860,
|
| 160 |
+
share=True,
|
| 161 |
+
show_error=True,
|
| 162 |
+
quiet=False
|
| 163 |
+
)
|