ComfyUI > Nodes > ComfyUI-BiRefNet-Hugo > 🔥BiRefNet

ComfyUI Node: 🔥BiRefNet

Class Name

BiRefNet_Hugo

Category
🔥BiRefNet
Author
Hugo (Account age: 43days)
Extension
ComfyUI-BiRefNet-Hugo
Latest Updated
2024-09-22
Github Stars
0.11K

How to Install ComfyUI-BiRefNet-Hugo

Install this extension via the ComfyUI Manager by searching for ComfyUI-BiRefNet-Hugo
  • 1. Click the Manager button in the main menu
  • 2. Select Custom Nodes Manager button
  • 3. Enter ComfyUI-BiRefNet-Hugo in the search bar
After installation, click the Restart button to restart ComfyUI. Then, manually refresh your browser to clear the cache and access the updated list of nodes.

Visit ComfyUI Online for ready-to-use ComfyUI environment

  • Free trial available
  • High-speed GPU machines
  • 200+ preloaded models/nodes
  • Freedom to upload custom models/nodes
  • 50+ ready-to-run workflows
  • 100% private workspace with up to 200GB storage
  • Dedicated Support

Run ComfyUI Online

🔥BiRefNet Description

Powerful image segmentation node using BiRefNet model for background removal, ideal for AI artists.

🔥BiRefNet:

BiRefNet_Hugo is a powerful node designed for image segmentation, specifically focusing on background removal. This node leverages the BiRefNet model to accurately segment and isolate the foreground from the background in images. It is particularly useful for AI artists who need to create clean, isolated images without manual editing. The node can handle various input images, resize them to the required dimensions, and apply the segmentation model to produce high-quality results. The flexibility to load a local model or use a pre-trained model from a remote source adds to its versatility. Additionally, it offers options to customize the background color, making it a valuable tool for creating transparent or colored backgrounds as needed.

🔥BiRefNet Input Parameters:

image

This parameter accepts the input image that you want to process for background removal. The image should be in a format compatible with the node, such as JPEG or PNG. The node will resize the image to the required dimensions and apply the segmentation model to it.

load_local_model

This boolean parameter determines whether to load a local model or use a pre-trained model from a remote source. If set to True, the node will load a model from the specified local path. If set to False, it will use the pre-trained BiRefNet model from the remote source. The default value is False.

background_color_name

This parameter allows you to specify the color of the background after the segmentation. You can choose from a variety of colors such as "transparency", "green", "white", "red", and many others. The default value is "transparency", which makes the background transparent.

device

This parameter specifies the device to be used for processing. Options include "auto", "cuda", "cpu", "mps", "xpu", and "meta". The default value is "auto", which automatically selects the best available device based on your system's capabilities.

local_model_path

This optional parameter specifies the path to the local model if load_local_model is set to True. It should be a string representing the file path to the model. If not provided, the node will use the default model path.

🔥BiRefNet Output Parameters:

image

This output parameter provides the processed image with the background removed. The image will be in the same format as the input image but with the specified background color or transparency.

mask

This output parameter provides the mask generated by the segmentation model. The mask highlights the foreground and background areas, which can be useful for further image processing or analysis.

🔥BiRefNet Usage Tips:

  • Ensure your input images are of high quality to achieve the best segmentation results.
  • Use the device parameter set to "auto" to let the node automatically select the best processing device available on your system.
  • Experiment with different background_color_name options to see which background color works best for your project.
  • If you have a custom-trained model, use the load_local_model parameter set to True and provide the local_model_path to utilize your model.

🔥BiRefNet Common Errors and Solutions:

AttributeError: What's your device(到底用什么设备跑的)?

  • Explanation: This error occurs when the node cannot determine the appropriate device for processing.
  • Solution: Ensure that your system has the necessary hardware and drivers installed. You can manually specify the device using the device parameter.

FileNotFoundError: [Errno 2] No such file or directory: 'path_to_model'

  • Explanation: This error occurs when the specified local model path does not exist.
  • Solution: Verify that the local_model_path is correct and that the model file is present at the specified location.

RuntimeError: CUDA out of memory

  • Explanation: This error occurs when the GPU does not have enough memory to process the image.
  • Solution: Reduce the size of the input image or use a device with more memory. Alternatively, you can set the device parameter to "cpu" to use the CPU for processing.

🔥BiRefNet Related Nodes

Go back to the extension to check out more related nodes.
ComfyUI-BiRefNet-Hugo
RunComfy

© Copyright 2024 RunComfy. All Rights Reserved.

RunComfy is the premier ComfyUI platform, offering ComfyUI online environment and services, along with ComfyUI workflows featuring stunning visuals.