Andro0s commited on
Commit
fe595ff
verified
1 Parent(s): c62915d

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +8 -15
app.py CHANGED
@@ -1,16 +1,9 @@
1
- import gradio as grudge
2
- from basicsr.archs.rrdbnet_arch import RRDBNet
3
- from realesrgan import RealESRGANer
 
4
 
5
- # 1. Cargar el modelo de Super-Resoluci贸n
6
- model = RRDBNet(num_in_ch=3, num_out_ch=3, num_feat=64, num_block=23, num_grow_ch=32, scale=4)
7
- upsampler = RealESRGANer(scale=4, model_path='RealESRGAN_x4plus.pth', model=model)
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'