Spaces:
Running
on
Zero
Running
on
Zero
Update app.py
Browse files
app.py
CHANGED
@@ -237,20 +237,63 @@ HEADER = """
|
|
237 |
· Thanks to <a href="https://huggingface.co/zero-gpu-explorers">ZeroGPU</a> for providing A100 for our <a href="https://huggingface.co/spaces/zhengchong/CatVTON">HuggingFace Space</a>. <br>
|
238 |
· SafetyChecker is set to filter NSFW content, but it may block normal results too. Please adjust the <span>`seed`</span> for normal outcomes.<br>
|
239 |
"""
|
240 |
-
|
241 |
def app_gradio():
|
242 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
243 |
gr.Markdown(
|
244 |
"""
|
245 |
-
<div style="text-align: center; background
|
246 |
-
<h1 style="color: white;">Deradh Virtual Try-On Experience</h1>
|
247 |
<div style="margin: 1rem 0;">
|
248 |
-
<a href="https://deradh.com" style="color: white; text-decoration:
|
249 |
Visit Deradh.com
|
250 |
</a>
|
251 |
</div>
|
252 |
</div>
|
253 |
-
<div style="text-align: center; padding: 1rem; color: #1a237e;">
|
254 |
Experience the future of fashion with our AI-powered virtual try-on technology
|
255 |
</div>
|
256 |
"""
|
@@ -279,7 +322,16 @@ def app_gradio():
|
|
279 |
)
|
280 |
with gr.Column(scale=1, min_width=120):
|
281 |
gr.Markdown(
|
282 |
-
'
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
283 |
)
|
284 |
cloth_type = gr.Radio(
|
285 |
label="Garment Type",
|
@@ -289,11 +341,27 @@ def app_gradio():
|
|
289 |
|
290 |
submit = gr.Button("Try On", elem_classes="primary-btn")
|
291 |
gr.Markdown(
|
292 |
-
'
|
|
|
|
|
|
|
|
|
|
|
293 |
)
|
294 |
|
295 |
gr.Markdown(
|
296 |
-
'
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
297 |
)
|
298 |
with gr.Accordion("Advanced Settings", open=False):
|
299 |
num_inference_steps = gr.Slider(
|
@@ -402,4 +470,4 @@ def app_gradio():
|
|
402 |
|
403 |
|
404 |
if __name__ == "__main__":
|
405 |
-
app_gradio()
|
|
|
237 |
· Thanks to <a href="https://huggingface.co/zero-gpu-explorers">ZeroGPU</a> for providing A100 for our <a href="https://huggingface.co/spaces/zhengchong/CatVTON">HuggingFace Space</a>. <br>
|
238 |
· SafetyChecker is set to filter NSFW content, but it may block normal results too. Please adjust the <span>`seed`</span> for normal outcomes.<br>
|
239 |
"""
|
|
|
240 |
def app_gradio():
|
241 |
+
custom_css = """
|
242 |
+
button.primary-btn {
|
243 |
+
background: linear-gradient(135deg, #2541b2 0%, #1a237e 100%);
|
244 |
+
transition: all 0.3s ease;
|
245 |
+
border: none;
|
246 |
+
box-shadow: 0 2px 4px rgba(0,0,0,0.1);
|
247 |
+
}
|
248 |
+
button.primary-btn:hover {
|
249 |
+
transform: translateY(-2px);
|
250 |
+
box-shadow: 0 4px 8px rgba(0,0,0,0.2);
|
251 |
+
}
|
252 |
+
.gr-button {
|
253 |
+
background: linear-gradient(135deg, #2541b2 0%, #1a237e 100%);
|
254 |
+
color: white;
|
255 |
+
border: none;
|
256 |
+
transition: all 0.3s ease;
|
257 |
+
}
|
258 |
+
.gr-button:hover {
|
259 |
+
opacity: 0.9;
|
260 |
+
transform: translateY(-2px);
|
261 |
+
}
|
262 |
+
body {
|
263 |
+
background: linear-gradient(135deg, #f8f9fa 0%, #e8eaf6 100%);
|
264 |
+
}
|
265 |
+
.container {
|
266 |
+
border-radius: 12px;
|
267 |
+
box-shadow: 0 4px 6px rgba(0,0,0,0.1);
|
268 |
+
}
|
269 |
+
.gr-form {
|
270 |
+
border-radius: 8px;
|
271 |
+
background: white;
|
272 |
+
box-shadow: 0 2px 4px rgba(0,0,0,0.05);
|
273 |
+
}
|
274 |
+
.gr-radio-group {
|
275 |
+
background: white;
|
276 |
+
padding: 12px;
|
277 |
+
border-radius: 8px;
|
278 |
+
}
|
279 |
+
.gr-accordion {
|
280 |
+
border-radius: 8px;
|
281 |
+
overflow: hidden;
|
282 |
+
}
|
283 |
+
"""
|
284 |
+
|
285 |
+
with gr.Blocks(title="Deradh Virtual Try-On", css=custom_css) as demo:
|
286 |
gr.Markdown(
|
287 |
"""
|
288 |
+
<div style="text-align: center; background: linear-gradient(135deg, #2541b2 0%, #1a237e 100%); padding: 2.5rem; color: white; border-radius: 0 0 20px 20px; margin-bottom: 2rem; box-shadow: 0 4px 6px rgba(0,0,0,0.1);">
|
289 |
+
<h1 style="color: white; font-size: 2.5rem; font-weight: 600; margin-bottom: 1rem;">Deradh Virtual Try-On Experience</h1>
|
290 |
<div style="margin: 1rem 0;">
|
291 |
+
<a href="https://deradh.com" style="color: white; text-decoration: none; padding: 0.5rem 1rem; border: 2px solid white; border-radius: 25px; transition: all 0.3s ease;">
|
292 |
Visit Deradh.com
|
293 |
</a>
|
294 |
</div>
|
295 |
</div>
|
296 |
+
<div style="text-align: center; padding: 1rem; color: #1a237e; font-size: 1.2rem; font-weight: 500; margin-bottom: 2rem;">
|
297 |
Experience the future of fashion with our AI-powered virtual try-on technology
|
298 |
</div>
|
299 |
"""
|
|
|
322 |
)
|
323 |
with gr.Column(scale=1, min_width=120):
|
324 |
gr.Markdown(
|
325 |
+
'''
|
326 |
+
<div style="color: white; background: linear-gradient(135deg, #2541b2 0%, #1a237e 100%);
|
327 |
+
padding: 1.2rem; border-radius: 8px; box-shadow: 0 2px 4px rgba(0,0,0,0.1);">
|
328 |
+
<h3 style="margin: 0 0 0.8rem 0; color: white;">Mask Options:</h3>
|
329 |
+
<ol style="margin: 0; padding-left: 1.2rem;">
|
330 |
+
<li>Draw mask using the editor above</li>
|
331 |
+
<li>Auto-generate based on garment type</li>
|
332 |
+
</ol>
|
333 |
+
</div>
|
334 |
+
'''
|
335 |
)
|
336 |
cloth_type = gr.Radio(
|
337 |
label="Garment Type",
|
|
|
341 |
|
342 |
submit = gr.Button("Try On", elem_classes="primary-btn")
|
343 |
gr.Markdown(
|
344 |
+
'''
|
345 |
+
<div style="text-align: center; color: #1a237e; font-weight: 500; margin: 1rem 0;
|
346 |
+
padding: 0.8rem; background: white; border-radius: 8px; box-shadow: 0 2px 4px rgba(0,0,0,0.05);">
|
347 |
+
Please wait after clicking Try On - Processing may take a moment
|
348 |
+
</div>
|
349 |
+
'''
|
350 |
)
|
351 |
|
352 |
gr.Markdown(
|
353 |
+
'''
|
354 |
+
<div style="background: linear-gradient(135deg, #2541b2 0%, #1a237e 100%);
|
355 |
+
color: white; padding: 1.2rem; border-radius: 8px; margin-top: 1rem;
|
356 |
+
box-shadow: 0 2px 4px rgba(0,0,0,0.1);">
|
357 |
+
<h3 style="margin: 0 0 0.8rem 0; color: white;">Advanced Settings:</h3>
|
358 |
+
<ul style="margin: 0; padding-left: 1.2rem;">
|
359 |
+
<li>Increase Steps for higher quality</li>
|
360 |
+
<li>Adjust CFG for color intensity</li>
|
361 |
+
<li>Change Seed for different variations</li>
|
362 |
+
</ul>
|
363 |
+
</div>
|
364 |
+
'''
|
365 |
)
|
366 |
with gr.Accordion("Advanced Settings", open=False):
|
367 |
num_inference_steps = gr.Slider(
|
|
|
470 |
|
471 |
|
472 |
if __name__ == "__main__":
|
473 |
+
app_gradio()
|