ComfyUI node for background removal, implementing InSPyReNet
I've tested a lot of different AI rembg methods (BRIA - U2Net - IsNet - SAM - OPEN RMBG, ...) but in all of my tests InSPyReNet was always ON A WHOLE DIFFERENT LEVEL!
The cherry on top is that InSPyReNet has MIT License which allows for Commercial use (for example BRIA does not allow Commercial use to my knowledge)
Check the Licenses for yourself I will not be held accountable :)
Added an advanced node that supports threshold
Superior rembg quality compared to other methods (just give it a try!)
Can take batch of images as input
Optimized for image batch to be the fastest rembg node (perfect for video frames)
Outputs both the image and the corresponding mask
Shows the progress in terminal
search for ComfyUI-Inspyrenet-Rembg
in ComfyUI-Manager and hit install.
Done!
- Go to your
custom_nodes
folder in ComfyUI, open the terminal and run the following command:
git clone https://github.com/john-mnz/ComfyUI-Inspyrenet-Rembg.git
- To install requirements, run the following commands:
cd ComfyUI-Inspyrenet-Rembg
pip install -r requirements.txt
- Download models to ComfyUI/models/transparent-background
ckpt_base.pth: https://drive.google.com/file/d/13oBl5MTVcWER3YU4fSxW3ATlVfueFQPY/view?usp=sharing
ckpt_base.pth: https://github.com/plemeri/transparent-background/releases/download/1.2.12/ckpt_base.pth
ckpt_fast.pth: https://github.com/plemeri/transparent-background/releases/download/1.2.12/ckpt_fast.pth
ckpt_base_nightly.pth: https://github.com/plemeri/transparent-background/releases/download/1.2.12/ckpt_base_nightly.pth
TODO: model loader for trained models
InSPyReNet_SwinB_HU.pth: https://drive.google.com/file/d/1HB02tiInEgo-pNzwqyvyV6eSN1Y2xPRJ/view?usp=sharing
InSPyReNet_SwinB_DIS5K.pth: https://drive.google.com/file/d/1aCxHMbhvj8ah77jXVgqvqImQA_Y0G-Yg/view?usp=sharing
InSPyReNet_SwinB_Plus_Ultra.pth: https://drive.google.com/file/d/13oBl5MTVcWER3YU4fSxW3ATlVfueFQPY/view?usp=sharing
If torchscript_jif is set to on, it will trace model with pytorch built-in torchscript JIT compiler. May cause delay in initialization, but reduces inference time and gpu memory usage.
download this file and drag and drop it into your comfyui as basic workflow: