gokaygokay commited on
Commit
422fdbc
1 Parent(s): 0ca8aee

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +2 -6
app.py CHANGED
@@ -19,6 +19,7 @@ aura_sr = AuraSR.from_pretrained("fal/AuraSR-v2")
19
  # Restore original torch.load
20
  torch.load = original_load
21
 
 
22
  def process_image(input_image):
23
  if input_image is None:
24
  raise gr.Error("Please provide an image to upscale.")
@@ -26,8 +27,7 @@ def process_image(input_image):
26
  # Convert to PIL Image for resizing
27
  pil_image = Image.fromarray(input_image)
28
 
29
- # Upscale the image using AuraSR
30
- upscaled_image = process_image_on_gpu(pil_image)
31
 
32
  # Convert result to numpy array if it's not already
33
  result_array = np.array(upscaled_image)
@@ -35,10 +35,6 @@ def process_image(input_image):
35
  print(input_image, result_array)
36
 
37
  return [input_image, result_array]
38
-
39
- @spaces.GPU
40
- def process_image_on_gpu(pil_image):
41
- return aura_sr.upscale_4x(pil_image)
42
 
43
  title = """<h1 align="center">AuraSR</h1>
44
  <p><center>Upscales your images to x4</center></p>
 
19
  # Restore original torch.load
20
  torch.load = original_load
21
 
22
+ @spaces.GPU
23
  def process_image(input_image):
24
  if input_image is None:
25
  raise gr.Error("Please provide an image to upscale.")
 
27
  # Convert to PIL Image for resizing
28
  pil_image = Image.fromarray(input_image)
29
 
30
+ upscaled_image = aura_sr.upscale_4x(pil_image)
 
31
 
32
  # Convert result to numpy array if it's not already
33
  result_array = np.array(upscaled_image)
 
35
  print(input_image, result_array)
36
 
37
  return [input_image, result_array]
 
 
 
 
38
 
39
  title = """<h1 align="center">AuraSR</h1>
40
  <p><center>Upscales your images to x4</center></p>