Spaces:
Sleeping
Sleeping
File size: 335 Bytes
b6ec94d b3d6295 407e2a3 b6ec94d |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 |
import spaces
import gradio as gr
from diffusers import StableDiffusionPipeline
pipe = StableDiffusionPipeline.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()
|