ehristoforu commited on
Commit
762033d
·
1 Parent(s): ef27564

Update main.py

Browse files
Files changed (1) hide show
  1. main.py +2 -26
main.py CHANGED
@@ -7,7 +7,6 @@ import requests
7
  import random
8
  from datetime import datetime
9
  import os
10
- from rembg import remove
11
 
12
 
13
  prodia_key = os.getenv('PRODIA_X_KEY', None)
@@ -46,9 +45,6 @@ def process_input_img2img(init, prompt, negative_prompt, steps, cfg_scale, numbe
46
  f.write(img_data)
47
  return images
48
 
49
- def segment(image):
50
- return remove(image)
51
-
52
  """
53
  def process_input_control(init, prompt, negative_prompt, steps, cfg_scale, number, seed, model, control_model, sampler):
54
  images = []
@@ -208,29 +204,9 @@ with gr.Blocks(theme=theme) as demo:
208
  outputs=[result_image],
209
  )
210
 
211
- with gr.Tab("Remove Background"):
212
- with gr.Row():
213
-
214
- with gr.Column():
215
- i_img = gr.Image(label="Input Image")
216
-
217
- with gr.Row():
218
-
219
- with gr.Column():
220
- run_btn = gr.Button("Remove", variant="primary")
221
-
222
- with gr.Row():
223
 
224
- with gr.Column():
225
- o_img = gr.Image(label="Result Image")
226
-
227
- run_btn.click(
228
- segment,
229
- inputs=[
230
- i_img,
231
- ],
232
- outputs=[o_img],
233
- )
234
 
235
  with gr.Tab(label="Gallery"):
236
 
 
7
  import random
8
  from datetime import datetime
9
  import os
 
10
 
11
 
12
  prodia_key = os.getenv('PRODIA_X_KEY', None)
 
45
  f.write(img_data)
46
  return images
47
 
 
 
 
48
  """
49
  def process_input_control(init, prompt, negative_prompt, steps, cfg_scale, number, seed, model, control_model, sampler):
50
  images = []
 
204
  outputs=[result_image],
205
  )
206
 
207
+ with gr.Tab(label="Remove Background"):
 
 
 
 
 
 
 
 
 
 
 
208
 
209
+ gr.load("hardon-server/remove-background-on-image-def", src="spaces")
 
 
 
 
 
 
 
 
 
210
 
211
  with gr.Tab(label="Gallery"):
212