README / app.py
Tac39's picture
Update app.py
1988fd5 verified
Raw History Blame Contribute Delete
440 Bytes
import gradio as gr
import torch
from diffusers import StableDiffusionPipeline
pipe = StableDiffusionPipeline.from_pretrained(
"dreamlike-art/dreamlike-photoreal-2.0",
force_download=True
)
pipe = pipe.to("cpu")
def generate_image(prompt):
image = pipe(prompt, height=256, width=256).images[0]
return image
gr.Interface(fn=generate_image, inputs="text", outputs="image", title="Stable Diffusion Image Generator").launch()