jiuface commited on
Commit
f7e0c7d
1 Parent(s): 036ee43
Files changed (1) hide show
  1. app.py +16 -7
app.py CHANGED
@@ -76,20 +76,29 @@ with gr.Blocks() as demo:
76
  '<DENSE_REGION_CAPTION>'
77
  ], value="<CAPTION_TO_PHRASE_GROUNDING>", label="Task Prompt", info="task prompts"
78
  ),
79
- text_input_component = gr.Textbox(label='Text prompt', placeholder='Enter text prompts')
80
- submit_button_component = gr.Button(value='Submit', variant='primary')
81
  with gr.Column():
82
- image_output_component = gr.Gallery(label="Generated images")
83
 
84
- submit_button_component.click(
85
  fn=process_image,
86
  inputs=[
87
  image,
88
  task_prompt,
89
- text_input_component
90
  ],
91
- outputs=image_output_component
 
 
 
 
 
 
 
 
 
92
  )
93
 
94
 
95
- demo.launch(debug=False, show_error=True)
 
76
  '<DENSE_REGION_CAPTION>'
77
  ], value="<CAPTION_TO_PHRASE_GROUNDING>", label="Task Prompt", info="task prompts"
78
  ),
79
+ text_prompt = gr.Textbox(label='Text prompt', placeholder='Enter text prompts')
80
+ submit_button = gr.Button(value='Submit', variant='primary')
81
  with gr.Column():
82
+ image_gallery = gr.Gallery(label="Generated images")
83
 
84
+ text_prompt.sumbit(
85
  fn=process_image,
86
  inputs=[
87
  image,
88
  task_prompt,
89
+ text_prompt
90
  ],
91
+ outputs=image_gallery
92
+ )
93
+ submit_button.click(
94
+ fn=process_image,
95
+ inputs=[
96
+ image,
97
+ task_prompt,
98
+ text_prompt
99
+ ],
100
+ outputs=image_gallery
101
  )
102
 
103
 
104
+ demo.launch(debug=True, show_error=True)