Norod78 commited on
Commit
e85c4c0
1 Parent(s): 6d64c42

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +2 -0
app.py CHANGED
@@ -1,6 +1,7 @@
1
  from diffusers import StableDiffusionPipeline, StableDiffusionImg2ImgPipeline, UniPCMultistepScheduler
2
  import gradio as gr
3
  import torch
 
4
  from PIL import Image
5
 
6
  model_id = 'Norod78/sd2-simpsons-blip'
@@ -26,6 +27,7 @@ def error_str(error, title="Error"):
26
  return f"""#### {title}
27
  {error}""" if error else ""
28
 
 
29
  def inference(prompt, guidance, steps, width=512, height=512, seed=0, img=None, strength=0.5, neg_prompt=""):
30
 
31
  if torch.cuda.is_available():
 
1
  from diffusers import StableDiffusionPipeline, StableDiffusionImg2ImgPipeline, UniPCMultistepScheduler
2
  import gradio as gr
3
  import torch
4
+ import spaces
5
  from PIL import Image
6
 
7
  model_id = 'Norod78/sd2-simpsons-blip'
 
27
  return f"""#### {title}
28
  {error}""" if error else ""
29
 
30
+ @spaces.GPU
31
  def inference(prompt, guidance, steps, width=512, height=512, seed=0, img=None, strength=0.5, neg_prompt=""):
32
 
33
  if torch.cuda.is_available():