rembg-comfyui-node-better

rembg-comfyui-node-better
★ 72

图像抠图背景移除ONNX模型ComfyUI节点
基于 rembg 的 ComfyUI 节点,支持在节点内选择不同的 ONNX 模型进行图像抠图与背景移除,提升效果与可控性。
💡 在 ComfyUI 流程中按需选择 ONNX 模型进行高质量背景抠图。
🍴 8 Forks💻 Python🔄 2025-04-07
📦
网盘下载
复制链接后前往夸克网盘下载
https://pan.quark.cn/s/6862a2001521
Demonstration of the rembg node
📄 README

Rembg Background Removal Node for ComfyUI– you can choose which onnx model to use!

Many thanks to the author of rembg-comfyui-node for his very nice work, this is a very useful tool!

But I found something that could refresh this project to better results with better maneuverability!

In this project, you can choose the onnx model you want to use, different models have different effects! Choosing the right model for you will give you better results!

Example of use

How to use

  • Clone to your custom_nodes folder in ComfyUI:
  • git clone https://github.com/Loewen-Hob/rembg-comfyui-node-better.git

  • Install rembg[gpu] (recommended) or rembg, depending on GPU support, to your ComfyUI virtual environment. E.g.:
  • pip install rembg[gpu]

  • You should have installed the three packages torch Pillow numpy.
  • To use it, just look for the Image Remove Background (rembg) node and select the model you want to use!
  • Optional Models

    All models are downloaded and saved in the user home folder in the .u2net directory.

    The available models are:

  • 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.
  • isnet-general-use (download, source): A new pre-trained model for general use cases.
  • isnet-anime (download, source): A high-accuracy segmentation for anime character.
  • sam (download encoder, download decoder, source): A pre-trained model for any use cases.
  • Organization of work

  • The sam model is not easy to use, and I’d like to refine this feature in the future.
  • There are many parameters that can be adjusted in this method, such as: alpha_matting=True, alpha_matting_foreground_threshold=270, only_mask=True.....
  • I will set these adjustable parameters in the options of the node later on in my work, which will give better results!

    Stay tuned for more!

    Should we thank the author of rembg: