# BiRefNet v2 background removal

Needs image url. Served by fal.ai.

BiRefNet v2, background removal, served by fal.ai. The OpenAPI schema for the fal-ai/birefnet/v2 queue. Price: Page states $0 per compute second at the time of writing. Waits up to 40 s for the result; if the generation takes longer, the run stays RUNNING and returns a request_id; poll fal/status and fetch fal/result with model "fal-ai/birefnet" and that request_id. Billed once, when the result is ready; a generation that fails is refunded.

- Tool ID: `fal/birefnet-v2`
- Name in the catalog: BiRefNet v2, background removal
- Provider: [fal.ai](/providers/fal.md)
- Capability: [Background removal](/tools/image-generation/background-removal.md)
- Price: no charge per call
- Authentication: an authorised Agentik workspace is required for execution, including zero-price tools.

## Pricing contract

No charge per call. A workspace is still needed so your agent can call it.


```json
{
  "model": "per_call",
  "amountUsd": 0
}
```

Pricing source: [https://fal.ai/models/fal-ai/birefnet/v2](https://fal.ai/models/fal-ai/birefnet/v2). Page states $0 per compute second at the time of writing..

## Complete input schema


```json
{
  "type": "object",
  "properties": {
    "output_format": {
      "enum": [
        "webp",
        "png",
        "gif"
      ],
      "description": "The format of the output image",
      "default": "png",
      "type": "string",
      "title": "Output Format"
    },
    "refine_foreground": {
      "default": true,
      "description": "Whether to refine the foreground using the estimated mask",
      "type": "boolean",
      "title": "Refine Foreground"
    },
    "image_url": {
      "title": "Image Url",
      "description": "URL of the image to remove background from",
      "_fal_ui_field": "image",
      "type": "string"
    },
    "output_mask": {
      "default": false,
      "description": "Whether to output the mask used to remove the background",
      "type": "boolean",
      "title": "Output Mask"
    },
    "mask_only": {
      "default": false,
      "description": "Whether 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.",
      "type": "boolean",
      "title": "Mask Only"
    },
    "operating_resolution": {
      "enum": [
        "1024x1024",
        "2048x2048",
        "2304x2304"
      ],
      "description": "The 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.",
      "default": "1024x1024",
      "type": "string",
      "title": "Operating Resolution"
    },
    "model": {
      "enum": [
        "General Use (Light)",
        "General Use (Light 2K)",
        "General Use (Heavy)",
        "Matting",
        "Portrait",
        "General Use (Dynamic)"
      ],
      "description": "\n            Model to use for background removal.\n            The 'General Use (Light)' model is the original model used in the BiRefNet repository.\n            The 'General Use (Light 2K)' model is the original model used in the BiRefNet repository but trained with 2K images.\n            The 'General Use (Heavy)' model is a slower but more accurate model.\n            The 'Matting' model is a model trained specifically for matting images.\n            The 'Portrait' model is a model trained specifically for portrait images.\n            The 'General Use (Dynamic)' model supports dynamic resolutions from 256x256 to 2304x2304.\n            The 'General Use (Light)' model is recommended for most use cases.\n\n            The corresponding models are as follows:\n            - 'General Use (Light)': BiRefNet\n            - 'General Use (Light 2K)': BiRefNet_lite-2K\n            - 'General Use (Heavy)': BiRefNet_lite\n            - 'Matting': BiRefNet-matting\n            - 'Portrait': BiRefNet-portrait\n            - 'General Use (Dynamic)': BiRefNet_dynamic\n        ",
      "default": "General Use (Light)",
      "type": "string",
      "title": "Model"
    }
  },
  "required": [
    "image_url"
  ],
  "additionalProperties": false
}
```

## Published example

This is the provider tool’s published example. Replace example values with the user’s requested inputs, respecting the schema; do not execute an example merely to test a connection.


```json
{
  "tool_id": "fal/birefnet-v2",
  "input": {
    "image_url": "https://storage.googleapis.com/falserverless/example_outputs/nano-banana-2-t2i-output.png"
  }
}
```

## Execute and retrieve

Inspect again before execution, explain the price and obtain the required authority. Use MCP run_tool or POST /v1/run with this tool ID, valid input and an idempotency key. Save the returned run ID and follow the actual state. If Agentik answers that the tool is temporarily unavailable, do not retry it blindly; use discovery to propose an alternative.

This tool uses deferred settlement. Follow its returned task/run instructions; preserve the existing reservation until the result is reconciled.

A partial or uncertain result can still have consumed provider resources. Consult [billing](/docs/billing.md), [idempotency](/docs/idempotency.md) and [asynchronous results](/docs/async.md).

[Provider documentation](https://fal.ai/models/fal-ai/birefnet/v2)

[REST inspection](https://api.agentik.cc/v1/tools/fal/birefnet-v2) · [OpenAPI](/openapi.json) · [Connection guide](/connect.md)

---

[HTML page](/providers/fal/birefnet-v2) · [Agent index](/llms.txt)
