Load MODNet model by name
Load MODNet model by name — fastest cutter in the pack, portraits only
- model
- train_w
- train_h
- norm_params
MODNet is the speed demon of this pack, and it's worth understanding exactly what that speed buys you, because the answer is "people only." The pack's own benchmarks on an RTX 3060: 60ms and 175MB of VRAM at 512px. That's not a typo. It's an order of magnitude faster than everything else here and it runs on a potato. The catch is in the model table: the only two checkpoints are MODNet Photo portrait and MODNet Webcam portrait, both 26 MiB, both trained for a single job - separating a person from a background. MODNet was designed for fast, real-time separation and it is not a general model.
So the honest use case: you have a human, or thousands of them. Product catalog shots with a person, video call style footage, batch portrait processing where BiRefNet's half-second per frame adds up to real time. For anything that isn't a person, the model will happily guess anyway and give you worse results than U-2-Net would for free. Don't be the person who feeds it a dog and blames the node.
What you set
model_name-MODNet Photo portraitvsMODNet Webcam portrait. The practical difference is thin; photo is the one most people want. The dropdown tells you both are 26 MiB, so downloads are instant.device- AUTO is fine.dtype- AUTO. At these sizes you could run fp32 all day and never notice the VRAM.
Outputs
model(SET_REMBG) → intoRemove background/Remove background (full)/Get background mask.train_w,train_h- 512×512. The simple remove node uses this automatically.norm_params- manual pre-processing only.
Install
Same pack, same drill:
cd ComfyUI/custom_nodes
git clone https://github.com/set-soft/ComfyUI-RemoveBackground_SET
pip install -r ComfyUI-RemoveBackground_SET/requirements.txt
ComfyUI 0.3.48+, seconohe >= 1.0.6 (fresh pip install git+https://github.com/set-soft/seconohe.git if it errors on import). Models auto-download into ComfyUI/models/rembg.
The way to think about this loader: it's your dedicated "people pipeline" node. Keep a workflow with MODNet loaded for portrait batch jobs and one with BiRefNet or IS-Net for everything else. If you're doing video with a talking head and want background replacement without melting your GPU, MODNet at 60ms a frame is the difference between "sure, why not" and "I'll render that overnight." Just respect the portrait-only boundary and it'll be your fastest friend in the pack.
Inputs (3)
| Name | Type | Default | Description |
|---|---|---|---|
| model_name | COMBO | The name of the model, from the list of known models of this type | |
| device | COMBO | Device where the model will be run | |
| dtypeopt | COMBO | AUTO | Data type used for inference. `AUTO` means the same as the model on disk.Using a smaller size will save resources, but might degradate the results. |
Outputs (4)
| Name | Type | Description |
|---|---|---|
| model | SET_REMBG | The remove background model ready to be used in a processing node |
| train_w | INT | Width of the images used to train this model |
| train_h | INT | Height of the images used to train this model |
| norm_params | NORM_PARAMS | Normalization parameters for the input images. This is needed only for advanced use when you want to manually pre-process the images. The `Arbitrary Normalize` node from `Image Misc` can use these parameters to apply the correct normalization. |