falImageComing soon

fal-ai/birefnet

fal-ai/birefnet is an image tool from fal that runs in the background and returns images. Coming soon: listed with its price, not yet open to runs.

This tool is listed but not yet available to run.

Pricing

Coming soon

Price pending

Limits

Runs
In the background
Returns
image
Longest queue wait
1 hour
Run deadline
30 minutes
Longest run, end to end
225 minutes
Largest inline input
1 MB
Largest input file
500 MB
Largest output
5 GB
Outputs per run
16

Input

FieldKindDefaultDescription
modelone of
General Use (Light), General Use (Heavy), Portrait
General Use (Light)

Model to use for background removal.

The 'General Use (Light)' model is the original model used in the BiRefNet repository.

The 'General Use (Heavy)' model is a slower but more accurate model.

The 'Portrait' model is a model trained specifically for portrait images.

The 'General Use (Light)' model is recommended for most use cases.

The corresponding models are as follows:

  • 'General Use (Light)': BiRefNet-DIS_ep580.pth
  • 'General Use (Heavy)': BiRefNet-massive-epoch_240.pth
  • 'Portrait': BiRefNet-portrait-TR_P3M_10k-epoch_120.pth
operating_resolutionone of
1024x1024, 2048x2048
1024x1024

The resolution to operate on. The higher the resolution, the more accurate the output will be for high res input images.

output_masktrue or falsefalse

Whether to output the mask used to remove the background

refine_foregroundtrue or falsetrue

Whether to refine the foreground using the estimated mask

image_url requiredURL or file—

URL of the image to remove background from

output_formatone of
webp, png, gif
png

The format of the output image

Same request in code

curl https://api.spiral.ai/v1/runs \
  -H "Authorization: Bearer $SPIRAL_API_KEY" \
  -H "Content-Type: application/json" \
  -H "Idempotency-Key: $(uuidgen)" \
  -d '{
    "provider": "fal",
    "model": "fal-ai/birefnet",
    "input": {
      "image_url": "https://storage.googleapis.com/falserverless/example_inputs/birefnet-input.jpeg"
    }
  }'