Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -1,16 +1,9 @@
|
|
| 1 |
-
import gradio as
|
| 2 |
-
from
|
| 3 |
-
|
|
|
|
| 4 |
|
| 5 |
-
#
|
| 6 |
-
|
| 7 |
-
|
| 8 |
-
|
| 9 |
-
def upscale_image(input_img):
|
| 10 |
-
# 2. El proceso de mejora de calidad
|
| 11 |
-
output, _ = upsampler.enhance(input_img, outscale=4)
|
| 12 |
-
return output
|
| 13 |
-
|
| 14 |
-
# 3. Interfaz de usuario
|
| 15 |
-
demo = gr.Interface(fn=upscale_image, inputs="image", outputs="image")
|
| 16 |
-
demo.launch()
|
|
|
|
| 1 |
+
import gradio as gr
|
| 2 |
+
from PIL import Image
|
| 3 |
+
import torch
|
| 4 |
+
from diffusers import StableDiffusionUpscalePipeline
|
| 5 |
|
| 6 |
+
# Cargamos el modelo (esto se hace una sola vez al arrancar)
|
| 7 |
+
model_id = "ai-forever/Real-ESRGAN"
|
| 8 |
+
# Nota: Si prefieres usar una implementaci贸n m谩s directa de Real-ESRGAN
|
| 9 |
+
# puedes usar librer铆as como 'basicsr' o 'realesrgan'
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|