ComfyDeploy BiRefNet Model Input (Soze)
Hand your deployed workflow the power to pick its own cutout model
- model
- model_name
- status
BiRefNet is the model that displaced rembg as the default background remover - sharper edges on hair, fur and fabric mesh, MIT-licensed, and for a while the community standard was ComfyUI-RMBG. Its model input is a dropdown, and dropdowns are a pain when you're deploying a workflow through ComfyDeploy: the person calling your API wants to pass the model name as a string, not click a widget. ComfyDeploy BiRefNet Model Input is the adapter that closes that gap.
It doesn't do any segmentation itself. It's a resolver: it takes a model name and hands it back in a form that ComfyUI-RMBG's BiRefNet loader can accept, so a remote caller can choose BiRefNet-HR or BiRefNet_lite at request time.
How it works
The node knows the eleven valid BiRefNet names - BiRefNet-general (the default), BiRefNet_512x512, BiRefNet-HR, BiRefNet-portrait, BiRefNet-matting, BiRefNet-HR-matting, BiRefNet_lite, BiRefNet_lite-2K, BiRefNet_dynamic, BiRefNet_lite-matting, BiRefNet_toonout - and validates whatever it's given against them.
- The
modeldropdown is your default. Used whenever the override is empty or unconnected. - The
model_overridestring input takes precedence. This is the one you wire a ComfyDeploy "External Text" input (or anything else string-typed) into. Matching is case- and whitespace-insensitive, so a caller typingbirefnet-hrgets the canonicalBiRefNet-HR.
The model output is a wildcard (*) type, which is the whole trick: it plugs into BiRefNet's model input even though that input is declared as a COMBO. You convert the loader's model widget to an input in ComfyUI (right-click → Convert to input), wire this node's output in, and the remote string now controls the cutout.
Outputs: model (the resolved name, wired to the loader), model_name (same, as a plain string), and status.
Choosing which model to expose
This matters more than most people expect. The standard 1024px weights quietly downscale anything above ~1500px and throw away the edges you wanted kept - reach for BiRefNet-HR (2048 native) or BiRefNet_dynamic for big inputs, and the matting variants if you're dealing with veils, glass or smoke where a hard mask is structurally wrong. If you're exposing one default to remote callers, BiRefNet-general is the safe pick.
Installing it and gotchas
It's a Soze pack node, but it has a real dependency:
cd ComfyUI/custom_nodes
git clone https://github.com/SozeInc/ComfyUI_Soze.git
pip install -r ComfyUI_Soze/requirements.txt
And separately install ComfyUI-RMBG (via ComfyUI Manager), because that's the pack that actually runs the model. The BiRefNet weights download on first use - the first cutout in a fresh install can stall while they fetch.
Two things to watch. If a name you pass is rejected, it's not in the hardcoded list - that list mirrors RMBG's MODEL_CONFIG, so a model added in a newer RMBG won't be selectable here until the Soze pack updates it. And don't confuse this node with the ComfyDeploy API nodes in the same pack: those call the ComfyDeploy API and need a CD_API_KEY in your environment. This one just resolves strings - no key required, it works purely inside the graph.
Inputs (2)
| Name | Type | Default | Description |
|---|---|---|---|
| model | COMBO | BiRefNet-general | Default BiRefNet model. Used when model_override is empty/unconnected. |
| model_overrideopt | STRING | Optional model name (e.g. from a ComfyDeploy External Text input). If non-empty, overrides the dropdown. Case/whitespace-insensitive. |
Outputs (3)
| Name | Type | Description |
|---|---|---|
| model | * | — |
| model_name | STRING | — |
| status | STRING | — |