@loadmaster/sticker
v1.1.0
Published
Remove image backgrounds entirely in the browser — no server, no uploads, on-device AI.
Downloads
174
Maintainers
Readme
@loadmastercapital/sticker
Remove image backgrounds entirely in the browser. No API key. No server. No uploads. Powered by RMBG-1.4 running via ONNX Runtime Web.
Install
npm install @loadmastercapital/stickerRequires a GitHub Packages token for first install — see Authenticating to GitHub Packages.
Usage
import { removeBackground } from '@loadmastercapital/sticker'
// From a file input
const input = document.querySelector('input[type=file]')
const [file] = input.files
const cutout = await removeBackground(file)
// → transparent PNG Blob
// Download it
const url = URL.createObjectURL(cutout)
const a = document.createElement('a')
a.href = url; a.download = 'sticker.png'; a.click()With progress callbacks
const cutout = await removeBackground(file, {
onProgress: (percent) => console.log(`Downloading model: ${percent}%`),
onStatus: (status) => console.log(status), // 'loading_model' | 'processing'
})How it works
- First call: downloads the RMBG-1.4 model (~44 MB) from Hugging Face and caches it in the browser
- Subsequent calls: model loads from cache instantly
- Inference runs in a Web Worker — UI stays responsive
- WASM runtime files load from CDN (jsdelivr) — no build configuration needed
Browser support
Requires a browser with Web Workers, OffscreenCanvas, and WebAssembly support. All modern browsers qualify. WebGL acceleration is used automatically when available.
Notes
- Model license: RMBG-1.4 is licensed under Bria's non-commercial license. For commercial use, contact Bria or substitute an MIT-licensed model.
- Runtime code license: MIT — see LICENSE
Full sticker maker app
The web app lives at / — it adds outline effects, backgrounds, text overlays, animated GIF export, WhatsApp sticker export, and more on top of this package.
