Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feature: some hints #2

Open
kalle07 opened this issue Sep 3, 2024 · 3 comments
Open

feature: some hints #2

kalle07 opened this issue Sep 3, 2024 · 3 comments

Comments

@kalle07
Copy link

kalle07 commented Sep 3, 2024

first thx... it works ;)

if i only check the box "Return foreground" (or i dont check anything)
always the mask image is saved -> its useful to only save the foreground-image

if i have a named file "image(123).png" the saved file after remove background is "image123.png" (i know backets sometimes heavy) but all local image generators save the file in brackets (a1111, webui, fooocus)

is it possible to process multible images at once (like multicore for CPU), or is that not on your code?

do you have any idea what the differences are between the checkpoints? ok "portrait" i know ...

@dimitribarbot
Copy link
Owner

dimitribarbot commented Sep 3, 2024

Hi @kalle07,

if i only check the box "Return foreground" (or i dont check anything)
always the mask image is saved -> its useful to only save the foreground-image

I've pushed a modification to handle this use case. After extension update, by going to your "Extensions" tab and clicking on "Check for updates" and then "Apply and restart UI", you should now see:

image

Keep "Return mask" unchecked and it should not be returned anymore.

if i have a named file "image(123).png" the saved file after remove background is "image123.png" (i know backets sometimes heavy) but all local image generators save the file in brackets (a1111, webui, fooocus)

Unfortunately, the output file name is not handled by this extension but by Automatic1111's SD WebUI "Extras" tab. If you try with another extra, for instance "Upscale", you will get the same result. You should open an issue to their repository instead.

is it possible to process multible images at once (like multicore for CPU), or is that not on your code?

The original author of BiRefNet handles multiple images sequentially. You can ask for a new feature in the BiRefNet repository. If they implement it then it will probably be available in SD WebUI as I often keep this repository in sync with theirs.

do you have any idea what the differences are between the checkpoints? ok "portrait" i know ...

For these specific details, I think you would have more information by directly asking to the original author of BiRefNet.

UPDATE: For this last question, I've updated the README with basic information for each model:

The available models are:

- General: A pre-trained model for general use cases.
- General-Lite: A light pre-trained model for general use cases.
- Portrait: A pre-trained model for human portraits.
- DIS: A pre-trained model for dichotomous image segmentation (DIS).
- HRSOD: A pre-trained model for high-resolution salient object detection (HRSOD).
- COD: A pre-trained model for concealed object detection (COD).
- DIS-TR_TEs: A pre-trained model with massive dataset.

@kalle07
Copy link
Author

kalle07 commented Oct 11, 2024

is it possible to support the models with a prompt ?

@dimitribarbot
Copy link
Owner

Yes, I guess this should be possible using the procedure used in the Segment Anything extension:

  1. Use GroundingDINO to draw boxes on items described by a text input prompt.
  2. Use these boxes and BiRefNet to remove the background from these bounding boxes only, as described in this notebook created by the BiRefNet original author.

However, many changes would need to be made to this extension.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants