File size: 823 Bytes
0d823ff
 
 
 
ca09301
 
0d823ff
 
 
 
 
 
 
 
 
971809e
0d823ff
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
import gradio as gr
from diffusers import StableDiffusionPipeline
import torch

pipe = StableDiffusionPipeline.from_pretrained("MohamedRashad/diffusion_fashion", torch_dtype=torch.float32)
pipe.to("cpu")

def generate_image(text):
    images = pipe(text).images
    image = images[0]
    return image

diffusion_interface = gr.Interface(
    generate_image,
    gr.Textbox(lines=1, label="Input"),
    gr.Image(type="pil", label="Output"),
    title="Diffusion4Fashion: Generate cool clothes!",
    description="<center><p>Enter a description about a piece of cloth and the model will generate an image.</p></center>",
    examples=["A photo of a dress, made in 2019, color is Red, Casual usage, Women's cloth, something for the summer season, on white background"],
    cache_examples=True,
)

diffusion_interface.launch()