stable-diffusion-webui-rembg icon indicating copy to clipboard operation
stable-diffusion-webui-rembg copied to clipboard

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

Open dimitribarbot opened this issue 5 months ago • 0 comments

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.

dimitribarbot avatar Aug 27 '24 08:08 dimitribarbot