File size: 347 Bytes
b3dba55
84328ed
f077d10
84328ed
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
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()