Skip to content
generated from qq15725/starter-ts

๐Ÿ˜ Uses an AI model to remove image backgrounds. Only the ESM.

License

Notifications You must be signed in to change notification settings

qq15725/modern-rembg

Folders and files

NameName
Last commit message
Last commit date

Latest commit

ย 

History

25 Commits
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 

Repository files navigation

modern-rembg

Minzip Version Downloads Issues License

๐Ÿ“ฆ Install

npm i modern-rembg

# peerDependencies
npm i onnxruntime-web@1.18.0

๐Ÿฆ„ Usage

import { removeBackground } from 'modern-rembg'

removeBackground('/example.jpg').then(blob => {
  window.open(URL.createObjectURL(blob))
})

Use custom model

import { removeBackground } from 'modern-rembg'

removeBackground('/example.jpg', {
  debug: true,
  model: '/you-custom-model.onnx', // default use u2netp.onnx
  resolution: 320, // model resolution
}).then(blob => {
  window.open(URL.createObjectURL(blob))
})

Open source models

Output Model Resolution Size(MB) From
u2net.onnx 320 168 danielgatis/rembg
u2netp.onnx 320 4 danielgatis/rembg
u2net_human_seg.onnx 320 168 danielgatis/rembg
u2net_cloth_seg.onnx 768 168 danielgatis/rembg
silueta.onnx 320 42 danielgatis/rembg
isnet-general-use.onnx 320 170 danielgatis/rembg
isnet-anime.onnx 1024 168 danielgatis/rembg
large 1024 176 imgly/background-removal-js
medium 1024 88 imgly/background-removal-js
small 1024 44 imgly/background-removal-js
PPModnet_MobileNetV2.onnx 320 26 PaddlePaddle/FastDeploy