Try-Space / app.py
feylur's picture
Update app.py
e12eb26 verified
raw
history blame contribute delete
765 Bytes
import gradio as gr
from PIL import Image
from inference import get_pipeline
def tryon(person_img, cloth_img):
pipeline = get_pipeline()
result, meta = pipeline.run_inference(person_img, cloth_img, num_steps=25)
return result, f"Seed: {meta['seed']} | Time: {meta['timings']['total_ms']} ms"
demo = gr.Interface(
fn=tryon,
inputs=[gr.Image(type="pil", label="Person"), gr.Image(type="pil", label="Garment")],
outputs=[gr.Image(type="pil", label="Result"), gr.Textbox(label="Metadata")],
title="CatVTON Virtual Try-On",
description="Upload a person image and a garment image to visualize the CatVTON try-on result.",
allow_flagging="never",
)
if __name__ == "__main__":
demo.launch(server_name="0.0.0.0", server_port=7860)