cleardusk commited on
Commit
0e9358c
1 Parent(s): 4f1874e

chore: use spaces.GPU for execute_image

Browse files
Files changed (2) hide show
  1. app.py +7 -2
  2. src/config/argument_config.py +3 -3
app.py CHANGED
@@ -151,7 +151,8 @@ with gr.Blocks(theme=gr.themes.Soft()) as demo:
151
  output_image_paste_back.render()
152
  # binding functions for buttons
153
  process_button_retargeting.click(
154
- fn=gradio_pipeline.execute_image,
 
155
  inputs=[eye_retargeting_slider, lip_retargeting_slider],
156
  outputs=[output_image, output_image_paste_back],
157
  show_progress=True
@@ -174,4 +175,8 @@ with gr.Blocks(theme=gr.themes.Soft()) as demo:
174
  outputs=[eye_retargeting_slider, lip_retargeting_slider, retargeting_input_image]
175
  )
176
 
177
- demo.launch()
 
 
 
 
 
151
  output_image_paste_back.render()
152
  # binding functions for buttons
153
  process_button_retargeting.click(
154
+ # fn=gradio_pipeline.execute_image,
155
+ fn=lambda *args: spaces.GPU()(gradio_pipeline.execute_image)(*args),
156
  inputs=[eye_retargeting_slider, lip_retargeting_slider],
157
  outputs=[output_image, output_image_paste_back],
158
  show_progress=True
 
175
  outputs=[eye_retargeting_slider, lip_retargeting_slider, retargeting_input_image]
176
  )
177
 
178
+ demo.launch(
179
+ server_port=args.server_port,
180
+ share=args.share,
181
+ server_name=args.server_name
182
+ )
src/config/argument_config.py CHANGED
@@ -39,6 +39,6 @@ class ArgumentConfig(PrintableConfig):
39
  ####################################
40
 
41
  ########## gradio arguments ##########
42
- server_port: Annotated[int, tyro.conf.arg(aliases=["-p"])] = 8890
43
- share: bool = True
44
- server_name: str = "0.0.0.0"
 
39
  ####################################
40
 
41
  ########## gradio arguments ##########
42
+ server_port: Annotated[int, tyro.conf.arg(aliases=["-p"])] = 7860
43
+ share: bool = False
44
+ server_name: str = None # one can set "0.0.0.0" on local