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="
Enter a description about a piece of cloth and the model will generate an image.