Spaces:
Paused
Paused
Update app.py
Browse files
app.py
CHANGED
|
@@ -337,54 +337,59 @@ examples = [
|
|
| 337 |
|
| 338 |
output_image = gr.Image(label="Virtual Try-On Result")
|
| 339 |
|
| 340 |
-
|
| 341 |
-
|
| 342 |
-
|
|
|
|
|
|
|
|
|
|
| 343 |
|
| 344 |
-
with gr.
|
| 345 |
-
|
| 346 |
-
|
| 347 |
-
label="Style Description",
|
| 348 |
-
placeholder="Describe the desired style (e.g., 'person wearing elegant dress')"
|
| 349 |
-
)
|
| 350 |
with gr.Row():
|
| 351 |
-
with gr.
|
| 352 |
-
|
| 353 |
-
label="
|
| 354 |
-
|
| 355 |
-
)
|
| 356 |
-
gr.Markdown("*Upload a clear, well-lit full-body photo*")
|
| 357 |
-
depth_strength = gr.Slider(
|
| 358 |
-
minimum=0,
|
| 359 |
-
maximum=50,
|
| 360 |
-
value=15,
|
| 361 |
-
label="Fitting Strength"
|
| 362 |
)
|
| 363 |
-
|
| 364 |
-
|
| 365 |
-
|
| 366 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 367 |
)
|
| 368 |
-
|
| 369 |
-
|
| 370 |
-
|
| 371 |
-
maximum=1,
|
| 372 |
-
value=0.5,
|
| 373 |
-
label="Style Transfer Strength"
|
| 374 |
-
)
|
| 375 |
-
generate_btn = gr.Button("Generate Try-On")
|
| 376 |
-
|
| 377 |
-
gr.Examples(
|
| 378 |
-
examples=examples,
|
| 379 |
-
inputs=[prompt_input, structure_image, style_image, depth_strength, style_strength],
|
| 380 |
-
outputs=[output_image],
|
| 381 |
-
fn=generate_image,
|
| 382 |
-
cache_examples=True,
|
| 383 |
-
cache_mode="lazy"
|
| 384 |
-
)
|
| 385 |
-
|
| 386 |
-
with gr.Column():
|
| 387 |
-
output_image.render()
|
| 388 |
|
| 389 |
|
| 390 |
generate_btn.click(
|
|
|
|
| 337 |
|
| 338 |
output_image = gr.Image(label="Virtual Try-On Result")
|
| 339 |
|
| 340 |
+
# Gradio 인터페이스 생성
|
| 341 |
+
demo = gr.Blocks(theme="Yntec/HaleyCH_Theme_Orange")
|
| 342 |
+
|
| 343 |
+
with demo:
|
| 344 |
+
gr.Markdown("# 🎭 StyleGen : Fashion AI Studio")
|
| 345 |
+
gr.Markdown("Generate fashion images and try on virtual clothing using AI")
|
| 346 |
|
| 347 |
+
with gr.Tabs():
|
| 348 |
+
# Virtual Try-On 탭
|
| 349 |
+
with gr.TabItem("👔 Virtual Try-On"):
|
|
|
|
|
|
|
|
|
|
| 350 |
with gr.Row():
|
| 351 |
+
with gr.Column():
|
| 352 |
+
prompt_input = gr.Textbox(
|
| 353 |
+
label="Style Description",
|
| 354 |
+
placeholder="Describe the desired style (e.g., 'person wearing elegant dress')"
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 355 |
)
|
| 356 |
+
with gr.Row():
|
| 357 |
+
with gr.Group():
|
| 358 |
+
structure_image = gr.Image(
|
| 359 |
+
label="Your Photo (Full-body)",
|
| 360 |
+
type="filepath"
|
| 361 |
+
)
|
| 362 |
+
gr.Markdown("*Upload a clear, well-lit full-body photo*")
|
| 363 |
+
depth_strength = gr.Slider(
|
| 364 |
+
minimum=0,
|
| 365 |
+
maximum=50,
|
| 366 |
+
value=15,
|
| 367 |
+
label="Fitting Strength"
|
| 368 |
+
)
|
| 369 |
+
with gr.Group():
|
| 370 |
+
style_image = gr.Image(
|
| 371 |
+
label="Clothing Item",
|
| 372 |
+
type="filepath"
|
| 373 |
+
)
|
| 374 |
+
gr.Markdown("*Upload the clothing item you want to try on*")
|
| 375 |
+
style_strength = gr.Slider(
|
| 376 |
+
minimum=0,
|
| 377 |
+
maximum=1,
|
| 378 |
+
value=0.5,
|
| 379 |
+
label="Style Transfer Strength"
|
| 380 |
+
)
|
| 381 |
+
tryon_btn = gr.Button("Generate Try-On")
|
| 382 |
+
|
| 383 |
+
gr.Examples(
|
| 384 |
+
examples=examples,
|
| 385 |
+
inputs=[prompt_input, structure_image, style_image, depth_strength, style_strength],
|
| 386 |
+
outputs=output_image,
|
| 387 |
+
fn=generate_image,
|
| 388 |
+
cache_examples=False
|
| 389 |
)
|
| 390 |
+
|
| 391 |
+
with gr.Column():
|
| 392 |
+
output_image = gr.Image(label="Virtual Try-On Result")
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 393 |
|
| 394 |
|
| 395 |
generate_btn.click(
|