# BiRefNet v2: Image and Video Background Removal, Price and API

> Remove image or video backgrounds with BiRefNet v2. Compare masks, output formats, operating resolution and compute-time pricing.

Canonical: https://raywake.si/blog/birefnet-v2-background-removal
Last updated: 2026-10-31

Published: 2026-10-31 · Raywake

**BiRefNet v2 separates foreground subjects from image or video backgrounds, with mask and foreground-refinement controls. On Raywake, both operations cost $0.01 per compute second, with a maximum of $0.28 per image run or $0.83 per video run. Operating-resolution choices are 1024x1024, 2048x2048 and 2304x2304. Compute seconds mean processing time, not the running time of a source video.**

Use [BiRefNet v2 for images](https://raywake.si/explore/birefnet/v2) or [BiRefNet v2 for video](https://raywake.si/explore/birefnet/v2/video) according to the material you need to isolate. A product cutout and a moving presenter share a background-removal goal, but require different output decisions. Prices and settings are as of 31 October 2026.

## BiRefNet v2 at a glance

| Setting                      | Image operation                 | Video operation       |
| ---------------------------- | ------------------------------- | --------------------- |
| Required input               | `image_url`                     | `video_url`           |
| Default selection            | `General Use (Light)`           | `General Use (Light)` |
| Operating resolution         | 1024x1024, 2048x2048, 2304x2304 | Same choices          |
| Default operating resolution | 1024x1024                       | 1024x1024             |
| Include mask                 | `output_mask`                   | `output_mask`         |
| Mask-only input              | `mask_only`                     | Not listed            |
| Refine foreground            | True by default                 | True by default       |
| Maximum per run              | $0.28                           | $0.83                 |

## How much does BiRefNet v2 cost?

Both entries use compute-time pricing. Keep the rate and maximum together when communicating an estimate.

| Operation                |        Compute-time rate | Maximum per run |
| ------------------------ | -----------------------: | --------------: |
| Image background removal | $0.01 per compute second |           $0.28 |
| Video background removal | $0.01 per compute second |           $0.83 |

The source video's duration is not a direct multiplier for this table. A video second and a compute second measure different things. Use a quote to budget the run instead of estimating its cost from clip length.

Request a quote for the actual operation and settings. If you change operating resolution or output choices, treat that as a new request to review.

## Do you need a cutout or a mask?

A cutout is useful when the next step is placing a subject on another background. A mask is useful when you want to control that separation in an editor. It represents the area to retain or remove rather than replacing the whole creative workflow.

The image operation offers both `output_mask` and `mask_only`, each defaulting to false. Use these fields deliberately according to whether you need the mask in addition to the result or as the main output. Video lists `output_mask` but does not list `mask_only`.

The image output choices are `webp`, `png` and `gif`, with `png` as the default. Video has its own output field and format names. Do not copy an image's `output_format` into a video request.

## Which model and operating resolution should you choose?

Both operations expose `General Use (Light)`, `General Use (Light 2K)`, `General Use (Heavy)`, `Matting`, `Portrait` and `General Use (Dynamic)`. These are values of the inner `model` input, distinct from the endpoint ID.

Start with the default unless your material gives you a reason to compare another selection. A portrait should be inspected around hair and ears; a product cutout around glass, handles and small gaps.

Operating resolution is a processing setting. Do not describe it as a guaranteed final output dimension. Keep it fixed while comparing model selections so you can identify which change affected the result. `refine_foreground` is true by default in both operations.

## How to call BiRefNet v2 through the API

The example requests an image quote with the default model and operating resolution, and asks for a mask alongside the background-removal result.

**Quote this request**

cURL:

```bash
curl --fail-with-body https://api.raywake.com/v1/quotes \
  -H "Authorization: Bearer $RAYWAKE_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"model":"birefnet/v2","input":{"image_url":"https://example.com/product.jpg","model":"General Use (Light)","operating_resolution":"1024x1024","output_format":"png","output_mask":true}}'
```

Python:

```python
import os
import requests

payload = {'model': 'birefnet/v2',
 'input': {'image_url': 'https://example.com/product.jpg',
           'model': 'General Use (Light)',
           'operating_resolution': '1024x1024',
           'output_format': 'png',
           'output_mask': True}}
response = requests.post(
    'https://api.raywake.com/v1/quotes',
    headers={'Authorization': f'Bearer {os.environ["RAYWAKE_API_KEY"]}'},
    json=payload, timeout=30,
)
response.raise_for_status()
print(response.json())
```

JavaScript:

```javascript
const payload = {
  "model": "birefnet/v2",
  "input": {
    "image_url": "https://example.com/product.jpg",
    "model": "General Use (Light)",
    "operating_resolution": "1024x1024",
    "output_format": "png",
    "output_mask": true
  }
};
const response = await fetch('https://api.raywake.com/v1/quotes', {
  method: 'POST',
  headers: { Authorization: `Bearer ${process.env.RAYWAKE_API_KEY}`, 'Content-Type': 'application/json' },
  body: JSON.stringify(payload),
  signal: AbortSignal.timeout(30000),
});
if (!response.ok) throw new Error(`Quote failed: ${response.status}`);
console.log(await response.json());
```

For video, use `birefnet/v2/video` and replace `image_url` with `video_url`. Its `video_output_type` choices are `X264 (.mp4)`, `VP9 (.webm)`, `PRORES4444 (.mov)` and `GIF (.gif)`. The default is `X264 (.mp4)`.

Video also offers `video_quality` values `low`, `medium`, `high` and `maximum`, defaulting to `high`. `video_write_mode` offers `fast`, `balanced` and `small`, defaulting to `balanced`. Match the requested output to your editor and check the result rather than assuming every format handles transparency identically. The [quotes reference](https://raywake.si/docs/reference/quotes) covers the response flow.

## What should you check before compositing?

View the isolated subject against both a light and dark background. This makes unwanted edge fringes and missing fine details easier to notice. Check holes within objects as well as the outside silhouette.

For video, watch the whole clip. A clean still frame does not show whether an edge flickers or disappears during motion. Inspect fast movement, hair and changing overlap with other objects. These are practical review steps, not claims that a specific selection eliminates all artifacts.

## Common questions

### Is the video price per second of footage?

No. You pay per compute second, with a maximum per run. Do not multiply the rate by source duration.

### Can I request just an image mask?

Yes. The image operation includes `mask_only`. That field is not listed for video.

### Does video use the same URL field?

No. Images use `image_url` and video uses `video_url`.

### Is a text prompt required?

Neither operation requires a prompt. The required input is the source media URL.

[Remove a background with BiRefNet v2](https://raywake.si/dashboard)

## Related

- [Raywake Blog](https://raywake.si/blog)
