sigyllly commited on
Commit
776f94c
·
verified ·
1 Parent(s): 24d11e8

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +6 -11
app.py CHANGED
@@ -56,7 +56,6 @@ def extract_image(pos_prompts, neg_prompts, img, threshold):
56
 
57
  return output_image, final_mask
58
 
59
- # Define Gradio interface
60
  # Define Gradio interface
61
  iface = gr.Interface(
62
  fn=extract_image,
@@ -69,18 +68,14 @@ iface = gr.Interface(
69
  label="Please describe what you want to ignore (comma separated)",
70
  key="neg_prompts",
71
  ),
72
- gr.Image(type="pil", label="Input Image"),
73
- gr.Slider(minimum=0, maximum=1, default=0.4, label="Threshold"),
74
  ],
75
  outputs=[
76
- gr.Image(label="Result"),
77
- gr.Image(label="Mask"),
78
  ],
79
  )
80
 
81
- # Launch Gradio API
82
- iface.launch()
83
-
84
-
85
- # Launch Gradio API
86
- iface.launch()
 
56
 
57
  return output_image, final_mask
58
 
 
59
  # Define Gradio interface
60
  iface = gr.Interface(
61
  fn=extract_image,
 
68
  label="Please describe what you want to ignore (comma separated)",
69
  key="neg_prompts",
70
  ),
71
+ gr.Image(type="pil", label="Input Image", key="img"),
72
+ gr.Slider(minimum=0, maximum=1, default=0.4, label="Threshold", key="threshold"),
73
  ],
74
  outputs=[
75
+ gr.Image(label="Result", key="output_image"),
76
+ gr.Image(label="Mask", key="output_mask"),
77
  ],
78
  )
79
 
80
+ # Launch Gradio API with an explicit endpoint
81
+ iface.launch(share=True, debug=True, host="0.0.0.0", port=7860, open_browser=False)