meornabil commited on
Commit
164e0dd
1 Parent(s): 31c0eea

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +3 -3
app.py CHANGED
@@ -90,8 +90,8 @@ uploaded_file = st.file_uploader("Choose an image...", type=["jpg", "png", "jpeg
90
  # User selects model name, denoise strength, and other parameters
91
  model_name = st.selectbox("Model Name", ['RealESRGAN_x4plus', 'RealESRGAN_x4plus_anime_6B', 'RealESRGAN_x2plus'])
92
  denoise_strength = st.slider("Denoise Strength", 0.0, 1.0, 0.5)
93
- outscale = st.slider("Output Scale", 1, 4, 4)
94
- tile = 0
95
  tile_pad = 10
96
  pre_pad = 0
97
  face_enhance = st.checkbox("Face Enhance")
@@ -141,7 +141,7 @@ if uploaded_file is not None:
141
  output, _ = upsampler.enhance(img, outscale=outscale)
142
  except RuntimeError as error:
143
  st.error(f"Error: {error}")
144
- st.error('If you encounter CUDA out of memory, try to set --tile with a smaller number.')
145
  else:
146
  # Save and display the output image
147
  output_image_path = os.path.join("temp", "output_image.png")
 
90
  # User selects model name, denoise strength, and other parameters
91
  model_name = st.selectbox("Model Name", ['RealESRGAN_x4plus', 'RealESRGAN_x4plus_anime_6B', 'RealESRGAN_x2plus'])
92
  denoise_strength = st.slider("Denoise Strength", 0.0, 1.0, 0.5)
93
+ outscale = st.slider("Output Scale", 1, 4, 2) # Reduce output scale to 2
94
+ tile = st.slider("Tile Size", 0, 512, 256) # Add tile size slider
95
  tile_pad = 10
96
  pre_pad = 0
97
  face_enhance = st.checkbox("Face Enhance")
 
141
  output, _ = upsampler.enhance(img, outscale=outscale)
142
  except RuntimeError as error:
143
  st.error(f"Error: {error}")
144
+ st.error('If you encounter CUDA out of memory, try to set a smaller tile size.')
145
  else:
146
  # Save and display the output image
147
  output_image_path = os.path.join("temp", "output_image.png")