|
import gradio as gr |
|
from diffusers import DiffusionPipeline |
|
from PIL import Image |
|
|
|
|
|
model_id = "models/gouthaml/raos-virtual-try-on-model" |
|
pipe = DiffusionPipeline.from_pretrained(model_id) |
|
|
|
|
|
def virtual_tryon(person_image, dress_image): |
|
|
|
output_image = pipe(person_image, dress_image).images[0] |
|
|
|
return output_image |
|
|
|
|
|
iface = gr.Interface( |
|
fn=virtual_tryon, |
|
inputs=[gr.inputs.Image(type="pil"), gr.inputs.Image(type="pil")], |
|
outputs=gr.outputs.Image(type="pil"), |
|
title="Virtual Try-On", |
|
description="Upload a picture of a person and a dress, and see the result of the virtual try-on." |
|
) |
|
|
|
|
|
iface.launch() |
|
|