Files changed (1) hide show
  1. app.py +2 -0
app.py CHANGED
@@ -1,3 +1,4 @@
 
1
  import gradio as gr
2
  import numpy as np
3
  import random
@@ -32,6 +33,7 @@ pipeline = pipeline.to(device)
32
  MAX_SEED = np.iinfo(np.int32).max
33
  MAX_IMAGE_SIZE = 768 # Reduce max image size to fit within memory constraints
34
 
 
35
  def infer(prompt, negative_prompt, seed, randomize_seed, width, height, guidance_scale, num_inference_steps):
36
  if randomize_seed:
37
  seed = random.randint(0, MAX_SEED)
 
1
+ +import spaces
2
  import gradio as gr
3
  import numpy as np
4
  import random
 
33
  MAX_SEED = np.iinfo(np.int32).max
34
  MAX_IMAGE_SIZE = 768 # Reduce max image size to fit within memory constraints
35
 
36
+ +@spaces.GPU
37
  def infer(prompt, negative_prompt, seed, randomize_seed, width, height, guidance_scale, num_inference_steps):
38
  if randomize_seed:
39
  seed = random.randint(0, MAX_SEED)