File size: 318 Bytes
543b715
 
 
 
 
6bda091
543b715
 
 
 
1
2
3
4
5
6
7
8
9
10
import gradio as gr
from diffusers import DiffusionPipeline
import torch

def stable(promt):
    pipeline = DiffusionPipeline.from_pretrained("sd-legacy/stable-diffusion-v1-5", torch_dtype=torch.float32)
    return pipeline(promt).images[0]

demo = gr.Interface(fn=stable, inputs="text", outputs="image")
demo.launch()