Spaces:
Build error
Build error
| from diffusers import StableDiffusionPipeline | |
| import torch | |
| import gradio as gr | |
| model_id = "runwayml/stable-diffusion-v1-5" | |
| pipe = StableDiffusionPipeline.from_pretrained(model_id, torch_dtype=torch.float16) | |
| def Gen(text): | |
| image = pipe(prompt).images[0] | |
| return image | |
| demo = gr.Interface( | |
| fn=Gen, | |
| inputs='text', | |
| outputs='image', | |
| ) | |
| demo.launch() | |