DEV Community

MT
MT

Posted on ā€¢ Originally published at chi.miantiao.me on

Browser locally uses AI to remove image backgrounds

Yo, so I've been digging into this whole AI thing for front-end development lately, and stumbled upon this cool Transformers.js example. Turned it into a sweet little tool, check it out!

Basically, it uses Transformers.js in a WebWorker to tap into WebGPU and run this RMBG-1.4 model. Long story short, you can now use AI to nuke image backgrounds right in your browser. And get this, it only takes half a second to process a 4K image on my M1 PRO!

Here's the link to the tool: https://html.zone/background-remover

AI background remover


Wanna build it yourself? Head over to https://github.com/xenova/transformers.js/tree/main/examples/remove-background-client for the source code. Oh, and heads up, you gotta be on Transformers.js V3 to mess with WebGPU.

stat

AWS GenAI LIVE image

Real challenges. Real solutions. Real talk.

From technical discussions to philosophical debates, AWS and AWS Partners examine the impact and evolution of gen AI.

Learn more

Top comments (0)

A Workflow Copilot. Tailored to You.

Pieces.app image

Our desktop app, with its intelligent copilot, streamlines coding by generating snippets, extracting code from screenshots, and accelerating problem-solving.

Read the docs

šŸ‘‹ Kindness is contagious

Please consider leaving a ā¤ļø or a kind comment on this post if it was useful to you!

Thanks!