Build remove.bg

YESreplaces $9/mosaves $108/yrback to the verdict

0%0 of 15 items done

Saved on this device only. Tick prerequisites first, then work the phases in order · do not start one until the checks above it pass.

Background removal on your own machine: rembg behind a CLI and a localhost page with drag-and-drop, batch processing, background replacement and export at full resolution. Nothing is uploaded anywhere.

estimated effort one sittingthe files for this build are in the project pack

Enginerembg with onnxruntimeRuntimePython 3.11+, a stdlib or FastAPI server on localhostUIVanilla HTML and JS

Before step 1

Everything below is assumed from the first step. Tick each one when you actually have it, not when you plan to.

  1. installfree

    Why Every step below is a command you type or a file you edit.

    Get it VS Code (code.visualstudio.com), Cursor or Zed. Open a folder for the project and use the editor's built-in terminal. open ↗

    Verify You can open a folder and run a command in its terminal

  2. installfree

    Why History for your code, and the way most hosts deploy.

    Get it Install from git-scm.com or with your package manager, then run git init in the project folder once it exists. open ↗

    Verify git --version prints a version

  3. installfree

    Why rembg is a Python package.

    Get it python.org or your package manager; use a virtual environment. open ↗

    Verify python3 --version prints 3.11 or higher

  4. installfree, a few GB of disk

    Why The whole engine. Models download on first use (hundreds of MB).

    Get it python3 -m venv .venv && source .venv/bin/activate && pip install 'rembg[cli]' onnxruntime open ↗

    Verify rembg --help prints usage

  5. have readyfree

    Why Each phase is judged on real results.

    Get it Three photos.

Environment variables

These go in a .env file the app reads at startup. The pack's .env.example is this table as a file · copy it, never commit the filled-in version.

VariableNeededExampleWhere the value comes from
PORTrequired8000Localhost port for the page.
REMBG_MODELoptionalisnet-general-useDefault model; birefnet for hair, u2net for speed.
MODEL_DIRoptional~/.u2netWhere rembg stores downloaded models.

The build, in order

  1. The CLI

    cut in.jpg out.png with model and alpha-matting flags.

    1. terminal
      python3 -m venv .venv && source .venv/bin/activate
      pip install 'rembg[cli]' onnxruntime pillow
    done when · tick each as it passes
  2. Batch

    A folder in, a folder out, resumable.

    done when · tick each as it passes
  3. The page

    Drop, paste, pick; before/after; only localhost in the network tab.

    done when · tick each as it passes
  4. Backgrounds and export

    Replace with color, gradient or image; export at full size; copy.

    done when · tick each as it passes
  5. Package

    One-line install and model sizes stated.

    1. Files README.md

    done when · tick each as it passes
what this build does not replace
after v1, if you want it

Need the files? The project pack on the verdict page hands your agent the whole brief · more photo editing.