FeyNobg Model Loader
Load FeyNobg Without Breaking ComfyUI's Python
- model
- model_info
FeyNobg Model Loader is the companion node to Apply FeyNobg: it downloads the FeyNobg weights and loads them into memory, then hands the model to the Apply node as a FEYNOBG_MODEL connection. There's only one model it loads - feyninc/FeyNobg, a retrained 24-block BiRefNet variant at ~263M params - but the loader's real job is making sure that load doesn't destroy your ComfyUI environment. That's a more interesting story than it sounds.
Why this loader exists
FeyNobg was trained with feyninc's nobg toolkit, and that toolkit pins transformers 5.x. ComfyUI's own environment pins transformers 4.57.x. Those two do not coexist, and the obvious fix - installing the model's own dependencies - has a history of breaking ComfyUI entirely. This pack sidesteps the whole fight: requirements.txt is just four lines (huggingface_hub, modelscope, safetensors, Pillow), and the loader uses a vendored BiRefNet implementation with its own Swin backbone instead of importing transformers. So the README's warning is worth taking seriously: do not force-reinstall torch or transformers to satisfy the upstream model, or you'll be the one whose ComfyUI stops booting.
The vendoring isn't cosmetic. transformers' SwinBackbone is a private implementation detail whose parameter names changed between 4.x and 5.x, and an earlier version of this pack silently loaded with random backbone weights - the model ran and output near-black garbage. The current loader guards against it: it checks that the checkpoint covers at least 99.9% of the model's tensors and refuses to proceed otherwise. If you hit that error, update the pack rather than fighting it.
Inputs and outputs
source-huggingface(default) ormodelscope. Same model both ways; pick ModelScope if you're in China, where HF is slow. The pack even auto-setsHF_ENDPOINTto the hf-mirror.com mirror when unset.precision-auto,fp32,fp16(default),bf16.autotries bf16 then fp16 on CUDA, and it probes whether your exact torch/torchvision build'sdeform_conv2dsupports the dtype before committing - a thoughtful touch. fp16 is the right choice: the BiRefNet author measured it at basically no accuracy cost for half the VRAM.device_mode-auto(default),gpu,cpu.autouses ComfyUI'sget_torch_device(), so it follows whatever device the rest of your workflow runs on.keep_model_loaded- default true, which caches the model between runs so the Apply node doesn't reload it every time. Flip it off if VRAM is tight and you're batching other jobs; the loader unloads and empties the cache after inference.force_redownload- default false; only for when you suspect a corrupted download.
Two outputs: model (the FEYNOBG_MODEL handle, wired straight into Apply FeyNobg's model input) and model_info, a STRING with the variant, depths, precision and - usefully - the checkpoint weight-coverage percentage. It's the easiest way to verify you actually got FeyNobg (depths [2,2,24,2]) rather than plain BiRefNet ([2,2,18,2], which the loader warns about).
Install
ComfyUI Manager, search "FeyNobg". Or manually:
cd ComfyUI/custom_nodes
git clone https://github.com/idealisticABO/FeyNobg_comfyui
cd FeyNobg_comfyui
pip install -r requirements.txt
Restart ComfyUI. First run downloads ~1GB of weights into the shared ComfyUI/models/feynobg/ folder (mirrorable via an extra_model_paths.yaml entry), so any workflow on the machine reuses them.
Gotchas
Don't install nobg or upgrade transformers to use this node - the whole point is that you don't need to. If the ModelScope source throws, just switch to huggingface; the two repos are the same weights. And if model_info ever shows low weight coverage, that's the random-backbone failure mode the pack was fixed against - update to 1.0.1 or newer. Everything here, model included, is Apache-2.0.
Inputs (5)
| Name | Type | Default | Description |
|---|---|---|---|
| source | COMBO | huggingface | 2 options: huggingface, modelscope |
| precision | COMBO | fp16 | 4 options: auto, fp32, fp16, bf16 |
| device_mode | COMBO | auto | 3 options: auto, gpu, cpu |
| keep_model_loaded | BOOLEAN | true | — |
| force_redownload | BOOLEAN | false | — |
Outputs (2)
| Name | Type | Description |
|---|---|---|
| model | FEYNOBG_MODEL | — |
| model_info | STRING | — |