EasyUse/Imagegenerated

Image Remove Bg(imageRemBg)

The Image Remove Bg node removes the background from input images and returns both the cut-out image and a corresponding alpha mask.

image Rem Bg

images
image
mask
rem_mode
RMBG-1.4
image_output
Preview
save_prefix
ComfyUI
torchscript_jit
add_background
none
refine_foreground
Easy Use

Description

The Image Remove Bg node removes the background from input images and returns both the cut-out image and a corresponding alpha mask. It is part of the EasyUse/Image category.

Inputs

  • images (IMAGE): The input image or batch of images to process.

  • rem_mode (COMBO): The background-removal model to use. Options:

    • RMBG-2.0
    • RMBG-1.4
    • Inspyrenet
    • BEN2

    Defaults to RMBG-1.4.

  • image_output (COMBO): Controls how the resulting image is handled. Options:

    • Hide — Do not show the output image in the UI.
    • Preview — Show the output image in the UI.
    • Save — Save the output image to disk.
    • Hide/Save — Hide the preview and save the image to disk.

    Defaults to Preview.

  • save_prefix (STRING): The filename prefix used when the output image is saved. Defaults to ComfyUI.

  • torchscript_jit (BOOLEAN, optional): Enables TorchScript JIT inference when supported by the selected model. Defaults to false.

  • add_background (COMBO, optional): Adds a solid background color to the result after background removal. Options:

    • none
    • white
    • black

    Defaults to none.

  • refine_foreground (BOOLEAN, optional): Enables additional foreground refinement for cleaner edges and detail. Defaults to false.

Outputs

  • IMAGE: The processed image with the background removed, or with the selected solid background applied.
  • MASK: The alpha mask representing the removed background.

Usage Notes

The rem_mode selection changes the underlying background-removal model, so different modes may produce different results depending on the subject matter. Use image_output to control whether results are previewed, saved, or both. The save_prefix is only relevant when an output mode that includes saving is selected. torchscript_jit can improve inference speed on supported setups, while refine_foreground is useful when the default mask leaves rough edges around the subject.

Comments

Sign in with GitHub to join the discussion.

Loading comments…