Spaces:
Runtime error
Runtime error
File size: 765 Bytes
e5bd8d8 |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 |
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)
|