File size: 889 Bytes
3524366
4af1097
3524366
 
4af1097
a9452a7
4af1097
3524366
 
 
4af1097
 
3524366
4af1097
3524366
 
 
4af1097
 
 
3524366
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
import gradio as gr
from diffusers import DiffusionPipeline
from PIL import Image

# Load your diffusion model
model_id = "models/gouthaml/raos-virtual-try-on-model"  # Update with the correct model ID
pipe = DiffusionPipeline.from_pretrained(model_id)

# Function to handle the virtual try-on process
def virtual_tryon(person_image, dress_image):
    # Call the model to generate the virtual try-on result
    output_image = pipe(person_image, dress_image).images[0]  # Update based on actual pipeline usage

    return output_image

# Define Gradio interface
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."
)

# Launch the interface
iface.launch()