Lego-Expert / app.py
Jacob32243244's picture
Update app.py
e298350 verified
raw
history blame contribute delete
357 Bytes
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)