Spaces:
Runtime error
Runtime error
| import gradio as gr | |
| from diffusers import StableDiffusionPipeline | |
| import torch | |
| # Load the model on CPU instead of GPU | |
| pipe = StableDiffusionPipeline.from_pretrained("sivar/legostyle1-5") | |
| pipe = pipe.to("cpu") | |
| def infer(prompt): | |
| image = pipe(prompt).images[0] | |
| return image | |
| gr.Interface(fn=infer, inputs="text", outputs="image").launch(share=True) | |