2024-11-18 19:27:46 +08:00
2024-11-18 17:30:35 +08:00
2024-11-18 19:09:49 +08:00
2024-11-18 19:27:46 +08:00
2024-11-18 17:30:35 +08:00
2024-11-18 17:30:35 +08:00
2024-11-18 19:09:49 +08:00
2024-11-18 19:10:11 +08:00
2024-11-18 18:04:29 +08:00
2024-11-18 18:04:29 +08:00
2024-11-18 17:30:35 +08:00

ComfyUI-BiRefNet-lite


English | 中文

Introduction

This repository packages the latest BiRefNet model as a ComfyUI node for use, supporting chunked loading on both CPU and GPU, as well as model caching features.

Features

Feature 1: Supports chunked loading on CPU and GPU

When CUDA is enabled, specify the cpu_size to load part of the model onto the CPU.
slot

Feature 2: Model Caching

Feature 3: Multiple Cropping Methods

Supports putalpha, naive, and alpha_matting cropping methods.
slot


Installation

Method 1:

  1. Navigate to the node directory, ComfyUI/custom_nodes/
  2. git clone https://github.com/rubi-du/ComfyUI-BiRefNet-lite.git
  3. cd ComfyUI-BiRefNet-lite
  4. pip install -r requirements.txt
  5. Restart ComfyUI

Method 2:

Directly download the node source code package, unzip it into the custom_nodes directory, and then restart ComfyUI.

Method 3:

Install via ComfyUI-Manager by searching for "ComfyUI-BiRefNet-lite".

Usage

Example workflows are placed in ComfyUI-BiRefNet-lite/workflow.

There are two options for loading models: one is to automatically download and load a remote model, and the other is to load a local model (in which case you need to set load_local_model to true and set local_model_path to the local model path under the models/birefnet directory, for example, the BiRefNet folder).


Model download links:

BiRefNet: https://huggingface.co/ZhengPeng7/BiRefNet/tree/main

BiRefNet_lite-2K: https://huggingface.co/ZhengPeng7/BiRefNet_lite-2K/tree/main

BiRefNet-portrait: https://huggingface.co/ZhengPeng7/BiRefNet-portrait/tree/main

BiRefNet-matting: https://huggingface.co/ZhengPeng7/BiRefNet-matting/tree/main

RMBG-2.0: https://huggingface.co/briaai/RMBG-2.0/tree/main


Usage of workflow.json

plot


Usage of video_workflow.json

Workflow Address

Acknowledgments

Thanks to all the authors of the BiRefNet repository ZhengPeng7/BiRefNet.

Some code was referenced from MoonHugo/ComfyUI-BiRefNet-Hugo. Thank you!

S
Description
No description provided
Readme GPL-3.0
7.7 MiB
Languages
Python 88.7%
JavaScript 11.3%