lichorosario commited on
Commit
41c6947
1 Parent(s): 9cfbb1d

Ajustar app.py para mejorar la funcionalidad de redimensionamiento de imágenes

Browse files
Files changed (1) hide show
  1. app.py +3 -3
app.py CHANGED
@@ -142,7 +142,7 @@ def upscale_image(image, resolution, num_inference_steps, strength, hdr, guidanc
142
  print(f"Loaded custom model from {tile_upscaler_url}")
143
  except ValueError as e:
144
  print(f"Failed to load custom model: {e}")
145
- client_custom_model = None
146
  raise gr.Error("Failed to load client for " + tile_upscaler_url)
147
 
148
  if (reduce_factor > 1):
@@ -151,7 +151,7 @@ def upscale_image(image, resolution, num_inference_steps, strength, hdr, guidanc
151
 
152
  try:
153
  result = client_tile_upscaler.predict(
154
- param_0=image,
155
  param_1=resolution,
156
  param_2=num_inference_steps,
157
  param_3=strength,
@@ -282,7 +282,7 @@ with gr.Blocks(css=css) as demo:
282
  enhace_button = gr.Button("Enhance Image")
283
 
284
  with gr.Column():
285
- output_slider = ImageSlider(label="Before / After", type="numpy", show_download_button=False)
286
 
287
  with gr.Accordion("Advanced Options", open=False):
288
  upscale_reduce_factor = gr.Slider(minimum=1, maximum=10, step=1, label="Reduce Factor", info="1/n")
 
142
  print(f"Loaded custom model from {tile_upscaler_url}")
143
  except ValueError as e:
144
  print(f"Failed to load custom model: {e}")
145
+ client_tile_upscaler = None
146
  raise gr.Error("Failed to load client for " + tile_upscaler_url)
147
 
148
  if (reduce_factor > 1):
 
151
 
152
  try:
153
  result = client_tile_upscaler.predict(
154
+ param_0=handle_file(image),
155
  param_1=resolution,
156
  param_2=num_inference_steps,
157
  param_3=strength,
 
282
  enhace_button = gr.Button("Enhance Image")
283
 
284
  with gr.Column():
285
+ output_slider = ImageSlider(label="Before / After", type="filepath", show_download_button=False)
286
 
287
  with gr.Accordion("Advanced Options", open=False):
288
  upscale_reduce_factor = gr.Slider(minimum=1, maximum=10, step=1, label="Reduce Factor", info="1/n")