Nodes/ComfyUI-Freepik/Freepik Remove Background
ComfyUI Node

Freepik Remove Background

Cut out a background without downloading a single model

By febogallo·Created 9 months ago·Updated 7 months ago· 0
Freepik Remove Background
  • image
  • image_no_bg
  • mask
  • info
api_key
use_cachetrue

Freepik Remove Background is the simplest node in this pack, and the most interesting one to argue about. You feed it an image, it hands back the cutout and a proper mask output. It's cloud-powered, needs an API key, and downloads zero model files.

Here's the honest context: background removal is the most commoditized operation in this whole ecosystem. BiRefNet ships inside ComfyUI core, is MIT-licensed, runs in well under a second, and is completely free. So why would you reach for a paid cloud version? Because it costs you nothing to set up. No model files, no VRAM, no version juggling - if you're on a weak machine, or you just want a cutout without thinking about which segmentation weights to load, this node is the "it just works anywhere" option. You're paying a small per-call fee for convenience.

How it works

The node converts your image tensor to a PNG, uploads it as a multipart request to api.freepik.com/v1/ai/beta/remove-background, and - unlike the pack's other nodes - this endpoint is synchronous, so it answers immediately. The result comes back as an RGBA image, and the node splits the alpha channel out into the mask. It caches by the MD5 hash of your image, so re-running the same picture is a cache hit and free.

The inputs and outputs

Only three inputs, which is the whole charm:

  • api_key - your Freepik API key (same one as the rest of the pack).
  • image - any IMAGE tensor.
  • use_cache - leave it on.

And three outputs:

  • image_no_bg - the RGBA cutout.
  • mask - the alpha channel as a proper MASK output.
  • info - a status string.

That mask output is the sleeper feature. Most local remover nodes make you go extract the alpha yourself; here it's handed to you on a plate, so wire it straight into a Composite node, MaskToImage, or anything else that eats a MASK. The classic workflow is Load Image → this node → Composite with your new background, and it's genuinely two wires.

Installing it

Same pack, same install. Via ComfyUI Manager, search ComfyUI-Freepik, or:

cd ComfyUI/custom_nodes
git clone https://github.com/febogallo/ComfyUI-Freepik
cd ComfyUI-Freepik
pip install -r requirements.txt

Restart, grab an API key from the Freepik Developer Dashboard ($5 free credits), and the node lives under Freepik/Utilities.

Where people get burned

The mask is derived from the alpha channel, which makes this a segmentation cutout, not true matting. Fine hair, veils, glass and smoke can come out rough - and a cutout that looks clean against a grey preview will show halos against a colored background. That's the classic segmentation-vs-matting trap, and a paid API doesn't magically escape it. If the mask ever comes back all-white, the API returned an image without an alpha channel and the node fell back to a full-ones mask - rare, but now you know what you're looking at.

Also worth repeating: every uncached run spends a sliver of your credits, and your image is being uploaded to Freepik's servers. Don't feed it anything that can't leave your machine. For bulk work, or anything with hard edges you care about, the free local BiRefNet path is still the better default - this node earns its keep when you want a zero-setup cutout on any hardware.

CategoryFreepik/Utilities

Inputs (3)

NameTypeDefaultDescription
api_keySTRING
imageIMAGE
use_cacheBOOLEANtrue

Outputs (3)

NameTypeDescription
image_no_bgIMAGE
maskMASK
infoSTRING