This example demonstrates how to use rembg-web via global variables (UMD
build) instead of ES module imports.
⚠️ Data Usage Notice: First-time usage will download the
AI model (~200-300MB). Subsequent uses will load from cache. Please ensure
you have a stable internet connection and sufficient data allowance.
How it works:
1. Include ONNX Runtime:
<script
src="https://unpkg.com/onnxruntime-web@latest/dist/ort.min.js"></script>
2. Include rembg-web UMD:
<script
src="https://unpkg.com/@bunnio/rembg-web@latest/dist/index.umd.js"></script>
3. Access via global: const { remove } = RembgWeb;