tuan2308 commited on
Commit
80d2919
1 Parent(s): 0b85d1d

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +3 -0
app.py CHANGED
@@ -99,6 +99,9 @@ def realesrgan(img, model_name, denoise_strength, face_enhance, outscale):
99
  print('If you encounter CUDA out of memory, try to set --tile with a smaller number.')
100
  else:
101
  # Save restored image and return it to the output Image component
 
 
 
102
  extension = 'jpg'
103
 
104
  out_filename = f"output_{rnd_string(8)}.{extension}"
 
99
  print('If you encounter CUDA out of memory, try to set --tile with a smaller number.')
100
  else:
101
  # Save restored image and return it to the output Image component
102
+ if img_mode == 'RGBA': # RGBA images should be saved in png format
103
+ extension = 'jpg'
104
+ else:
105
  extension = 'jpg'
106
 
107
  out_filename = f"output_{rnd_string(8)}.{extension}"