Spaces:
Running
on
Zero
Running
on
Zero
Update app.py
Browse files
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}"
|