ginipick commited on
Commit
4af64e1
·
verified ·
1 Parent(s): d819968

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +6 -5
app.py CHANGED
@@ -231,21 +231,22 @@ def process_prompt(img: Image.Image, prompt: str, bg_prompt: str | None = None)
231
  raise gr.Error(str(e))
232
 
233
 
 
234
  def update_process_button(img, prompt):
235
- return gr.Button.update(
236
  interactive=bool(img and prompt),
237
  variant="primary" if bool(img and prompt) else "secondary"
238
  )
239
-
240
  def update_box_button(img, box_input):
241
  try:
242
  if img and box_input:
243
  coords = eval(box_input)
244
  if isinstance(coords, list) and len(coords) == 4:
245
- return gr.Button.update(interactive=True, variant="primary")
246
- return gr.Button.update(interactive=False, variant="secondary")
247
  except:
248
- return gr.Button.update(interactive=False, variant="secondary")
249
 
250
 
251
  # 맨 앞부분에 CSS 정의 추가
 
231
  raise gr.Error(str(e))
232
 
233
 
234
+ # Event handler functions 수정
235
  def update_process_button(img, prompt):
236
+ return gr.update(
237
  interactive=bool(img and prompt),
238
  variant="primary" if bool(img and prompt) else "secondary"
239
  )
240
+
241
  def update_box_button(img, box_input):
242
  try:
243
  if img and box_input:
244
  coords = eval(box_input)
245
  if isinstance(coords, list) and len(coords) == 4:
246
+ return gr.update(interactive=True, variant="primary")
247
+ return gr.update(interactive=False, variant="secondary")
248
  except:
249
+ return gr.update(interactive=False, variant="secondary")
250
 
251
 
252
  # 맨 앞부분에 CSS 정의 추가