Local image processing pipeline for background removal and upscaling.
Install dependencies with uv:
uv venv --clear --python 3.13
uv syncuv run uvicorn main:app --reload --port 8000Open http://localhost:8000 in your browser.
via rembg
birefnet-general: Best all-rounder (default)birefnet-portrait: Optimized for portraitsben: BEN — good hair/edge detailisnet-general-use: ISNet generalu2net: Legacy U2Net
Spandrel backend
realesrgan-x4: 4x — Photos (default)realesrgan-x2: 2x — Photosrealesrgan-x4-anime: 4x — Anime / illustrations
rembg handles downloading bg removal models automatically (~200–700 MB, cached in ~/.u2net/).
Experimental support for downloading upscaling models. Try downloading from UI first.
Place the .pth files in models/:
RealESRGAN_x4plus.pth: https://github.com/xinntao/Real-ESRGAN/releases/download/v0.1.0/RealESRGAN_x4plus.pthRealESRGAN_x2plus.pth: https://github.com/xinntao/Real-ESRGAN/releases/download/v0.2.1/RealESRGAN_x2plus.pthRealESRGAN_x4plus_anime_6B.pth: https://github.com/xinntao/Real-ESRGAN/releases/download/v0.2.2.4/RealESRGAN_x4plus_anime_6B.pth
