atatakun commited on
Commit
25acb45
·
verified ·
1 Parent(s): 26ed789

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +4 -5
app.py CHANGED
@@ -228,15 +228,14 @@ model_inpaint = None
228
  def inpaint(image, invert):
229
  # image = resize_image(img, res)
230
  # color = HWC3(image["image"])
231
- color = HWC3(image["composite"])
232
  if(invert):
233
  # alpha = image["mask"][:, :, 0:1]
234
- alpha = image["background"][:, :, 0:1]
235
  else:
236
  # alpha = 255 - image["mask"][:, :, 0:1]
237
- alpha = 255 - image["background"][:, :, 0:1]
238
- # result = np.concatenate([color, alpha], axis=2)
239
- result = np.concatenate(color)
240
  return [result]
241
 
242
 
 
228
  def inpaint(image, invert):
229
  # image = resize_image(img, res)
230
  # color = HWC3(image["image"])
231
+ color = HWC3(image["backbround"])
232
  if(invert):
233
  # alpha = image["mask"][:, :, 0:1]
234
+ alpha = image["layers"][0][:, :, 0:1]
235
  else:
236
  # alpha = 255 - image["mask"][:, :, 0:1]
237
+ alpha = 255 - image["layers"][0][:, :, 0:1]
238
+ result = np.concatenate([color, alpha], axis=2)
 
239
  return [result]
240
 
241