Nodes/GFrbmg2/🐡 GF Remove Background (GFrbmg2Plus)
ComfyUI Node

🐡 GF Remove Background (GFrbmg2Plus)

The same cutout, but with a shared model, real background compositing, and a sticker machine

By gorillaframeaiΒ·Created 2 years agoΒ·Updated about a year agoΒ· 40
🐡 GF Remove Background (GFrbmg2Plus)
  • image
  • sticker_color
  • background_color
  • bg_image
  • image_rgba
  • mask
  • image
  • sticker_mask
β—„invert_maskfalseβ–Ί
β—„expand_mask0.0β–Ί
β—„blur_weight0.0β–Ί
β—„sticker_size0.0β–Ί
β—„sticker_blur0.0β–Ί
β—„use_original_bgfalseβ–Ί
β—„rotation0.0β–Ί
β—„interpolation_methodLanczosβ–Ί
β—„bg_image_scale0.0β–Ί

If you're choosing between the two nodes in the GF_nodes pack, pick this one. GFrbmg2Plus ("🐡 GF Remove Background (GFrbmg2Plus)") wraps the exact same BRIA RMBG-2.0 model, but it fixes the base node's one real flaw and then piles on the features: a shared model load, aspect-ratio-preserving resizing, a proper background compositor, and a built-in die-cut sticker maker.

The base node loads a separate copy of the ~1.5 GB model for every node instance you drop in a graph - two nodes, two copies in VRAM. Plus stores the model as a class-level singleton, so every Plus node in your workflow shares a single load. That alone is reason enough to reach for it. Everything else is gravy.

What it actually runs

Same RMBG-2.0 segmentation model, auto-downloaded into ComfyUI/models/RMBG/RMBG-2.0 on first run. The difference is upstream and downstream. Instead of squashing to a fixed 1024Γ—1024 like the base node, Plus resizes your input to the nearest multiple of 64 on each axis - your aspect ratio survives, and large inputs aren't distorted before the model sees them. The code prints a warning if an image is under 64px or over 4096px, which is your cue that big inputs are a VRAM question, not an error.

The inputs that matter

The mask cleanup here is just two knobs: expand_mask (dilate or erode the cutout, -255 to 255) and blur_weight (a Gaussian blur over the mask itself). Both run on GPU, both default to 0. Then invert_mask flips the cutout, and interpolation_method picks how the internal resize happens - Lanczos is the default and is fine.

The interesting part is compositing:

  • background_color - solid fill behind the subject (default black).
  • bg_image - an optional background image, with bg_image_scale and rotation to position it via center-crop/pad.
  • use_original_bg - keep the original background and just hand you the mask, which is the cheap "alpha extraction only" mode.

And the headline extra: sticker_size, sticker_blur, and sticker_color. When sticker_size is above 0, the node traces the mask's contours with OpenCV and draws a colored outline around your subject - that classic die-cut sticker border. Set sticker_size to the border thickness, pick a color, and you've skipped an entire Photoshop pass.

The outputs

  • image_rgba (IMAGE) - the cutout with alpha.
  • mask (MASK) - the actual mask tensor.
  • image (IMAGE) - the composite: subject over your solid color, your bg_image, or the original background.
  • sticker_mask (MASK) - the outline the sticker feature drew, empty if you left sticker_size at 0.

Installing it

cd ComfyUI/custom_nodes
git clone https://github.com/gorillaframeai/GF_nodes

Restart, and both nodes appear under 🐡 GorillaFrame/Image. The model self-downloads on first run, so give it a moment on the first queue. The pack's requirements.txt lists only Pillow, einops and timm, but the code actually imports transformers, torchvision and OpenCV - all present in a stock ComfyUI install in practice; if you hit an ImportError, pip install them into your ComfyUI environment.

Where people get burned

The same license catch as the base node: RMBG-2.0 is CC BY-NC 4.0, non-commercial only, and that's the README's own warning. Don't discover this one after you've shipped. The sticker feature is fun but coarse - sticker_size maps directly to a contour thickness, so expect a sticker, not a fine-edged matte. And use_original_bg is a nice shortcut, but the model still has to run; it doesn't skip inference.

This is the version of GF_nodes worth keeping installed. Shared model, sensible resizing, solid-color or image compositing, and a sticker generator you didn't know you wanted. Just keep it out of commercial work unless you've squared the license.

Category🐡 GorillaFrame/Image

Inputs (13)

NameTypeDefaultDescription
imageIMAGEβ€”
invert_maskBOOLEANfalseβ€”
expand_maskFLOAT0.0-255–255β€”
blur_weightFLOAT0.00–255β€”
sticker_sizeFLOAT0.00–255β€”
sticker_blurFLOAT0.00–255β€”
sticker_colorCOLOR#000000β€”
background_colorCOLOR#000000β€”
use_original_bgBOOLEANfalseβ€”
rotationFLOAT0.0-360–360β€”
interpolation_methodCOMBOLanczos4 options: Lanczos, Bicubic, Bilinear, Nearest
bg_imageoptIMAGEβ€”
bg_image_scaleoptFLOAT0.0-10–10β€”

Outputs (4)

NameTypeDescription
image_rgbaIMAGEβ€”
maskMASKβ€”
imageIMAGEβ€”
sticker_maskMASKβ€”