Nodes/Remove Background (SET)/Load MODNet model by name
ComfyUI Node

Load MODNet model by name

Load MODNet model by name — fastest cutter in the pack, portraits only

By set-soft·Created about a year ago·Updated 9 months ago· 18
Load MODNet model by name
    • model
    • train_w
    • train_h
    • norm_params
    model_name
    device
    dtypeAUTO

    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 portrait vs MODNet 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) → into Remove 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.

    CategoryRemBG_SET/Load

    Inputs (3)

    NameTypeDefaultDescription
    model_nameCOMBOThe name of the model, from the list of known models of this type
    deviceCOMBODevice where the model will be run
    dtypeoptCOMBOAUTOData 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)

    NameTypeDescription
    modelSET_REMBGThe remove background model ready to be used in a processing node
    train_wINTWidth of the images used to train this model
    train_hINTHeight of the images used to train this model
    norm_paramsNORM_PARAMSNormalization 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.