Nodes/ComfyUI-OllamaGemini/Gemini BRIA RMBG
ComfyUI Node

Gemini BRIA RMBG

Background removal with an auto-pick version (not a Gemini call)

By al-swaiti·Created 2 years ago·Updated 2 months ago· 185
Gemini BRIA RMBG
  • image
  • image
  • mask
model_version

Name first: this doesn't touch Gemini and needs no API key. The "Gemini" prefix just marks it as part of the ComfyUI-OllamaGemini pack. What it really is: a local background remover built on BRIA's RMBG model. Give it an image, get the subject cut out and the mask that made the cut. It's the same tool as the pack's plain BRIA_RMBG node, with one small addition in the version menu.

What it's for

It removes backgrounds - the single most commoditized operation in the ecosystem, and still the least settled at the quality frontier. For a clean subject on a contrasting background it's instant and good; for hair, fur, or anything semi-transparent it's one contender in a field where you pick by which failures you can tolerate. Reach for it on product shots, quick subject extraction, and prepping a clean cutout for compositing onto a new scene.

How it works, and the version choice

The one real decision is model_version, and this node offers three options where the plain node offers two:

  • 2.0 - the newer, BiRefNet-style model. Sharper edges, especially on hair and busy boundaries. The default pick.
  • 1.4 - the older, lighter, faster generation. Acceptable edges; fine for simple subjects or tight hardware, weaker on the hard cases.
  • auto - lets the node choose a version for you. Convenient, but if edge quality matters, pick 2.0 explicitly rather than leaving it to a heuristic you can't see.

The inputs and outputs that matter

Two inputs - model_version and image - and two outputs:

  • image - the subject with a transparent background.
  • mask - the black-and-white alpha mask.

The mask is the flexible output: instead of accepting the automatic cutout, route mask into your own compositing, an inpaint, or a mask-combining step to tidy the selection first. The image output goes into a Save Image as PNG (to preserve transparency) or onto a fresh background.

Installing it

ComfyUI Manager: search ComfyUI-OllamaGemini, install, restart. Or:

cd ComfyUI/custom_nodes
git clone https://github.com/al-swaiti/ComfyUI-OllamaGemini
pip install -r requirements.txt

then restart. The RMBG weights download automatically on first run, so that first use needs a connection and pauses to fetch them. If background removal is all you're after, dedicated packs exist and ComfyUI now ships BiRefNet in core - this node earns its place only if you already have the pack for its other nodes.

Where people get burned

The prefix confusion is first: nobody's Google model is involved, and this behaves identically to the plain BRIA_RMBG node aside from the extra auto version - so don't expect magic from the name. Then the real ones. Licensing - BRIA's RMBG weights carry BRIA's own terms and gate commercial use more than most free removers, so check the license before shipping a product, not after. Hard edges - a cutout that looks clean on grey but breaks up against a colored background is a hard-mask segmenter hitting its ceiling on semi-transparent material; that needs a matting model, not a setting. And the LoRA footgun: don't run this on a training set to "clean" it - background-removed datasets teach the model to produce blank backgrounds. Save removal for finished images.

CategoryAI API

Inputs (2)

NameTypeDefaultDescription
model_versionCOMBO3 options: 1.4, 2.0, auto
imageIMAGE

Outputs (2)

NameTypeDescription
imageIMAGE
maskMASK