File size: 383 Bytes
0e3e7cd
c81af02
9f39446
 
aecf05e
f6a5180
c81af02
4a19cfa
c81af02
 
 
98d7c93
c81af02
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
import spaces
from diffusers import DiffusionPipeline
import torch
import gradio as gr

pipe = DiffusionPipeline.from_pretrained("Fucius/stable-diffusion-xl-base-1.0", torch_dtype=torch.float16, variant="fp16")
pipe.to('cuda')

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

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