Update app.py
Browse files
app.py
CHANGED
@@ -328,6 +328,12 @@ def generate_image(prompt, structure_image, style_image, depth_strength=15, styl
|
|
328 |
saved_path = f"output/{saved['ui']['images'][0]['filename']}"
|
329 |
return saved_path
|
330 |
|
|
|
|
|
|
|
|
|
|
|
|
|
331 |
# Create Gradio interface
|
332 |
examples = [
|
333 |
["person wearing fashionable clothing", "f1.webp", "f11.webp", 15, 0.6],
|
@@ -335,8 +341,6 @@ examples = [
|
|
335 |
["person wearing casual outfit", "f3.webp", "f31.webp", 15, 0.5],
|
336 |
]
|
337 |
|
338 |
-
output_image = gr.Image(label="Virtual Try-On Result")
|
339 |
-
|
340 |
# Gradio ์ธํฐํ์ด์ค ์์ฑ
|
341 |
demo = gr.Blocks(theme="Yntec/HaleyCH_Theme_Orange")
|
342 |
|
@@ -378,34 +382,26 @@ with demo:
|
|
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 |
-
|
396 |
-
|
397 |
-
|
398 |
-
|
399 |
-
|
400 |
-
|
401 |
-
|
402 |
-
|
403 |
-
|
404 |
-
|
405 |
-
|
406 |
-
|
407 |
-
|
|
|
|
|
408 |
|
409 |
if __name__ == "__main__":
|
410 |
-
demo.launch(share=True)
|
411 |
-
|
|
|
328 |
saved_path = f"output/{saved['ui']['images'][0]['filename']}"
|
329 |
return saved_path
|
330 |
|
331 |
+
|
332 |
+
|
333 |
+
output_image = gr.Image(label="Virtual Try-On Result")
|
334 |
+
|
335 |
+
|
336 |
+
|
337 |
# Create Gradio interface
|
338 |
examples = [
|
339 |
["person wearing fashionable clothing", "f1.webp", "f11.webp", 15, 0.6],
|
|
|
341 |
["person wearing casual outfit", "f3.webp", "f31.webp", 15, 0.5],
|
342 |
]
|
343 |
|
|
|
|
|
344 |
# Gradio ์ธํฐํ์ด์ค ์์ฑ
|
345 |
demo = gr.Blocks(theme="Yntec/HaleyCH_Theme_Orange")
|
346 |
|
|
|
382 |
value=0.5,
|
383 |
label="Style Transfer Strength"
|
384 |
)
|
|
|
385 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
386 |
with gr.Column():
|
387 |
output_image = gr.Image(label="Virtual Try-On Result")
|
388 |
+
|
389 |
+
generate_button = gr.Button("Generate Try-On")
|
390 |
+
|
391 |
+
gr.Examples(
|
392 |
+
examples=examples,
|
393 |
+
inputs=[prompt_input, structure_image, style_image, depth_strength, style_strength],
|
394 |
+
outputs=output_image,
|
395 |
+
fn=generate_image,
|
396 |
+
cache_examples=False
|
397 |
+
)
|
398 |
+
|
399 |
+
# Connect the button to the generation function
|
400 |
+
generate_button.click(
|
401 |
+
fn=generate_image,
|
402 |
+
inputs=[prompt_input, structure_image, style_image, depth_strength, style_strength],
|
403 |
+
outputs=output_image
|
404 |
+
)
|
405 |
|
406 |
if __name__ == "__main__":
|
407 |
+
demo.launch(share=True)
|
|