Repository navigation
Install on Linux
Grab the AppImage for your GPU, chmod +x it, and run it. Not sure which one? The cpu one always works: slower, but never wrong.
- The quick install
- Which AppImage, and which AMD one to pick
-
From source:
install.sh, per distro - Uninstalling
-
Download the AppImage for your GPU from the latest release. The table below says which.
-
Make it runnable and start it:
chmod +x bg-be-gone-<ver>-cpu-x86_64.AppImage ./bg-be-gone-<ver>-cpu-x86_64.AppImage
<ver>is the version number, such as1.1.0, andcpuis whichever variant you picked.
Each release also has a SHA256SUMS file, if you like to check what you downloaded (sha256sum -c SHA256SUMS --ignore-missing).
The first background removal downloads its model (BiRefNet General, about 1 GB). The first segmentation downloads a SAM model, 110 to 770 MB, sized to your GPU. After that, everything works offline, train tunnels included.
| You have | Get | Notes |
|---|---|---|
| No GPU, or not sure | …-cpu-x86_64.AppImage |
Works everywhere. |
| NVIDIA GPU | …-cuda-x86_64.AppImage |
Needs a recent driver. Falls back to the CPU. |
| AMD RX 6800/6900, RX 7000, Instinct | …-rocm-x86_64.AppImage |
Falls back to the CPU on other cards. |
| AMD RX 6700 XT / 6750 XT | …-rocm-gfx1031-x86_64.AppImage |
Built for this one chip (gfx1031). |
| Only segmentation | …-seg-x86_64.AppImage |
No background removal. Much smaller, and runs on the CPU. |
Tip
The AppImages run on ONNX Runtime only, without PyTorch. For PyTorch's extra speed on a recent AMD or NVIDIA card, install from source.
Why two AMD AppImages?
ONNX Runtime's ROCm provider (the part that talks to AMD GPUs) ships precompiled code for a fixed list of chips. bg-be-gone uses the GPU only when it finds code for your chip; otherwise it runs on the CPU.
-
rocmcovers the chips AMD builds for: RX 6800/6900, RX 7000 and Instinct. -
rocm-gfx1031covers the RX 6700 XT / 6750 XT, which AMD ships no code for. It bundles a provider built for that chip. -
On the wrong card, either one still works, just on the CPU. Then the
cpuAppImage is the same experience in a smaller download, and your bandwidth will thank you.
bg-be-gone never makes your card pretend to be another one. GPU support tells that story, and how to get another AMD card accelerated.
For the latest code, PyTorch, or an AMD card the AppImages don't cover.
You need GTK 4, libadwaita and PyGObject from your distro, plus uv or Python 3.11 or 3.12.
| Distro | Command |
|---|---|
| Arch, CachyOS, Manjaro, EndeavourOS | sudo pacman -S gtk4 libadwaita python-gobject |
| Debian, Ubuntu | sudo apt install gir1.2-gtk-4.0 gir1.2-adw-1 python3-gi |
| Fedora | sudo dnf install gtk4 libadwaita python3-gobject |
Then:
git clone https://github.com/cristeigabriela/bg-be-gone
cd bg-be-gone
./install.shinstall.sh checks that GTK 4 and libadwaita load, detects your GPU, builds the worker (the background process that runs the models), and registers the app. Start it with bg-be-gone, from your app menu, or with Open With on an image.
- The default model: it offers to download BiRefNet General (about 1 GB), so the first run works offline. Yes is the default.
- PyTorch: on an AMD Radeon RX 5000 to 9000, or an NVIDIA RTX 20 or newer (GTX 16 too) with driver 580 or later, it offers PyTorch for BiRefNet and Segment, which runs faster. Yes is the default; it says the size first (1.5 to 2.8 GB). If PyTorch can't run, it's taken out again and ONNX Runtime carries on.
- On AMD, it checks the ROCm provider has code for your chip, then runs a small model on the GPU before it calls acceleration working. If your distro's ROCm runtime is missing, it names the packages to install and uses the CPU. GPU support has the details.
-
Keep the folder where it is: the app runs from the clone. It doesn't like surprise moves; after one, run
./install.shagain. - Re-running is safe, and redetects your GPU. Run it again after a driver or ROCm upgrade.
Note
Without a terminal (say, from a script), install.sh doesn't ask: it downloads the model and installs PyTorch. Pass the flags below to say no.
Options
| Option | Does |
|---|---|
--segment-only |
Segmentation only: skips rembg and BiRefNet. |
--no-model-download |
Let the app download the model on first use. |
--no-pytorch |
Leave PyTorch out; BiRefNet and Segment run on ONNX Runtime. |
BGBG_VENDOR=nvidia|amd|cpu |
Skip GPU detection and use this. |
BGBG_ROCM_WHEEL=<path> |
Use this ONNX Runtime ROCm provider instead of the stock one. See GPU support. |
./install.sh --help lists the flags, and a few more environment variables.
An AppImage? Delete the file. That's the whole goodbye.
Installed from source? Run ./uninstall.sh in the clone. It removes the app menu entry, the icon and the bg-be-gone command.
-
./uninstall.sh --purgealso removes the worker's environment (PyTorch included) and PyTorch's AMD kernel cache. - Your models and settings stay either way. Where things live says where, if you'd like them gone too.
Getting started
When you need it