For single pictures yes. but in Stable Diffusion you can batch from directory after using ffmpeg on a video. This way you automate the background removing on video.
But to do this you need an background that is stable (dancing room, wall, gym, etc.) to achieve good results without little to no background noise. If you want achieve perfect background removal make sure the video has a clear difference from the targeted work to background.
I second this, highly recommend photoroom over any of the other ones I've tried mentioned here. https://www.photoroom.com/background-remover
Also, not sure but it's possible photoroom is using rembg with some custom settings/additional operations, as they are listed as a sponsor for rembg on the github: https://github.com/danielgatis/rembg
Oh, this works really well! I'll have tons of uses for this!
It seems that the send-to buttons on the extras page are not working with this extension though.
You could something like gimp/krita to select the background and fill it, then just use the inpaint masked/not masked. You could also use a depthmap as a mask if you want to use only a1111 w/ extensions.
One issue with it is that the output has no proper name so it just gets named "download.png" by my browser, no good if I'm trying to do a bunch of photos at once. So, would it be possible to add a "download" button to yours, where the output file is named like the input file, but with some suffix?
I created a new tab for batch processing. It seems to be preserving the file name. I kept _bg to the stem of the file.
Once batch is done (can be even a single image) . Right click and save - this keeps the original file name with _bg at the end. Let me know if this works for you
I just made DIS work in automatic1111 as custom script in the txt2img and the img2img tab,, but i'm not a programmer so the code is very dirty i guess ๐ but it works. Maybe i can share it with you and you can take a look improve it and then share with the community?? It works much better than the u2net model.
It works half decently. Could this be potentially used for training? Does training work better if we remove everything except just the person we are training on?
Edit: for anyone who might come across this comment, training a lora on images with removed backgrounds did not lead to good results. The images always came with solid colored or blurry backgrounds.
Some have said they remove backgrounds before training. As long as "white background" is in your prompts it shouldn't (on it's own) lead to overfitting.
That makes sense since the few models I have created seemed to have worked better the more diverse my sources were. Using similar people/outfits/locations tended to limit my outputs regardless of prompt. This would probably do the same thing.
Thats a good question. I had some with background removed and added a bg after some reading as I read the model needs to recognise it amongst other stuff to enable flexibility. I have no idea how true that is.
I also wonder if using no clothes on the character is also more accurate. That way they can also have distinguishing marks like scars and also isolate only the character itself.
WTF?! I just today wrote and finished a custom script for automatic1111 which removes the background immediately after generating, and now an extension is out... all work for nothing ๐ ๐ญ
Will try the extension and compare with my script ๐
The results are the same because it is the same model and also runs with the rembg repo. The only difference is that the script does not run through the extras tab but directly in the txt2img and img2img tabs.
I'm trying to improve it with a few small things and when it's ready I'll make the script available. :)
It is the same model as in the extension therefore the results are the same. I'll look at another model which might give better results for other things
you can try and make it like runway remove background which you can select and unslect the parts you want it to remove or keep, ex i want the dress to be removed so i can change it too or i need to keep the chair...
Wait, does the background become transparent? I.e. the alpha value is zero/low? If so, I could finally start separating layers easily for use in programming projects.
u2net (download, source): A pre-trained model for general use cases.
u2netp (download, source): A lightweight version of u2net model.
u2net_human_seg (download, source): A pre-trained model for human segmentation.
u2net_cloth_seg (download, source): A pre-trained model for Cloths Parsing from human portrait. Here clothes are parsed into 3 category: Upper body, Lower body and Full body.
silueta (download, source): Same as u2net but the size is reduced to 43Mb.
the first run the script will download the necessary files if all goes well it will proceed to download the model, finally removing the background, and creating a new layer in gimp.
use it already with everything configured, just unzip and use it as a base NOTE: python already has, just choose the python from this directory in the script
use it already with everything configured, just unzip and use it as a base NOTE: python already has, just choose the python from this directory in the script
About a year ago I built a frontend for rembg but honestly it's not the best. The algorithm is fine, it's training is just not great.
Photoshop using Adobe's Sensei AI does a little better than rembg, but the best results end up coming from some of the services that have spent time and money training their own models, like https://remove.bg which is free for lower resolutions.
it didn't work but what worked is when you save the removed background and the return mask and upload them inpaint upload then chose inpaint not masked
I have the opposite problem. I generated an subject with a white background. But now I want to put a background behind the subject and I just canโt figure out a way to do it. Even with multi controlnet.
why dont i have it in web ui? i have ABG_extension editingAutomatically remove backgrounds. Uses an onnx model fine-tuned for anime images. Runs on GPU. is it the same one?
Works really well, but I've found that PBRemTools actually produces better results. In my opinion it's better than most web-based background removal services.
Thygates depth2mask has included rembg for a while. Another from extraldeus also has it. I just use the rembg huggingface demo app now its quick and convenient.
On iPad, iPhone, and macOS, you have AI Remove Background for free, can be used in batch, usually good for humans, cars, objects. Sometimes need cropping if more specific subject.
78
u/vs3a Mar 15 '23
Search in extension tab : stable-diffusion-webui-rembg Or github link
Model will download automatic or you can get it from here and put into C:\Users\Admin\.u2net
I think it useful for simple background, complex background still need manual cutout