fffiloni commited on
Commit
1509ea2
1 Parent(s): 9bb4f06

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +2 -0
app.py CHANGED
@@ -1,4 +1,5 @@
1
  import gradio as gr
 
2
  from diffusers import StableDiffusionXLPipeline, UNet2DConditionModel
3
  import torch
4
 
@@ -15,6 +16,7 @@ pipe = pipe.to("cuda")
15
  pipe.enable_model_cpu_offload()
16
  pipe.enable_vae_slicing()
17
 
 
18
  def infer(prompt):
19
  image = pipe(prompt, guidance_scale=7.5).images[0]
20
  return image
 
1
  import gradio as gr
2
+ import spaces
3
  from diffusers import StableDiffusionXLPipeline, UNet2DConditionModel
4
  import torch
5
 
 
16
  pipe.enable_model_cpu_offload()
17
  pipe.enable_vae_slicing()
18
 
19
+ @spaces.GPU
20
  def infer(prompt):
21
  image = pipe(prompt, guidance_scale=7.5).images[0]
22
  return image