Remove Backgrounds with Ease: A Step-by-Step Guide to ComfyUI's Workflow

CN
ComfyUI.org
2025-03-19 11:04:30

Workflow Overview

m8ftdz0w9dn0qccy3psb2de9008ec35e70870c0bbde3d1ef8e7082e1b32c37a69d1c292cbea6a17464d.png

The primary purpose of this workflow is to perform background removal on the same input image using multiple different models (such as RMBG-1.4, RMBG-2.0, Inspyrenet, and BEN2). Each model generates a background-removed image and its corresponding mask, allowing users to choose the most suitable result based on their needs.

Core Models

The workflow uses the following core models:

  • RMBG-1.4: A commonly used background removal model suitable for general tasks.

  • RMBG-2.0: An upgraded version of RMBG, providing more precise background removal.

  • Inspyrenet: A deep learning-based background removal model suitable for complex scenes.

  • BEN2: Another efficient background removal model, ideal for images with rich details.

These models are designed to remove the background from images, generating transparent-background images and their corresponding masks.

Component Explanation

Key components (Nodes) in the workflow include:

  1. LoadImage: Loads the input image for subsequent processing.

  2. easy imageRemBg: A background removal node that uses different models (e.g., RMBG-1.4, RMBG-2.0, Inspyrenet, and BEN2) to process the image.

Installation:

  • LoadImage: This is a core component of ComfyUI and does not require additional installation.

  • easy imageRemBg: Requires installation of the ComfyUI-Easy-Use plugin via ComfyUI Manager or GitHub. After installation, the easy imageRemBg node can be found in the node list.

Dependent Models:

  • The RMBG-1.4, RMBG-2.0, Inspyrenet, and BEN2 models need to be downloaded from Hugging Face or other model repositories and placed in the ComfyUI model directory.

Workflow Structure

The workflow can be divided into the following main parts:

  1. Image Loading Group:

    • LoadImage: Loads the input image.

    • Input: Image file path (e.g., ComfyUI_01105_ (1).png).

    • Output: Loaded image data for use by subsequent nodes.

  2. Background Removal Group:

    • Four easy imageRemBg nodes, each using a different model (RMBG-1.4, RMBG-2.0, Inspyrenet, and BEN2) to perform background removal.

    • Input: Image data passed from the LoadImage node.

    • Output: Background-removed images and their corresponding masks.

Input and Output

  • Input:

    • Image file path (e.g., ComfyUI_01105_ (1).png).

  • Output:

    • Four sets of background-removed images and their corresponding masks.

Notes

  • Model Download: Ensure all background removal models (e.g., RMBG-1.4, RMBG-2.0, etc.) are correctly downloaded and placed in the ComfyUI model directory.

  • Performance Requirements: Running multiple background removal models simultaneously may require significant GPU memory. A GPU with at least 8GB of VRAM is recommended.

  • Result Selection: Different models may produce varying results, so users can choose the most suitable output based on their needs.

Recommend