Nodes/ComfyUI/Load Background Removal Model
ComfyUI Node Runs on cloud

Load Background Removal Model

Background removal is now a core node — and it's BiRefNet

By Comfy-Org·Created 4 years ago·Updated about 19 hours ago· 130,663
Load Background Removal Model
    • bg_model
    bg_removal_name

    If you've spent any time trying to cut a subject out of a generated image, you know this used to mean installing a custom node pack, wrangling rembg, or hoping a web tool didn't crush your resolution. As of May 2026 that's over. ComfyUI shipped background removal into core, and this is the loader half of it: Load Background Removal Model hands you the model, and its sibling Remove Background does the actual cutout.

    The model in question is BiRefNet, which is worth knowing even if you never touch this node. It's the bilateral-reference segmentation network that quietly became the ecosystem's default cutout model - better on hair, fur, and semi-transparent material than the old u2net path. It's MIT-licensed, and it was never actually built for this job; the paper targets dichotomous image segmentation, and background removal just happened to be the application that took over its reputation.

    How it works

    The node reads a model file from models/background_removal/ and parses it into a BACKGROUND_REMOVAL object. Under the hood it checks for BiRefNet's characteristic weight keys - if your file isn't a BiRefNet checkpoint, you get a RuntimeError saying the file "does not contain a valid background removal model." That's not you doing it wrong; that's the loader being honest that it only speaks one format. The default file ComfyUI ships is birefnet.safetensors, and it needs no config file on your end - the architecture config is bundled inside the code.

    The inputs and outputs that matter

    There's exactly one input:

    • bg_removal_name - a dropdown of everything sitting in models/background_removal/. Pick the model; that's the whole job.

    One output:

    • bg_model (BACKGROUND_REMOVAL) - wire this into Remove Background, which generates a foreground mask and returns the subject on a transparent background.

    That's the entire graph: Load Background Removal Model → Remove Background → composite, save as PNG, or feed the cutout into something else.

    Getting the model

    ComfyUI does not auto-download it, so drop birefnet.safetensors (or a BiRefNet HR variant, if you can find a converted safetensors) into ComfyUI/models/background_removal/, then hit refresh. For images above roughly 1500px, the community consensus is that the HR weights beat the base 1024px model at keeping fine edges - the 1024 model downscales internally and throws away exactly the strands you were trying to preserve.

    Common issues

    The big one is trying to load a non-BiRefNet file: rembg exports, u2net weights, InSPyReNet weights - none of them load here, no matter how well they work in their own tools. If you're attached to those, use their own custom nodes; this node is strictly BiRefNet territory.

    Second, keep expectations calibrated on tricky edges. BiRefNet is the best default, but flyaway hair and genuinely transparent material (veils, glass, smoke) still come out wrong sometimes. The community's honest verdict is that no background remover has fully won on those cases - the pragmatic move is to test your own hardest three images before standardising a whole pipeline on any single model. For most people, though, this one node replaces an entire custom-node install, and that's a trade worth making.

    Categorymodel/loaders

    Inputs (1)

    NameTypeDefaultDescription
    bg_removal_nameCOMBOThe model used to remove backgrounds from images

    Outputs (1)

    NameTypeDescription
    bg_modelBACKGROUND_REMOVAL