Spaces:
Running
on
Zero
Running
on
Zero
Update app.py
Browse files
app.py
CHANGED
|
@@ -51,20 +51,17 @@ examples = [
|
|
| 51 |
["Portrait of a wise old wizard with a long white beard, holding a glowing crystal staff, magical forest background"],
|
| 52 |
]
|
| 53 |
|
| 54 |
-
|
| 55 |
-
|
| 56 |
-
|
| 57 |
-
|
| 58 |
-
|
| 59 |
-
|
| 60 |
-
|
| 61 |
-
|
| 62 |
-
|
| 63 |
-
|
| 64 |
-
|
| 65 |
-
button_primary_background_fill_hover="*primary_600",
|
| 66 |
-
block_title_text_weight="600",
|
| 67 |
-
)
|
| 68 |
|
| 69 |
# Build the Gradio interface
|
| 70 |
with gr.Blocks(fill_height=True) as demo:
|
|
@@ -79,7 +76,7 @@ with gr.Blocks(fill_height=True) as demo:
|
|
| 79 |
|
| 80 |
with gr.Row(equal_height=False):
|
| 81 |
# Left column - Input controls
|
| 82 |
-
with gr.Column(scale=1, min_width=320):
|
| 83 |
prompt = gr.Textbox(
|
| 84 |
label="✨ Your Prompt",
|
| 85 |
placeholder="Describe the image you want to create...",
|
|
@@ -167,20 +164,7 @@ with gr.Blocks(fill_height=True) as demo:
|
|
| 167 |
interactive=False,
|
| 168 |
container=True,
|
| 169 |
)
|
| 170 |
-
|
| 171 |
-
# Footer credits
|
| 172 |
-
gr.Markdown(
|
| 173 |
-
"""
|
| 174 |
-
---
|
| 175 |
-
<div style="text-align: center; opacity: 0.7; font-size: 0.9em; margin-top: 1rem;">
|
| 176 |
-
<strong>Model:</strong> <a href="https://huggingface.co/Tongyi-MAI/Z-Image-Turbo" target="_blank">Tongyi-MAI/Z-Image-Turbo</a> (Apache 2.0 License) •
|
| 177 |
-
<strong>Demo by:</strong> <a href="https://x.com/realmrfakename" target="_blank">@mrfakename</a> •
|
| 178 |
-
<strong>Redesign by:</strong> AnyCoder •
|
| 179 |
-
<strong>Optimizations:</strong> <a href="https://huggingface.co/multimodalart" target="_blank">@multimodalart</a> (FA3 + AoTI)
|
| 180 |
-
</div>
|
| 181 |
-
""",
|
| 182 |
-
elem_classes="footer-text"
|
| 183 |
-
)
|
| 184 |
|
| 185 |
# Connect the generate button
|
| 186 |
generate_btn.click(
|
|
@@ -198,65 +182,8 @@ with gr.Blocks(fill_height=True) as demo:
|
|
| 198 |
|
| 199 |
if __name__ == "__main__":
|
| 200 |
demo.launch(
|
| 201 |
-
theme=
|
| 202 |
-
css=
|
| 203 |
-
.header-text h1 {
|
| 204 |
-
font-size: 2.5rem !important;
|
| 205 |
-
font-weight: 700 !important;
|
| 206 |
-
margin-bottom: 0.5rem !important;
|
| 207 |
-
background: linear-gradient(135deg, #fbbf24 0%, #f59e0b 100%);
|
| 208 |
-
-webkit-background-clip: text;
|
| 209 |
-
-webkit-text-fill-color: transparent;
|
| 210 |
-
background-clip: text;
|
| 211 |
-
}
|
| 212 |
-
|
| 213 |
-
.header-text p {
|
| 214 |
-
font-size: 1.1rem !important;
|
| 215 |
-
color: #64748b !important;
|
| 216 |
-
margin-top: 0 !important;
|
| 217 |
-
}
|
| 218 |
-
|
| 219 |
-
.footer-text {
|
| 220 |
-
padding: 1rem 0;
|
| 221 |
-
}
|
| 222 |
-
|
| 223 |
-
.footer-text a {
|
| 224 |
-
color: #f59e0b !important;
|
| 225 |
-
text-decoration: none !important;
|
| 226 |
-
font-weight: 500;
|
| 227 |
-
}
|
| 228 |
-
|
| 229 |
-
.footer-text a:hover {
|
| 230 |
-
text-decoration: underline !important;
|
| 231 |
-
}
|
| 232 |
-
|
| 233 |
-
/* Mobile optimizations */
|
| 234 |
-
@media (max-width: 768px) {
|
| 235 |
-
.header-text h1 {
|
| 236 |
-
font-size: 1.8rem !important;
|
| 237 |
-
}
|
| 238 |
-
|
| 239 |
-
.header-text p {
|
| 240 |
-
font-size: 1rem !important;
|
| 241 |
-
}
|
| 242 |
-
}
|
| 243 |
-
|
| 244 |
-
/* Smooth transitions */
|
| 245 |
-
button, .gr-button {
|
| 246 |
-
transition: all 0.2s ease !important;
|
| 247 |
-
}
|
| 248 |
-
|
| 249 |
-
button:hover, .gr-button:hover {
|
| 250 |
-
transform: translateY(-1px);
|
| 251 |
-
box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15) !important;
|
| 252 |
-
}
|
| 253 |
-
|
| 254 |
-
/* Better spacing */
|
| 255 |
-
.gradio-container {
|
| 256 |
-
max-width: 1400px !important;
|
| 257 |
-
margin: 0 auto !important;
|
| 258 |
-
}
|
| 259 |
-
""",
|
| 260 |
footer_links=[
|
| 261 |
"api",
|
| 262 |
"gradio"
|
|
|
|
| 51 |
["Portrait of a wise old wizard with a long white beard, holding a glowing crystal staff, magical forest background"],
|
| 52 |
]
|
| 53 |
|
| 54 |
+
|
| 55 |
+
css = """
|
| 56 |
+
#col-container { max-width: 1000px; margin: 0 auto; }
|
| 57 |
+
.dark .progress-text { color: white !important; }
|
| 58 |
+
#examples { max-width: 1000px; margin: 0 auto; }
|
| 59 |
+
.dark #examples button,
|
| 60 |
+
.dark #examples .example,
|
| 61 |
+
.dark #examples span {
|
| 62 |
+
color: white !important;
|
| 63 |
+
}
|
| 64 |
+
"""
|
|
|
|
|
|
|
|
|
|
| 65 |
|
| 66 |
# Build the Gradio interface
|
| 67 |
with gr.Blocks(fill_height=True) as demo:
|
|
|
|
| 76 |
|
| 77 |
with gr.Row(equal_height=False):
|
| 78 |
# Left column - Input controls
|
| 79 |
+
with gr.Column(scale=1, min_width=320,elem_id="col-container"):
|
| 80 |
prompt = gr.Textbox(
|
| 81 |
label="✨ Your Prompt",
|
| 82 |
placeholder="Describe the image you want to create...",
|
|
|
|
| 164 |
interactive=False,
|
| 165 |
container=True,
|
| 166 |
)
|
| 167 |
+
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 168 |
|
| 169 |
# Connect the generate button
|
| 170 |
generate_btn.click(
|
|
|
|
| 182 |
|
| 183 |
if __name__ == "__main__":
|
| 184 |
demo.launch(
|
| 185 |
+
theme=gr.themes.Citrus(),
|
| 186 |
+
css=css,
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 187 |
footer_links=[
|
| 188 |
"api",
|
| 189 |
"gradio"
|