Skip to content

Runs in the browser · Vision

Run BEN2 in your browser

BEN2 downloads 209.0 MB over WebGPU (fp16), or 209.0 MB over WebAssembly (fp16), to strip backgrounds from images entirely in the tab with Transformers.js. No install, no server.

Vision · onnx-community/BEN2-ONNX

WebGPU download
209.0 MB
fp16
WASM download
209.0 MB
fp16
Parameters
94.63M
Pipeline task
background-removal

Reading

Only a single fp16 build is published for this repo.

2.21 MB/M params against a 1.73 MB/M vision median: dense for its parameter count.

Will it run in your browser?

Live check this browser

Checking for WebGPU support…

All measured variants

Quant Download size
Variant Size
fp16 WebGPU pick WASM pick 209.0 MB

Sizes measured from the HuggingFace API file tree for onnx-community/BEN2-ONNX, not estimated.

Use it with Transformers.js

import { pipeline } from "@huggingface/transformers";

const pipe = await pipeline("background-removal", "onnx-community/BEN2-ONNX", {
  device: "webgpu", // usually falls back to "wasm"; wrap in try/catch for production
  dtype: "fp16", // use "fp16" for the WASM build
});

const result = await pipe(/* your input */);

Requires npm install @huggingface/transformers (or the CDN build).

Sources

Same job, different size

FAQ

WebGPU or WASM for BEN2, in practice?

Chrome, Edge, and Safari 26+ run the WebGPU build (fp16) on the GPU. Firefox has WebGPU on Windows and Apple Silicon Macs but not everywhere yet. Any browser without a WebGPU adapter falls back automatically to the WebAssembly build (fp16) on CPU: same model, slower to load, slower to run.

What does fp16 mean for BEN2?

The WebGPU build here uses fp16: 16-bit floating point (half precision): smaller than fp32 with effectively no quality loss. The WASM fallback uses fp16: 16-bit floating point (half precision): smaller than fp32 with effectively no quality loss.

Sizes measured 2026-08-01 from the HuggingFace API. Last validated 2026-08-03. See all browser models or the methodology.