Skip to content

Alyetama/Rembg-Online

Repository files navigation

Rembg App

Web app to remove images background using rembg.

Docker Build pages-build-deployment Vercel deploy Docker Hub Supported Python versions Streamlit PEP8

Deployment

git clone https://github.com/Alyetama/Rembg-Online.git
cd Rembg-Online

Option 1: Run locally

pip install -r requirements.txt
streamlit run streamlit_app.py

Option 2: Free cloud hosting on Streamlit Cloud

streamlit_cloud

Option 3: Docker

docker run \
    -p 8501:8501 \
    -v "${PWD}/.streamlit:/home/app/.streamlit" \
    alyetama/rembg-app:latest

Docker Compose

docker-compose up -d
Updating
docker pull alyetama/rembg-app:latest

If you're using the pre-built docker image in docker-compose, you can update the image by running:

docker-compose down
docker-compose pull
docker-compose up -d

Configuration

  • To configure the streamlit application, edit .streamlit/config.toml (configuration reference).
  • To configure the maximum number of uploaded files (default: 10), set the environment variable MAX_FILES:
    • Option 1: Export the variable.
    export MAX_FILES=20
    • Option 2: Edit the value of MAX_FILES in .env.
    mv .env.example .env
    nano .env  # or any other text editor
    • On Streamlit Cloud: Go to the app settings -> Secrets -> MAX_FILES = 20 -> save.

Notes

  • The very first processed image after starting the app may take few minutes, because the backend model is being downloaded for the first time.