danielgi97's picture
Update stable-app.py
b3dba55 verified
raw
history blame
347 Bytes
pip install difussers
import gradio as gr
from diffusers import StableDiffusionPipeline
import torch
def stable(prompt):
pipeline = DiffusionPipeline.from_pretrained("runwayml/stable-diffusion-v1-5", torch_dtype=torch.float32)
return pipeline(prompt).images[0]
demo = gr.Interface(fn=stable, inputs="text", outputs="image")
demo.launch()