mirror of
https://github.com/lllyasviel/Fooocus.git
synced 2026-08-16 13:13:16 +02:00
17 lines
314 B
Python
17 lines
314 B
Python
from rembg import remove, new_session
|
|
|
|
|
|
def generate_mask_from_image(image, mask_model, extras):
|
|
if image is None:
|
|
return
|
|
|
|
if 'image' in image:
|
|
image = image['image']
|
|
|
|
return remove(
|
|
image,
|
|
session=new_session(mask_model),
|
|
only_mask=True,
|
|
**extras
|
|
)
|