infery
← All models

Birefnet Background Removal V2

birefnet-v2

Image editby Birefnet

bilateral reference framework (BiRefNet) for high-resolution dichotomous image segmentation (DIS)

images

Details

Accepts
image

Pricing

Price
0.100 cr / second

Prices in credits (1 credit = $0.01).

Data schema

Input

FieldTypeDescription
modelstringenum: General Use (Light), General Use (Light 2K), General Use (Heavy), Matting, Portrait, General Use (Dynamic) Model to use for background removal. The 'General Use (Light)' model is the original model used in the BiRefNet repository. The 'General Use (Light 2K)' model is the original model used in the BiRefNet repository but trained with 2K images. The 'Gener…
image_urlrequiredstringURL of the image to remove background from
mask_onlybooleanWhether to return only the segmentation mask without applying it to the image. When set to `True`, only the mask will be returned and foreground refinement will be skipped. Useful for reducing computation and data transfer when only the mask is needed.
sync_modebooleanIf `True`, the media will be returned as a data URI and the output data won't be available in the request history.
output_maskbooleanWhether to output the mask used to remove the background
output_formatstringenum: webp, png, gifThe format of the output image
refine_foregroundbooleanWhether to refine the foreground using the estimated mask
operating_resolutionstringenum: 1024x1024, 2048x2048, 2304x2304The resolution to operate on. The higher the resolution, the more accurate the output will be for high res input images. The '2304x2304' option is only available for the 'General Use (Dynamic)' model.

Output

FieldTypeDescription
imageImage with background removed. When `mask_only` is `True`, this contains the segmentation mask instead.
mask_imageMask used to remove the background