[PR #47] Update rembg dependency and add BiRefNet models in the list of available RemBG models #55

Open
opened 2026-10-30 21:08:57 +00:00 by bsakaguchi · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/AUTOMATIC1111/stable-diffusion-webui-rembg/pull/47
Author: @dimitribarbot
Created: 8/27/2024
Status: 🔄 Open

Base: master ← Head: add-birefnet-models


📝 Commits (1)

  • 28f2469 Update rembg dependency and add BiRefNet models in the list of available RemBG models

📊 Changes

5 files changed (+50 additions, -7 deletions)

View changed files

📝 .gitignore (+1 -0)
📝 README.md (+4 -0)
📝 install.py (+14 -2)
📝 scripts/api.py (+10 -2)
📝 scripts/postprocessing_rembg.py (+21 -3)

📄 Description

Hi,

The goal of this PR is to add BiRefNet models to the list of available remove background models. It follows discussion here and merged PR in rembg here.

The following modifications have been made:

  • Force installation of the latest 2.0.59 version of rembg even if a previous one was already installed.
  • Add of a radio button allowing users to select either "Classic" models (it's the defaut option, which allows to use the same models as before my modifications) or "BiRefNet" models:

image

  • Remove duplicate isnet-general-use entry from the list of classic models.
  • Add parameter providers when calling rembg from UI or API with only CUDAExecutionProvider and CPUExecutionProvider as by default all available providers may be used, for instance TensorrtExecutionProvider or AzureExecutionProvider, even if no external dependency is installed with this extension, leading to an error message in the console. Internally, rembg will remove CUDAExecutionProvider from its list of providers if it's not an available provider (cf. here).
  • Update README file accordingly to this PR modifications.
  • Add .vscode folder to .gitignore to avoid development environment configuration pollution.

Please let me know if I need to make any changes.


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/AUTOMATIC1111/stable-diffusion-webui-rembg/pull/47 **Author:** [@dimitribarbot](https://github.com/dimitribarbot) **Created:** 8/27/2024 **Status:** 🔄 Open **Base:** `master` ← **Head:** `add-birefnet-models` --- ### 📝 Commits (1) - [`28f2469`](https://github.com/AUTOMATIC1111/stable-diffusion-webui-rembg/commit/28f24691f106cbe8c942b6914b055b846dd4b4d8) Update rembg dependency and add BiRefNet models in the list of available RemBG models ### 📊 Changes **5 files changed** (+50 additions, -7 deletions) <details> <summary>View changed files</summary> 📝 `.gitignore` (+1 -0) 📝 `README.md` (+4 -0) 📝 `install.py` (+14 -2) 📝 `scripts/api.py` (+10 -2) 📝 `scripts/postprocessing_rembg.py` (+21 -3) </details> ### 📄 Description Hi, The goal of this PR is to add [BiRefNet](https://github.com/ZhengPeng7/BiRefNet) models to the list of available remove background models. It follows discussion [here](https://github.com/AUTOMATIC1111/stable-diffusion-webui/discussions/16033) and merged PR in rembg [here](https://github.com/danielgatis/rembg/pull/665). The following modifications have been made: - Force installation of the latest 2.0.59 version of `rembg` even if a previous one was already installed. - Add of a radio button allowing users to select either "Classic" models (it's the defaut option, which allows to use the same models as before my modifications) or "BiRefNet" models: ![image](https://github.com/user-attachments/assets/8f478430-a356-46be-bb55-fc58ee83a494) - Remove duplicate `isnet-general-use` entry from the list of classic models. - Add parameter `providers` when calling `rembg` from UI or API with only `CUDAExecutionProvider` and `CPUExecutionProvider` as by default all available providers may be used, for instance `TensorrtExecutionProvider` or `AzureExecutionProvider`, even if no external dependency is installed with this extension, leading to an error message in the console. Internally, `rembg` will remove `CUDAExecutionProvider` from its list of providers if it's not an available provider (cf. [here](https://github.com/danielgatis/rembg/blob/main/rembg/sessions/base.py#L26)). - Update README file accordingly to this PR modifications. - Add .vscode folder to .gitignore to avoid development environment configuration pollution. Please let me know if I need to make any changes. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
Sign in to join this conversation.
No labels
pull-request
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
AUTOMATIC1111/stable-diffusion-webui-rembg#55
No description provided.