Spaces:
Runtime error
Runtime error
| from diffusers import StableDiffusionPipeline | |
| import torch | |
| import gradio as gr | |
| def run(prompt): | |
| model_id = "runwayml/stable-diffusion-v1-5" | |
| pipe = StableDiffusionPipeline.from_pretrained(model_id, torch_dtype=torch.float16) | |
| # pipe = pipe.to("cuda") | |
| image = pipe(prompt).images[0] | |
| return image | |
| gr.Interface( | |
| run, | |
| title = 'Text-To-Image', | |
| inputs="text", | |
| outputs = "image" | |
| ).launch() |