openfree commited on
Commit
c990466
1 Parent(s): fb18855

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +35 -40
app.py CHANGED
@@ -726,7 +726,8 @@ with gr.Blocks(theme="Nymbo/Nymbo_Theme", css=css, delete_cache=(60, 3600)) as a
726
  upscale_result = gr.Image(label="Upscaled Image", type="pil")
727
  upscale_seed_output = gr.Number(label="Seed Used", precision=0)
728
 
729
- # Event handlers
 
730
  gallery.select(
731
  update_selection,
732
  inputs=[selected_indices, loras_state, width, height],
@@ -769,45 +770,39 @@ with gr.Blocks(theme="Nymbo/Nymbo_Theme", css=css, delete_cache=(60, 3600)) as a
769
  outputs=history_gallery,
770
  )
771
 
772
-
773
- def check_upscale_input(input_image, *args):
774
- if input_image is None:
775
- raise gr.Error("Please provide an input image for upscaling.")
776
- return input_image, *args
777
-
778
- upscale_button.click(
779
- check_upscale_input,
780
- inputs=[
781
- upscale_input,
782
- upscale_seed,
783
- upscale_randomize_seed,
784
- upscale_steps,
785
- upscale_factor,
786
- controlnet_conditioning_scale,
787
- ],
788
- outputs=[
789
- upscale_input,
790
- upscale_seed,
791
- upscale_randomize_seed,
792
- upscale_steps,
793
- upscale_factor,
794
- controlnet_conditioning_scale,
795
- ]
796
- ).then(
797
- infer_upscale,
798
- inputs=[
799
- upscale_seed,
800
- upscale_randomize_seed,
801
- upscale_input,
802
- upscale_steps,
803
- upscale_factor,
804
- controlnet_conditioning_scale,
805
- ],
806
- outputs=[upscale_result, upscale_seed_output],
807
- )
808
-
809
-
810
 
811
  if __name__ == "__main__":
812
  app.queue(max_size=20)
813
- app.launch(debug=True)
 
 
726
  upscale_result = gr.Image(label="Upscaled Image", type="pil")
727
  upscale_seed_output = gr.Number(label="Seed Used", precision=0)
728
 
729
+
730
+
731
  gallery.select(
732
  update_selection,
733
  inputs=[selected_indices, loras_state, width, height],
 
770
  outputs=history_gallery,
771
  )
772
 
773
+ # 업스케일 버튼 이벤트 추가 (이 부분을 gr.Blocks 컨텍스트 내부로 이동)
774
+ upscale_button.click(
775
+ check_upscale_input,
776
+ inputs=[
777
+ upscale_input,
778
+ upscale_seed,
779
+ upscale_randomize_seed,
780
+ upscale_steps,
781
+ upscale_factor,
782
+ controlnet_conditioning_scale,
783
+ ],
784
+ outputs=[
785
+ upscale_input,
786
+ upscale_seed,
787
+ upscale_randomize_seed,
788
+ upscale_steps,
789
+ upscale_factor,
790
+ controlnet_conditioning_scale,
791
+ ]
792
+ ).then(
793
+ infer_upscale,
794
+ inputs=[
795
+ upscale_seed,
796
+ upscale_randomize_seed,
797
+ upscale_input,
798
+ upscale_steps,
799
+ upscale_factor,
800
+ controlnet_conditioning_scale,
801
+ ],
802
+ outputs=[upscale_result, upscale_seed_output],
803
+ )
 
 
 
 
 
 
 
804
 
805
  if __name__ == "__main__":
806
  app.queue(max_size=20)
807
+ app.launch(debug=True)
808
+