File size: 334 Bytes
3cf5640
7352753
 
 
 
cd0ef8f
 
8453b06
cd0ef8f
3cf5640
cd0ef8f
 
 
7352753
cd0ef8f
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
import spaces

import cv2
import gradio as gr

from diffusers import DiffusionPipeline

pipe = DiffusionPipeline.from_pretrained("CompVis/stable-diffusion-v1-4")
pipe.to('cuda')

@spaces.GPU
def generate(prompt):
    return pipe(prompt).images

gr.Interface(
    fn=generate,
    inputs=gr.Text(),
    outputs=gr.Gallery(),
).launch()