openfree commited on
Commit
d638803
1 Parent(s): 2818ef3

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +6 -5
app.py CHANGED
@@ -617,7 +617,7 @@ def infer_upscale(
617
 
618
  def check_upscale_input(input_image, *args):
619
  if input_image is None:
620
- return gr.update(visible=True), *args, gr.update(visible=True)
621
  return input_image, *args, gr.update(visible=False)
622
 
623
  with gr.Blocks(theme="Nymbo/Nymbo_Theme", css=css, delete_cache=(60, 3600)) as app:
@@ -694,7 +694,7 @@ with gr.Blocks(theme="Nymbo/Nymbo_Theme", css=css, delete_cache=(60, 3600)) as a
694
  # 업스케일 관련 UI 추가
695
  with gr.Row():
696
  upscale_button = gr.Button("Upscale")
697
-
698
  with gr.Row():
699
  with gr.Column(scale=4):
700
  upscale_input = gr.Image(label="Input Image for Upscaling", type="pil")
@@ -728,11 +728,13 @@ with gr.Blocks(theme="Nymbo/Nymbo_Theme", css=css, delete_cache=(60, 3600)) as a
728
  value=42,
729
  )
730
  upscale_randomize_seed = gr.Checkbox(label="Randomize seed for Upscaling", value=True)
731
-
 
732
  with gr.Row():
733
  upscale_result = gr.Image(label="Upscaled Image", type="pil")
734
  upscale_seed_output = gr.Number(label="Seed Used", precision=0)
735
 
 
736
  gallery.select(
737
  update_selection,
738
  inputs=[selected_indices, loras_state, width, height],
@@ -797,7 +799,7 @@ with gr.Blocks(theme="Nymbo/Nymbo_Theme", css=css, delete_cache=(60, 3600)) as a
797
  ).then(
798
  infer_upscale,
799
  inputs=[
800
- upscale_seed,
801
  upscale_randomize_seed,
802
  upscale_input,
803
  upscale_steps,
@@ -809,7 +811,6 @@ with gr.Blocks(theme="Nymbo/Nymbo_Theme", css=css, delete_cache=(60, 3600)) as a
809
  )
810
 
811
 
812
-
813
  if __name__ == "__main__":
814
  app.queue(max_size=20)
815
  app.launch(debug=True)
 
617
 
618
  def check_upscale_input(input_image, *args):
619
  if input_image is None:
620
+ return gr.update(), *args, gr.update(visible=True, value="Please provide an input image for upscaling.")
621
  return input_image, *args, gr.update(visible=False)
622
 
623
  with gr.Blocks(theme="Nymbo/Nymbo_Theme", css=css, delete_cache=(60, 3600)) as app:
 
694
  # 업스케일 관련 UI 추가
695
  with gr.Row():
696
  upscale_button = gr.Button("Upscale")
697
+
698
  with gr.Row():
699
  with gr.Column(scale=4):
700
  upscale_input = gr.Image(label="Input Image for Upscaling", type="pil")
 
728
  value=42,
729
  )
730
  upscale_randomize_seed = gr.Checkbox(label="Randomize seed for Upscaling", value=True)
731
+ upscale_error = gr.Markdown(visible=False, value="Please provide an input image for upscaling.")
732
+
733
  with gr.Row():
734
  upscale_result = gr.Image(label="Upscaled Image", type="pil")
735
  upscale_seed_output = gr.Number(label="Seed Used", precision=0)
736
 
737
+
738
  gallery.select(
739
  update_selection,
740
  inputs=[selected_indices, loras_state, width, height],
 
799
  ).then(
800
  infer_upscale,
801
  inputs=[
802
+ upscale_seed,
803
  upscale_randomize_seed,
804
  upscale_input,
805
  upscale_steps,
 
811
  )
812
 
813
 
 
814
  if __name__ == "__main__":
815
  app.queue(max_size=20)
816
  app.launch(debug=True)