Forum Discussion
How can I use AI tool for removing white background from image?
U^2-Net is actually the secret formula behind many advanced background removal tools that you try to avoid - it is precisely the AI model that performs the actual work behind the scenes. Therefore, if you want to remove white background from image on a Windows 10 computer, you can simply use the U^2-Net tool directly.
Option 1 - path
- Get the code from GitHub
- Install Python 3.6 or above and PyTorch
- Download the pre-trained model (the u2net. pth file)
- Run their demo script to observe the AI-generated mask (i.e., the black-and-white cropped image)
- Use this mask to actually crop out your subject and save it as a PNG file with transparency
Option 2 – The "Just Give Me Rembg" Shortcut
Honestly? The easiest way is using Rembg – it's basically U^2‑Net packaged into a dead‑simple Python library. You just type:
python
from rembg import remove
from PIL import Image
input = Image.open("your-photo.jpg")
output = remove(input)
output. save("no-background. png")
One line. That's it. Then you can remove white background from image in seconds.
Option 3 – The "I Have NVIDIA GPU" Flex
If you've got a decent graphics card, you can run U^2‑Net crazy fast – like 0.2 seconds per image fast. Without a GPU, you're looking at 1-2 seconds on a modern laptop. Still totally usable, just not instant.